Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/wireshark/, net-analyzer/wireshark/files/
Date: Thu, 24 Dec 2015 12:50:45
Message-Id: 1450961427.b83fca33acfbe7f82760feeead0f6f5937984f20.jer@gentoo
1 commit: b83fca33acfbe7f82760feeead0f6f5937984f20
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 24 11:22:39 2015 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 24 12:50:27 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b83fca33
7
8 net-analyzer/wireshark: Add USE=androiddump. Add USE=tfshark.
9
10 Package-Manager: portage-2.2.26
11
12 .../files/wireshark-2.0.0-androiddump-pcap.patch | 10 +
13 net-analyzer/wireshark/metadata.xml | 2 +
14 net-analyzer/wireshark/wireshark-2.0.0-r1.ebuild | 278 +++++++++++++++++++++
15 3 files changed, 290 insertions(+)
16
17 diff --git a/net-analyzer/wireshark/files/wireshark-2.0.0-androiddump-pcap.patch b/net-analyzer/wireshark/files/wireshark-2.0.0-androiddump-pcap.patch
18 new file mode 100644
19 index 0000000..639e299
20 --- /dev/null
21 +++ b/net-analyzer/wireshark/files/wireshark-2.0.0-androiddump-pcap.patch
22 @@ -0,0 +1,10 @@
23 +--- a/Makefile.am
24 ++++ b/Makefile.am
25 +@@ -549,6 +549,7 @@
26 + wiretap/libwiretap.la \
27 + wsutil/libwsutil.la \
28 + @GLIB_LIBS@ \
29 ++ @PCAP_LIBS@ \
30 + @SOCKET_LIBS@
31 +
32 + androiddump_CFLAGS = $(AM_CLEAN_CFLAGS)
33
34 diff --git a/net-analyzer/wireshark/metadata.xml b/net-analyzer/wireshark/metadata.xml
35 index 2707e56..9b808bb 100644
36 --- a/net-analyzer/wireshark/metadata.xml
37 +++ b/net-analyzer/wireshark/metadata.xml
38 @@ -26,6 +26,7 @@
39 </longdescription>
40 <use>
41 <flag name='adns'>Use the GNU <pkg>net-dns/c-ares</pkg> library to resolve DNS names</flag>
42 +<flag name='androiddump'>Install androiddump</flag>
43 <flag name='crypt'>Use <pkg>dev-libs/libgcrypt</pkg> to decrypt traffic</flag>
44 <flag name='doc-pdf'>Build documentation in pdf format (US and a4 paper sizes)</flag>
45 <flag name='gtk3'>Build the wireshark executable with a GTK+ UI version 3.</flag>
46 @@ -34,5 +35,6 @@
47 <flag name='qt4'>Build the wireshark executable with an experimental Qt UI instead of GTK+.</flag>
48 <flag name='sbc'>Use <pkg>media-libs/sbc</pkg> for playing back SBC encoded packets</flag>
49 <flag name='smi'>Use <pkg>net-libs/libsmi</pkg> to resolve numeric OIDs into human readable format</flag>
50 +<flag name='tfshark'>Install tfshark</flag>
51 </use>
52 </pkgmetadata>
53
54 diff --git a/net-analyzer/wireshark/wireshark-2.0.0-r1.ebuild b/net-analyzer/wireshark/wireshark-2.0.0-r1.ebuild
55 new file mode 100644
56 index 0000000..bf934d2
57 --- /dev/null
58 +++ b/net-analyzer/wireshark/wireshark-2.0.0-r1.ebuild
59 @@ -0,0 +1,278 @@
60 +# Copyright 1999-2015 Gentoo Foundation
61 +# Distributed under the terms of the GNU General Public License v2
62 +# $Id$
63 +
64 +EAPI=5
65 +inherit autotools eutils fcaps flag-o-matic multilib qmake-utils qt4-r2 user
66 +
67 +DESCRIPTION="A network protocol analyzer formerly known as ethereal"
68 +HOMEPAGE="http://www.wireshark.org/"
69 +SRC_URI="${HOMEPAGE}download/src/all-versions/${P/_/}.tar.bz2"
70 +
71 +LICENSE="GPL-2"
72 +SLOT="0/${PV}"
73 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
74 +IUSE="
75 + adns androiddump +caps crypt doc doc-pdf geoip +gtk3 ipv6 kerberos lua
76 + +netlink +pcap portaudio +qt4 qt5 selinux sbc smi tfshark
77 + cpu_flags_x86_sse4_2 ssl zlib
78 +"
79 +REQUIRED_USE="
80 + ssl? ( crypt )
81 + ?? ( qt4 qt5 )
82 +"
83 +
84 +S=${WORKDIR}/${P/_/}
85 +
86 +GTK_COMMON_DEPEND="
87 + x11-libs/gdk-pixbuf
88 + x11-libs/pango
89 + x11-misc/xdg-utils
90 +"
91 +CDEPEND="
92 + >=dev-libs/glib-2.14:2
93 + netlink? ( dev-libs/libnl:3 )
94 + adns? ( >=net-dns/c-ares-1.5 )
95 + crypt? ( dev-libs/libgcrypt:0 )
96 + caps? ( sys-libs/libcap )
97 + geoip? ( dev-libs/geoip )
98 + gtk3? (
99 + ${GTK_COMMON_DEPEND}
100 + x11-libs/gtk+:3
101 + )
102 + kerberos? ( virtual/krb5 )
103 + lua? ( >=dev-lang/lua-5.1:* )
104 + pcap? ( net-libs/libpcap )
105 + portaudio? ( media-libs/portaudio )
106 + qt4? (
107 + dev-qt/qtcore:4
108 + dev-qt/qtgui:4[accessibility]
109 + x11-misc/xdg-utils
110 + )
111 + qt5? (
112 + dev-qt/qtcore:5
113 + dev-qt/qtgui:5
114 + dev-qt/qtprintsupport:5
115 + dev-qt/qtwidgets:5
116 + x11-misc/xdg-utils
117 + )
118 + sbc? ( media-libs/sbc )
119 + smi? ( net-libs/libsmi )
120 + ssl? ( net-libs/gnutls )
121 + zlib? ( sys-libs/zlib !=sys-libs/zlib-1.2.4 )
122 +"
123 +# We need perl for `pod2html`. The rest of the perl stuff is to block older
124 +# and broken installs. #455122
125 +DEPEND="
126 + ${CDEPEND}
127 + dev-lang/perl
128 + !<virtual/perl-Pod-Simple-3.170
129 + !<perl-core/Pod-Simple-3.170
130 + doc? (
131 + app-doc/doxygen
132 + app-text/asciidoc
133 + dev-libs/libxml2
134 + dev-libs/libxslt
135 + doc-pdf? ( dev-java/fop )
136 + www-client/lynx
137 + )
138 + sys-devel/bison
139 + sys-devel/flex
140 + virtual/pkgconfig
141 +"
142 +RDEPEND="
143 + ${CDEPEND}
144 + gtk3? ( virtual/freedesktop-icon-theme )
145 + qt4? ( virtual/freedesktop-icon-theme )
146 + qt5? ( virtual/freedesktop-icon-theme )
147 + selinux? ( sec-policy/selinux-wireshark )
148 +"
149 +
150 +pkg_setup() {
151 + enewgroup wireshark
152 +}
153 +
154 +src_prepare() {
155 + epatch \
156 + "${FILESDIR}"/${PN}-1.6.13-ldflags.patch \
157 + "${FILESDIR}"/${PN}-1.11.0-oldlibs.patch \
158 + "${FILESDIR}"/${PN}-1.99.0.1975-sse4_2.patch \
159 + "${FILESDIR}"/${PN}-99999999-pkgconfig.patch \
160 + "${FILESDIR}"/${PN}-1.99.8-qtchooser.patch \
161 + "${FILESDIR}"/${PN}-2.0.0-androiddump-pcap.patch
162 +
163 + epatch_user
164 +
165 + eautoreconf
166 +}
167 +
168 +src_configure() {
169 + local myconf
170 +
171 + # Workaround bug #213705. If krb5-config --libs has -lcrypto then pass
172 + # --with-ssl to ./configure. (Mimics code from acinclude.m4).
173 + if use kerberos; then
174 + case $(krb5-config --libs) in
175 + *-lcrypto*)
176 + ewarn "Kerberos was built with ssl support: linkage with openssl is enabled."
177 + ewarn "Note there are annoying license incompatibilities between the OpenSSL"
178 + ewarn "license and the GPL, so do your check before distributing such package."
179 + myconf+=( "--with-ssl" )
180 + ;;
181 + esac
182 + fi
183 +
184 + # Enable wireshark binary with any supported GUI toolkit (bug #473188)
185 + if use gtk3 || use qt4 || use qt5; then
186 + myconf+=( "--enable-wireshark" )
187 + else
188 + myconf+=( "--disable-wireshark" )
189 + fi
190 +
191 + if ! use qt4 && ! use qt5; then
192 + myconf+=( "--with-qt=no" )
193 + fi
194 +
195 + if use qt4; then
196 + export QT_MIN_VERSION=4.6.0
197 + fi
198 +
199 + if use qt5; then
200 + export QT_MIN_VERSION=5.3.0
201 + append-cxxflags -fPIC -DPIC
202 + fi
203 +
204 + # Hack around inability to disable doxygen/fop doc generation
205 + use doc || export ac_cv_prog_HAVE_DOXYGEN=false
206 + use doc-pdf || export ac_cv_prog_HAVE_FOP=false
207 +
208 + # dumpcap requires libcap
209 + # --disable-profile-build bugs #215806, #292991, #479602
210 + econf \
211 + $(use androiddump && use pcap && echo --enable-androiddump-use-libpcap=yes) \
212 + $(use_enable androiddump) \
213 + $(use_enable ipv6) \
214 + $(use_enable tfshark) \
215 + $(use_with adns c-ares) \
216 + $(use_with caps libcap) \
217 + $(use_with crypt gcrypt) \
218 + $(use_with geoip) \
219 + $(use_with gtk3) \
220 + $(use_with kerberos krb5) \
221 + $(use_with lua) \
222 + $(use_with pcap dumpcap-group wireshark) \
223 + $(use_with pcap) \
224 + $(use_with portaudio) \
225 + $(usex qt4 --with-qt=4 '') \
226 + $(usex qt5 --with-qt=5 '') \
227 + $(usex qt4 MOC=$(qt4_get_bindir)/moc '') \
228 + $(usex qt4 RCC=$(qt4_get_bindir)/rcc '') \
229 + $(usex qt4 UIC=$(qt4_get_bindir)/uic '') \
230 + $(usex qt5 MOC=$(qt5_get_bindir)/moc '') \
231 + $(usex qt5 RCC=$(qt5_get_bindir)/rcc '') \
232 + $(usex qt5 UIC=$(qt5_get_bindir)/uic '') \
233 + $(use_with sbc) \
234 + $(use_with smi libsmi) \
235 + $(use_with ssl gnutls) \
236 + $(use_with zlib) \
237 + $(usex netlink --with-libnl=3 --without-libnl) \
238 + $(usex cpu_flags_x86_sse4_2 --enable-sse4_2 '') \
239 + --disable-profile-build \
240 + --disable-usr-local \
241 + --disable-warnings-as-errors \
242 + --sysconfdir="${EPREFIX}"/etc/wireshark \
243 + --without-adns \
244 + ${myconf[@]}
245 +}
246 +
247 +src_compile() {
248 + default
249 + if use doc; then
250 + use doc-pdf && addpredict "/root/.java"
251 + emake -j1 -C docbook
252 + fi
253 +}
254 +
255 +src_install() {
256 + default
257 +
258 + if use doc; then
259 + dohtml -r docbook/{release-notes.html,ws{d,u}g_html{,_chunked}}
260 + if use doc-pdf; then
261 + insinto /usr/share/doc/${PF}/pdf/
262 + doins docbook/{developer,user}-guide-{a4,us}.pdf docbook/release-notes.pdf
263 + fi
264 + fi
265 +
266 + # FAQ is not required as is installed from help/faq.txt
267 + dodoc AUTHORS ChangeLog NEWS README{,.bsd,.linux,.macos,.vmware} \
268 + doc/{randpkt.txt,README*}
269 +
270 + # install headers
271 + local wsheader
272 + for wsheader in \
273 + color.h \
274 + config.h \
275 + epan/*.h \
276 + epan/crypt/*.h \
277 + epan/dfilter/*.h \
278 + epan/dissectors/*.h \
279 + epan/ftypes/*.h \
280 + epan/wmem/*.h \
281 + register.h \
282 + wiretap/*.h \
283 + ws_symbol_export.h \
284 + wsutil/*.h
285 + do
286 + insinto /usr/include/wireshark/$( dirname ${wsheader} )
287 + doins ${wsheader}
288 + done
289 +
290 + #with the above this really shouldn't be needed, but things may be looking in wiretap/ instead of wireshark/wiretap/
291 + insinto /usr/include/wiretap
292 + doins wiretap/wtap.h
293 +
294 + if use gtk3 || use qt4 || use qt5; then
295 + local c d
296 + for c in hi lo; do
297 + for d in 16 32 48; do
298 + insinto /usr/share/icons/${c}color/${d}x${d}/apps
299 + newins image/${c}${d}-app-wireshark.png wireshark.png
300 + done
301 + done
302 + for d in 16 24 32 48 64 128 256 ; do
303 + insinto /usr/share/icons/hicolor/${d}x${d}/mimetypes
304 + newins image/WiresharkDoc-${d}.png application-vnd.tcpdump.pcap.png
305 + done
306 + fi
307 +
308 + if use gtk3; then
309 + domenu wireshark.desktop
310 + fi
311 +
312 + if use qt4 || use qt5; then
313 + sed \
314 + -e '/Exec=/s|wireshark|&-qt|g' \
315 + -e 's|^Name.*=Wireshark|& (Qt)|g' \
316 + wireshark.desktop > wireshark-qt.desktop \
317 + || die
318 + domenu wireshark-qt.desktop
319 + fi
320 +
321 + prune_libtool_files
322 +}
323 +
324 +pkg_postinst() {
325 + # Add group for users allowed to sniff.
326 + enewgroup wireshark
327 +
328 + if use pcap; then
329 + fcaps -o 0 -g wireshark -m 4710 -M 0710 \
330 + cap_dac_read_search,cap_net_raw,cap_net_admin \
331 + "${EROOT}"/usr/bin/dumpcap
332 + fi
333 +
334 + ewarn "NOTE: To capture traffic with wireshark as normal user you have to"
335 + ewarn "add yourself to the wireshark group. This security measure ensures"
336 + ewarn "that only trusted users are allowed to sniff your traffic."
337 +}