summaryrefslogtreecommitdiff
path: root/net/wireshark/Makefile
blob: 46e30218941971e6e9ba870b490ab23836062cf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Created by: Bill Fumerola <billf@chc-chimes.com>
# $FreeBSD$

PORTNAME?=	wireshark
PORTVERSION=	3.0.3
PORTREVISION?=	0
CATEGORIES=	net ipv6
MASTER_SITES=	http://www.wireshark.org/download/src/ \
		http://ftp.uni-kl.de/pub/wireshark/src/ \
		http://wireshark.askapache.com/download/src/all-versions/ \
		ftp://ftp.uni-kl.de/pub/wireshark/src/ \
		http://prdownloads.sourceforge.net/wireshark/ \
		http://ftp.yz.yamagata-u.ac.jp/pub/network/security/wireshark/src/ \
		ftp://ftp.yz.yamagata-u.ac.jp/pub/network/security/wireshark/src/ \
		http://wireshark.zing.org/download/src/
DISTNAME=	${DATADIR_NAME}-${PORTVERSION}

MAINTAINER=	marcus@FreeBSD.org
COMMENT?=	Powerful network analyzer/capture tool

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

CONFLICTS_INSTALL?=	wireshark-lite-[0-9]* tshark-[0-9]* tshark-lite-[0-9]*

DATADIR_NAME=	wireshark
DATADIR=	${PREFIX}/share/${DATADIR_NAME}

USES=		alias cmake cpe compiler:c++11-lang gettext-runtime \
		libtool localbase pathfix localbase:ldflags \
		perl5 pkgconfig python:3.4+ ssl tar:xz
USE_PERL5=	build
USE_GNOME=	glib20 libxml2
USE_LDCONFIG=	yes

LIB_DEPENDS+=	libgpg-error.so:security/libgpg-error \
		libgcrypt.so:security/libgcrypt \
		liblz4.so:archivers/liblz4 \
		libnghttp2.so:www/libnghttp2 \
		libsnappy.so:archivers/snappy

#CFLAGS+=	-funit-at-a-time
PLIST_SUB+=	PORTVERSION=${PORTVERSION}

.for x in capinfos editcap mergecap rawshark text2pcap dftest randpkt \
    reordercap captype randpktdump udpdump sharkd dumpcap
.if defined(LITE)
PKGNAMESUFFIX=		-lite
PLIST_SUB+=		${x:tu}="@comment $x not installed" \
			${x:tu}_LIB="@comment $x not installed " \
			${x:tu}_MAN="@comment $x not installed "
CMAKE_ARGS+=		-DBUILD_$x=OFF
EXTRA_PATCHES=		${FILESDIR}/extra-patch-doc_CMakeLists.txt
OPTIONS_EXCLUDE+=	RTP SNMP LUA CARES ANDROIDDUMP CISCODUMP SSHDUMP
.else
PLIST_SUB+=		${x:tu}=bin/$x \
			${x:tu}_MAN="" \
			${x:tu}_LIB=""
.endif
.endfor

OPTIONS_DEFINE=		GUI RTP SNMP MAXMIND LUA DECRYPT ANDROIDDUMP CARES SSHDUMP CISCODUMP

OPTIONS_SINGLE=		KERBEROS

OPTIONS_SINGLE_KERBEROS=KRB_BASE KRB_HEIMDAL KRB_MIT KRB_NONE

OPTIONS_DEFAULT?=	GUI SNMP MAXMIND KRB_BASE DECRYPT

GUI_DESC=		Enable Qt 5 based Wireshark GUI
RTP_DESC=		Enable support for playing back RTP streams
DECRYPT_DESC=		Decryption support for SSL and IPSec
ANDROIDDUMP_DESC=	Build androiddump extcap tool
MAXMIND_DESC=		Enable MaxMindDB-based GeoIP geolocation support
CARES_DESC=		Enable support for asynchronous DNS via c-ares
KERBEROS_DESC=		Kerberos dissection support
KRB_BASE_DESC=		Kerberos support via base system
KRB_HEIMDAL_DESC=	Kerberos support via security/heimdal
KRB_MIT_DESC=		Kerberos support via security/krb5
KRB_NONE_DESC=		Disable Kerberos support
SSHDUMP_DESC=		Build sshdump extcap tool
CISCODUMP_DESC=		Build ciscodump extcap tool

GUI_USES=		qt:5
GUI_USE=	qt=core,gui,multimedia,widgets,printsupport,svg,buildtools_build,linguisttools_build,qmake_build

LUA_USES=		lua:5[1-2]
KRB_BASE_USES=		gssapi
KRB_HEIMDAL_USES=	gssapi:heimdal
KRB_MIT_USES=		gssapi:mit

RTP_LIB_DEPENDS=	libspandsp.so:comms/spandsp
RTP_CPPFLAGS=		-I${LOCALBASE}/include
MAXMIND_LIB_DEPENDS=	libmaxminddb.so:net/libmaxminddb
SNMP_LIB_DEPENDS=	libsmi.so:net-mgmt/libsmi
CARES_LIB_DEPENDS=	libcares.so:dns/c-ares
DECRYPT_LIB_DEPENDS=	libgnutls.so:security/gnutls \
			libgcrypt.so:security/libgcrypt
SSHDUMP_LIB_DEPENDS=	libssh.so:security/libssh
CISCODUMP_LIB_DEPENDS=	libssh.so:security/libssh

KRB_NONE_CMAKE_ON=	-DENABLE_KERBEROS=OFF
KRB_NONE_CMAKE_OFF=	-DENABLE_KERBEROS=ON
KRB_NONE_CONFIGURE_ENV_OFF=	KRB5_CONFIG=${KRB5CONFIG}

LUA_CMAKE_ON=	-DENABLE_LUA=ON
LUA_CMAKE_OFF=	-DENABLE_LUA=OFF
RTP_CMAKE_ON=	-DENABLE_SPANDSP=ON
RTP_CMAKE_OFF=	-DENABLE_SPANDSP=OFF
SNMP_CMAKE_ON=	-DENABLE_SMI=ON
SNMP_CMAKE_OFF=	-DENABLE_SMI=OFF
CARES_CMAKE_ON=	-DENABLE_CARES=ON
CARES_CMAKE_OFF=	-DENABLE_CARES=OFF
DECRYPT_CMAKE_ON=	-DENABLE_GNUTLS=ON
DECRYPT_CMAKE_OFF=	-DENABLE_GNUTLS=OFF
ANDROIDDUMP_CMAKE_ON=-DBUILD_androiddump=ON
ANDROIDDUMP_CMAKE_OFF=-DBUILD_androiddump=OFF
SSHDUMP_CMAKE_ON=-DBUILD_sshdump=ON
SSHDUMP_CMAKE_OFF=-DBUILD_sshdump=OFF
CISCODUMP_CMAKE_ON=-DBUILD_ciscodump=ON
CISCODUMP_CMAKE_OFF=-DBUILD_ciscodump=OFF

LUA_CPPFLAGS=		-I${LUA_INCDIR}

GUI_CONFIGURE_ENV=	PATH="${PATH}:${QT_BINDIR}"
GUI_MAKE_ENV=		PATH="${PATH}:${QT_BINDIR}"

OPTIONS_SUB=		yes

.if defined(LITE)
CMAKE_ARGS+=	-DBUILD_androiddump=OFF \
		-DBUILD_sshdump=OFF \
		-DBUILD_ciscodump=OFF
PLIST_SUB+=	ANDROIDDUMP_LIB="@comment " \
		ANDROIDDUMP_MAN="@comment " \
		SSHDUMP_LIB="@comment " \
		SSHDUMP_MAN="@comment " \
		CISCODUMP_LIB="@comment " \
		CISCODUMP_MAN="@comment "
.endif

.include <bsd.port.options.mk>

.if empty(PORT_OPTIONS:MMAXMIND)
CMAKE_ARGS+=	-DBUILD_mmdbresolve=OFF
.else
CMAKE_ARGS+=	-DBUILD_mmdbresolve=ON
.endif

.if empty(PORT_OPTIONS:MGUI)
CMAKE_ARGS+=	-DBUILD_wireshark=OFF
PLIST_SUB+=	GUI="@comment "
.else
USES+=		desktop-file-utils shared-mime-info
INSTALLS_ICONS=	yes
PLIST_SUB+=	GUI=""
.endif

.if !defined(LITE)
.if ${PORT_OPTIONS:MANDROIDDUMP}
PLIST_SUB+=	ANDROIDDUMP_LIB="" \
		ANDROIDDUMP_MAN=""
.else
PLIST_SUB+=	ANDROIDDUMP_LIB="@comment " \
		ANDROIDDUMP_MAN="@comment "
.endif
.if ${PORT_OPTIONS:MSSHDUMP}
PLIST_SUB+=	SSHDUMP_LIB="" \
		SSHDUMP_MAN=""
.else
PLIST_SUB+=	SSHDUMP_LIB="@comment " \
		SSHDUMP_MAN="@comment "
.endif
.if ${PORT_OPTIONS:MCISCODUMP}
PLIST_SUB+=	CISCODUMP_LIB="" \
		CISCODUMP_MAN=""
.else
PLIST_SUB+=	CISCODUMP_LIB="@comment " \
		CISCODUMP_MAN="@comment "
.endif
.endif

.if ${PORT_OPTIONS:MKRB_BASE} && exists(${LOCALBASE}/include/krb5.h)
IGNORE=			cannot build with base Kerberos if krb5 port is installed. \
			Use ``make config'' to choose a different option
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|/usr/share/applications|${DESKTOPDIR}|g ; \
		s|/usr/share|${LOCALBASE}/share|g' \
		${WRKSRC}/CMakeLists.txt
	@${REINPLACE_CMD} -e 's|lua$${LUA_INC_SUFFIX}|lua-${LUA_VER}|g' \
	    	${WRKSRC}/cmake/modules/FindLUA.cmake

.include <bsd.port.mk>