1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit autotools eutils fcaps flag-o-matic multilib qmake-utils user
7 DESCRIPTION="A network protocol analyzer formerly known as ethereal"
8 HOMEPAGE="https://www.wireshark.org/"
9 SRC_URI="${HOMEPAGE}download/src/all-versions/${P/_/}.tar.bz2"
13 KEYWORDS="alpha amd64 arm ~hppa ~ia64 ppc ppc64 ~sparc x86 ~x86-fbsd"
15 adns androiddump +caps ciscodump cpu_flags_x86_sse4_2 crypt doc doc-pdf
16 geoip +gtk kerberos lua +netlink +pcap portaudio +qt5 sbc selinux smi
17 libssh randpkt randpktdump sshdump ssl tfshark zlib
28 >=dev-libs/glib-2.14:2
29 netlink? ( dev-libs/libnl:3 )
30 adns? ( >=net-dns/c-ares-1.5 )
31 crypt? ( dev-libs/libgcrypt:0 )
32 caps? ( sys-libs/libcap )
33 geoip? ( dev-libs/geoip )
40 kerberos? ( virtual/krb5 )
41 libssh? ( >=net-libs/libssh-0.6 )
42 lua? ( >=dev-lang/lua-5.1:* )
43 pcap? ( net-libs/libpcap )
44 portaudio? ( media-libs/portaudio )
49 dev-qt/qtprintsupport:5
54 sbc? ( media-libs/sbc )
55 smi? ( net-libs/libsmi )
56 ssl? ( net-libs/gnutls:= )
57 zlib? ( sys-libs/zlib !=sys-libs/zlib-1.2.4 )
59 # We need perl for `pod2html`. The rest of the perl stuff is to block older
60 # and broken installs. #455122
64 !<virtual/perl-Pod-Simple-3.170
65 !<perl-core/Pod-Simple-3.170
71 doc-pdf? ( dev-java/fop )
75 dev-qt/linguist-tools:5
83 gtk? ( virtual/freedesktop-icon-theme )
84 qt5? ( virtual/freedesktop-icon-theme )
85 selinux? ( sec-policy/selinux-wireshark )
88 "${FILESDIR}"/${PN}-1.99.8-qtchooser.patch
89 "${FILESDIR}"/${PN}-2.1.0-sse4_2-r1.patch
90 "${FILESDIR}"/${PN}-99999999-androiddump.patch
106 # Workaround bug #213705. If krb5-config --libs has -lcrypto then pass
107 # --with-ssl to ./configure. (Mimics code from acinclude.m4).
108 if use kerberos; then
109 case $(krb5-config --libs) in
111 ewarn "Kerberos was built with ssl support: linkage with openssl is enabled."
112 ewarn "Note there are annoying license incompatibilities between the OpenSSL"
113 ewarn "license and the GPL, so do your check before distributing such package."
114 myconf+=( "--with-ssl" )
119 # Enable wireshark binary with any supported GUI toolkit (bug #473188)
120 if use gtk || use qt5; then
121 myconf+=( "--enable-wireshark" )
123 myconf+=( "--disable-wireshark" )
127 myconf+=( "--with-qt=no" )
131 export QT_MIN_VERSION=5.3.0
132 append-cxxflags -fPIC -DPIC
135 # Hack around inability to disable doxygen/fop doc generation
136 use doc || export ac_cv_prog_HAVE_DOXYGEN=false
137 use doc-pdf || export ac_cv_prog_HAVE_FOP=false
139 # dumpcap requires libcap
140 # --disable-profile-build bugs #215806, #292991, #479602
142 $(use androiddump && use pcap && echo --enable-androiddump-use-libpcap=yes) \
143 $(use_enable androiddump) \
144 $(use_enable ciscodump) \
145 $(use_enable randpkt) \
146 $(use_enable randpktdump) \
147 $(use_enable sshdump) \
148 $(use_enable tfshark) \
149 $(use_with adns c-ares) \
150 $(use_with caps libcap) \
151 $(use_with crypt gcrypt) \
153 $(use_with gtk gtk 3) \
154 $(use_with kerberos krb5) \
155 $(use_with libssh ssh) \
157 $(use_with pcap dumpcap-group wireshark) \
159 $(use_with portaudio) \
161 $(use_with smi libsmi) \
162 $(use_with ssl gnutls) \
164 $(usex cpu_flags_x86_sse4_2 --enable-sse4_2 '') \
165 $(usex netlink --with-libnl=3 --without-libnl) \
166 $(usex qt5 --with-qt=5 '') \
167 $(usex qt5 LRELEASE=$(qt5_get_bindir)/lrelease '') \
168 $(usex qt5 MOC=$(qt5_get_bindir)/moc '') \
169 $(usex qt5 RCC=$(qt5_get_bindir)/rcc '') \
170 $(usex qt5 UIC=$(qt5_get_bindir)/uic '') \
171 --disable-profile-build \
172 --disable-warnings-as-errors \
173 --sysconfdir="${EPREFIX}"/etc/wireshark \
183 addpredict "/root/.java"
184 emake -C docbook all-pdf
192 # FAQ is not required as is installed from help/faq.txt
193 dodoc AUTHORS ChangeLog NEWS README{,.bsd,.linux,.macos,.vmware} \
194 doc/{randpkt.txt,README*}
197 docinto /usr/share/doc/${PF}/html
198 dodoc -r docbook/{release-notes.html,ws{d,u}g_html{,_chunked}}
200 docinto /usr/share/doc/${PF}/pdf/
201 dodoc docbook/{developer,user}-guide-{a4,us}.pdf docbook/release-notes.pdf
212 epan/dissectors/*.h \
221 insinto /usr/include/wireshark/$( dirname ${wsheader} )
225 #with the above this really shouldn't be needed, but things may be looking in wiretap/ instead of wireshark/wiretap/
226 insinto /usr/include/wiretap
229 if use gtk || use qt5; then
232 for d in 16 32 48; do
233 insinto /usr/share/icons/${c}color/${d}x${d}/apps
234 newins image/${c}${d}-app-wireshark.png wireshark.png
237 for d in 16 24 32 48 64 128 256 ; do
238 insinto /usr/share/icons/hicolor/${d}x${d}/mimetypes
239 newins image/WiresharkDoc-${d}.png application-vnd.tcpdump.pcap.png
247 # Add group for users allowed to sniff.
251 fcaps -o 0 -g wireshark -m 4710 -M 0710 \
252 cap_dac_read_search,cap_net_raw,cap_net_admin \
253 "${EROOT}"/usr/bin/dumpcap
256 ewarn "NOTE: To capture traffic with wireshark as normal user you have to"
257 ewarn "add yourself to the wireshark group. This security measure ensures"
258 ewarn "that only trusted users are allowed to sniff your traffic."