Update math/reduce to version 20210413
[dports.git] / net / wireshark / Makefile
1 # Created by: Bill Fumerola <billf@chc-chimes.com>
2
3 PORTNAME?=      wireshark
4 PORTVERSION=    3.4.6
5 CATEGORIES=     net
6 MASTER_SITES=   http://www.wireshark.org/download/src/ \
7                 http://ftp.uni-kl.de/pub/wireshark/src/ \
8                 http://wireshark.askapache.com/download/src/all-versions/ \
9                 ftp://ftp.uni-kl.de/pub/wireshark/src/ \
10                 http://prdownloads.sourceforge.net/wireshark/ \
11                 http://ftp.yz.yamagata-u.ac.jp/pub/network/security/wireshark/src/ \
12                 ftp://ftp.yz.yamagata-u.ac.jp/pub/network/security/wireshark/src/ \
13                 http://wireshark.zing.org/download/src/
14 DISTNAME=       ${DATADIR_NAME}-${PORTVERSION}
15
16 MAINTAINER=     marcus@FreeBSD.org
17 COMMENT?=       Powerful network analyzer/capture tool
18
19 LICENSE=        GPLv2
20 LICENSE_FILE=   ${WRKSRC}/COPYING
21
22 CONFLICTS_INSTALL?=     wireshark-lite-[0-9]* tshark-[0-9]* tshark-lite-[0-9]*
23
24 DATADIR_NAME=   wireshark
25 DATADIR=        ${PREFIX}/share/${DATADIR_NAME}
26
27 USES=           alias cmake compiler:c++11-lang cpe gettext-runtime gnome \
28                 libtool localbase pathfix perl5 pkgconfig python:3.4+ ssl \
29                 tar:xz
30 USE_PERL5=      build
31 USE_GNOME=      glib20 libxml2
32 USE_LDCONFIG=   yes
33
34 LIB_DEPENDS+=   libgpg-error.so:security/libgpg-error \
35                 libgcrypt.so:security/libgcrypt \
36                 liblz4.so:archivers/liblz4 \
37                 libnghttp2.so:www/libnghttp2 \
38                 libsnappy.so:archivers/snappy \
39                 libcares.so:dns/c-ares
40
41 #CFLAGS+=       -funit-at-a-time
42 PLIST_SUB+=     PORTVERSION=${PORTVERSION}
43
44 .for x in capinfos editcap mergecap rawshark text2pcap dftest randpkt \
45     reordercap captype randpktdump udpdump sharkd
46 .if defined(LITE)
47 PKGNAMESUFFIX=          -lite
48 PLIST_SUB+=             ${x:tu}="@comment $x not installed" \
49                         ${x:tu}_LIB="@comment $x not installed " \
50                         ${x:tu}_MAN="@comment $x not installed "
51 CMAKE_ARGS+=            -DBUILD_$x=OFF
52 EXTRA_PATCHES=          ${FILESDIR}/extra-patch-doc_CMakeLists.txt
53 OPTIONS_EXCLUDE+=       RTP SNMP LUA ANDROIDDUMP CISCODUMP SSHDUMP
54 .else
55 PLIST_SUB+=             ${x:tu}=bin/$x \
56                         ${x:tu}_MAN="" \
57                         ${x:tu}_LIB=""
58 .endif
59 .endfor
60
61 OPTIONS_DEFINE=         GUI RTP SNMP MAXMIND LTO LUA DECRYPT ANDROIDDUMP SSHDUMP CISCODUMP OPUS
62
63 OPTIONS_SINGLE=         GSSAPI
64
65 OPTIONS_SINGLE_GSSAPI=GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT GSSAPI_NONE
66
67 OPTIONS_DEFAULT?=       GUI SNMP MAXMIND GSSAPI_BASE DECRYPT
68
69 GUI_DESC=               Enable Qt 5 based Wireshark GUI
70 RTP_DESC=               Enable support for playing back RTP streams
71 DECRYPT_DESC=           Decryption support for SSL and IPSec
72 ANDROIDDUMP_DESC=       Build androiddump extcap tool
73 MAXMIND_DESC=           Enable MaxMindDB-based GeoIP geolocation support
74 GSSAPI_DESC=            Kerberos dissection support
75 GSSAPI_BASE_DESC=               Kerberos support via base system
76 GSSAPI_HEIMDAL_DESC=    Kerberos support via security/heimdal
77 GSSAPI_MIT_DESC=                Kerberos support via security/krb5
78 GSSAPI_NONE_DESC=               Disable Kerberos support
79 SSHDUMP_DESC=           Build sshdump extcap tool
80 CISCODUMP_DESC=         Build ciscodump extcap tool
81 OPUS_DESC=              Build opus decoder plugin
82
83 GUI_USES=               qt:5
84 GUI_USE=        qt=core,gui,multimedia,widgets,printsupport,svg,buildtools_build,linguisttools_build,qmake_build
85
86 LTO_CMAKE_BOOL=         ENABLE_LTO
87 LUA_USES=               lua:51-52
88 GSSAPI_BASE_USES=               gssapi
89 GSSAPI_HEIMDAL_USES=    gssapi:heimdal
90 GSSAPI_MIT_USES=                gssapi:mit
91
92 RTP_LIB_DEPENDS=        libspandsp.so:comms/spandsp
93 RTP_CPPFLAGS=           -I${LOCALBASE}/include
94 MAXMIND_LIB_DEPENDS=    libmaxminddb.so:net/libmaxminddb
95 SNMP_LIB_DEPENDS=       libsmi.so:net-mgmt/libsmi
96 DECRYPT_LIB_DEPENDS=    libgnutls.so:security/gnutls \
97                         libgcrypt.so:security/libgcrypt
98 SSHDUMP_LIB_DEPENDS=    libssh.so:security/libssh
99 CISCODUMP_LIB_DEPENDS=  libssh.so:security/libssh
100 OPUS_LIB_DEPENDS=       libopus.so:audio/opus
101 OPUS_CPPFLAGS=          -I${LOCALBASE}/include
102
103 GSSAPI_NONE_CMAKE_ON=   -DENABLE_KERBEROS=OFF
104 GSSAPI_NONE_CMAKE_OFF=  -DENABLE_KERBEROS=ON
105 GSSAPI_NONE_CONFIGURE_ENV_OFF=  KRB5_CONFIG=${KRB5CONFIG}
106
107 LUA_CMAKE_ON=   -DENABLE_LUA=ON
108 LUA_CMAKE_OFF=  -DENABLE_LUA=OFF
109 RTP_CMAKE_ON=   -DENABLE_SPANDSP=ON
110 RTP_CMAKE_OFF=  -DENABLE_SPANDSP=OFF
111 SNMP_CMAKE_ON=  -DENABLE_SMI=ON
112 SNMP_CMAKE_OFF= -DENABLE_SMI=OFF
113 DECRYPT_CMAKE_ON=       -DENABLE_GNUTLS=ON
114 DECRYPT_CMAKE_OFF=      -DENABLE_GNUTLS=OFF
115 ANDROIDDUMP_CMAKE_ON=-DBUILD_androiddump=ON
116 ANDROIDDUMP_CMAKE_OFF=-DBUILD_androiddump=OFF
117 SSHDUMP_CMAKE_ON=-DBUILD_sshdump=ON
118 SSHDUMP_CMAKE_OFF=-DBUILD_sshdump=OFF
119 CISCODUMP_CMAKE_ON=-DBUILD_ciscodump=ON
120 CISCODUMP_CMAKE_OFF=-DBUILD_ciscodump=OFF
121 OPUS_CMAKE_ON=  -DENABLE_OPUS=ON
122 OPUS_CMAKE_OFF= -DENABLE_OPUS=OFF
123
124 LUA_CPPFLAGS=           -I${LUA_INCDIR}
125
126 GUI_CONFIGURE_ENV=      PATH="${PATH}:${QT_BINDIR}"
127 GUI_MAKE_ENV=           PATH="${PATH}:${QT_BINDIR}"
128
129 OPTIONS_SUB=            yes
130
131 .if defined(LITE)
132 CMAKE_ARGS+=    -DBUILD_androiddump=OFF \
133                 -DBUILD_sshdump=OFF \
134                 -DBUILD_ciscodump=OFF \
135                 -DENABLE_OPUS=OFF
136 PLIST_SUB+=     ANDROIDDUMP_LIB="@comment " \
137                 ANDROIDDUMP_MAN="@comment " \
138                 SSHDUMP_LIB="@comment " \
139                 SSHDUMP_MAN="@comment " \
140                 CISCODUMP_LIB="@comment " \
141                 CISCODUMP_MAN="@comment " \
142                 OPUS="@comment "
143 .endif
144
145 .include <bsd.port.options.mk>
146
147 .if empty(PORT_OPTIONS:MMAXMIND)
148 CMAKE_ARGS+=    -DBUILD_mmdbresolve=OFF
149 .else
150 CMAKE_ARGS+=    -DBUILD_mmdbresolve=ON
151 .endif
152
153 .if empty(PORT_OPTIONS:MGUI)
154 CMAKE_ARGS+=    -DBUILD_wireshark=OFF
155 PLIST_SUB+=     GUI="@comment "
156 .else
157 USES+=          desktop-file-utils shared-mime-info
158 INSTALLS_ICONS= yes
159 PLIST_SUB+=     GUI=""
160 .endif
161
162 .if !defined(LITE)
163 .if ${PORT_OPTIONS:MANDROIDDUMP}
164 PLIST_SUB+=     ANDROIDDUMP_LIB="" \
165                 ANDROIDDUMP_MAN=""
166 .else
167 PLIST_SUB+=     ANDROIDDUMP_LIB="@comment " \
168                 ANDROIDDUMP_MAN="@comment "
169 .endif
170 .if ${PORT_OPTIONS:MSSHDUMP}
171 PLIST_SUB+=     SSHDUMP_LIB="" \
172                 SSHDUMP_MAN=""
173 .else
174 PLIST_SUB+=     SSHDUMP_LIB="@comment " \
175                 SSHDUMP_MAN="@comment "
176 .endif
177 .if ${PORT_OPTIONS:MCISCODUMP}
178 PLIST_SUB+=     CISCODUMP_LIB="" \
179                 CISCODUMP_MAN=""
180 .else
181 PLIST_SUB+=     CISCODUMP_LIB="@comment " \
182                 CISCODUMP_MAN="@comment "
183 .endif
184 .if ${PORT_OPTIONS:MOPUS}
185 PLIST_SUB+=     OPUS=""
186 .else
187 PLIST_SUB+=     OPUS="@comment "
188 .endif
189 .endif
190
191 .if ${PORT_OPTIONS:MGSSAPI_BASE} && exists(${LOCALBASE}/include/krb5.h)
192 IGNORE=                 cannot build with base Kerberos if krb5 port is installed. \
193                         Use ``make config'' to choose a different option
194 .endif
195
196 post-patch:
197         @${REINPLACE_CMD} -e 's|/usr/share/applications|${DESKTOPDIR}|g ; \
198                 s|/usr/share|${LOCALBASE}/share|g' \
199                 ${WRKSRC}/CMakeLists.txt
200         @${REINPLACE_CMD} -e 's|lua$${LUA_INC_SUFFIX}|lua-${LUA_VER}|g' \
201                 ${WRKSRC}/cmake/modules/FindLUA.cmake
202
203 .include <bsd.port.mk>