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/files/, net-analyzer/wireshark/
Date: Fri, 30 Jun 2017 08:45:30
Message-Id: 1498812323.a96ce7ec5c6115823fb6b2ad7944a920ebf16a52.jer@gentoo
1 commit: a96ce7ec5c6115823fb6b2ad7944a920ebf16a52
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 30 08:44:25 2017 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 30 08:45:23 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a96ce7ec
7
8 net-analyzer/wireshark: Version bump.
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 net-analyzer/wireshark/Manifest | 1 +
13 .../files/wireshark-2.4-androiddump.patch | 27 +++
14 net-analyzer/wireshark/wireshark-2.4.0_rc2.ebuild | 267 +++++++++++++++++++++
15 3 files changed, 295 insertions(+)
16
17 diff --git a/net-analyzer/wireshark/Manifest b/net-analyzer/wireshark/Manifest
18 index 10ee44a2506..f71bdada53c 100644
19 --- a/net-analyzer/wireshark/Manifest
20 +++ b/net-analyzer/wireshark/Manifest
21 @@ -1,3 +1,4 @@
22 DIST wireshark-2.2.5.tar.bz2 32297102 SHA256 75dd88d3d6336559e5b0b72077d8a772a988197d571f00029986225fef609ac8 SHA512 c419950683eb399f851e10cc268d541cbd6e75a957f412650fa9564760908864fcd0d5d6c3520e656d93c31cd5f1216a514be154dfa950fcfd2804e66155985e WHIRLPOOL 2c65d7806673adb550dcdd8fa032a4dce8e1087e5c57b132c9ac53d6d93d6fb0da3219573bc2ecb12df7865a9a32a1a28378e03b3e3439853200186d42f18e7d
23 DIST wireshark-2.2.7.tar.bz2 32309420 SHA256 689ddf62221b152779d8846ab5b2063cc7fd41ec1a9f04eefab09b5d5486dbb5 SHA512 417836810eb895b3f2a6ac1cfd138fb0275382ea2edc60fc5f5e5f8ce433b56b8120aa8b58b4f77296986630fdf49e4c5c3859b2c2c5e26b1ce0651393b7d716 WHIRLPOOL 0361821da9c113a8de1339cc48cae0291be84bcffb1ba34b1fc3f457b22525329e954a2060f7eef25bca550d0ccdaf4a9e9587d35394b0abd9b0d38bc6023e44
24 DIST wireshark-2.4.0rc1.tar.xz 29097628 SHA256 902aa0f7dc9e14af98dbfa1669fe6ee049caeb763571ace426949d52df1dbfde SHA512 0222e7bd6237a0d1d0c2b21c66aed3995787f5cbc623db40df11ab5e6640fdfebcdd78e1960ee2ebc14cb26b700beefa4e1164504f5aa5424cbd6d62202bc888 WHIRLPOOL 988d4643c3f413541106d686aefb4622c780b026d5b97d7dc2872540ff4ce7947ba988e4b03b92d3d26c2dc1bbf681122930be4af01888ee8534d70dbe9842c6
25 +DIST wireshark-2.4.0rc2.tar.xz 28744512 SHA256 cb2a1dd25f0eb05c1f2a95012d08b704789b4bf016dfd4b86daa34e2afb7c99e SHA512 2df36aa6465256d63d95e69137a9e8bb828940c629dacec5afc4f9ceab158bd023d006bf5c44a50e7f6d1d94d704a7c5f7ecf4bf5d34ddfcb9af9ca1abd7887d WHIRLPOOL c5061779ee6146e5e4ea68e88713bd8bd92bd7a70a8ddf4d63d616db151a162e0e9fe529b6a2563690925a1c8ce4878a109310808304232086b42a1e9b86d502
26
27 diff --git a/net-analyzer/wireshark/files/wireshark-2.4-androiddump.patch b/net-analyzer/wireshark/files/wireshark-2.4-androiddump.patch
28 new file mode 100644
29 index 00000000000..e67ab21b6a8
30 --- /dev/null
31 +++ b/net-analyzer/wireshark/files/wireshark-2.4-androiddump.patch
32 @@ -0,0 +1,27 @@
33 +--- a/extcap/androiddump.c
34 ++++ b/extcap/androiddump.c
35 +@@ -363,13 +363,13 @@
36 + pcap = pcap_open_dead_with_tstamp_precision(encap_ext, PACKET_LENGTH, PCAP_TSTAMP_PRECISION_NANO);
37 + extcap_dumper.dumper.pcap = pcap_dump_open(pcap, fifo);
38 + if (!extcap_dumper.dumper.pcap) {
39 +- g_warning("Can't open %s for saving packets: %s", pcap_geterr(pcap));
40 ++ g_warning("Can't open %s for saving packets: %s", fifo, pcap_geterr(pcap));
41 + pcap_close(pcap);
42 + exit(EXIT_CODE_CANNOT_SAVE_LIBPCAP_DUMP);
43 + }
44 + extcap_dumper.encap = encap;
45 + if (pcap_dump_flush(extcap_dumper.dumper.pcap) == -1) {
46 +- g_warning("Write to %s failed: %s", g_strerror(errno));
47 ++ g_warning("Write to %s failed: %s", fifo, g_strerror(errno));
48 + }
49 + #else
50 + int err = 0;
51 +@@ -416,7 +416,7 @@
52 +
53 + pcap_dump((u_char *) extcap_dumper.dumper.pcap, &pcap_header, buffer);
54 + if (pcap_dump_flush(extcap_dumper.dumper.pcap) == -1) {
55 +- g_warning("Write to %s failed: %s", g_strerror(errno));
56 ++ g_warning("Write to %s failed: %s", fifo, g_strerror(errno));
57 + }
58 + #else
59 + int err = 0;
60
61 diff --git a/net-analyzer/wireshark/wireshark-2.4.0_rc2.ebuild b/net-analyzer/wireshark/wireshark-2.4.0_rc2.ebuild
62 new file mode 100644
63 index 00000000000..69dc87248c6
64 --- /dev/null
65 +++ b/net-analyzer/wireshark/wireshark-2.4.0_rc2.ebuild
66 @@ -0,0 +1,267 @@
67 +# Copyright 1999-2017 Gentoo Foundation
68 +# Distributed under the terms of the GNU General Public License v2
69 +
70 +EAPI=6
71 +inherit autotools eutils fcaps flag-o-matic multilib qmake-utils user
72 +
73 +DESCRIPTION="A network protocol analyzer formerly known as ethereal"
74 +HOMEPAGE="https://www.wireshark.org/"
75 +SRC_URI="${HOMEPAGE}download/src/all-versions/${P/_/}.tar.xz"
76 +
77 +LICENSE="GPL-2"
78 +SLOT="0/${PV}"
79 +KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~x86-fbsd"
80 +IUSE="
81 + adns androiddump +caps ciscodump cpu_flags_x86_sse4_2 doc doc-pdf
82 + geoip gtk kerberos lua +netlink nghttp2 +pcap portaudio +qt5 sbc selinux
83 + smi libssh libxml2 randpkt randpktdump snappy spandsp sshdump ssl tfshark
84 + zlib
85 +"
86 +REQUIRED_USE="
87 + ciscodump? ( libssh )
88 + sshdump? ( libssh )
89 +"
90 +
91 +S=${WORKDIR}/${P/_/}
92 +
93 +CDEPEND="
94 + >=dev-libs/glib-2.14:2
95 + dev-libs/libgcrypt:0
96 + netlink? ( dev-libs/libnl:3 )
97 + adns? ( >=net-dns/c-ares-1.5 )
98 + caps? ( sys-libs/libcap )
99 + geoip? ( dev-libs/geoip )
100 + gtk? (
101 + x11-libs/gdk-pixbuf
102 + x11-libs/gtk+:3
103 + x11-libs/pango
104 + x11-misc/xdg-utils
105 + )
106 + kerberos? ( virtual/krb5 )
107 + libssh? ( >=net-libs/libssh-0.6 )
108 + libxml2? ( dev-libs/libxml2 )
109 + lua? ( >=dev-lang/lua-5.1:* )
110 + nghttp2? ( net-libs/nghttp2 )
111 + pcap? ( net-libs/libpcap )
112 + portaudio? ( media-libs/portaudio )
113 + qt5? (
114 + dev-qt/qtcore:5
115 + dev-qt/qtgui:5
116 + dev-qt/qtmultimedia:5
117 + dev-qt/qtprintsupport:5
118 + dev-qt/qtwidgets:5
119 + media-libs/speex
120 + x11-misc/xdg-utils
121 + )
122 + sbc? ( media-libs/sbc )
123 + smi? ( net-libs/libsmi )
124 + snappy? ( app-arch/snappy )
125 + spandsp? ( media-libs/spandsp )
126 + ssl? ( net-libs/gnutls:= )
127 + zlib? ( sys-libs/zlib !=sys-libs/zlib-1.2.4 )
128 +"
129 +# We need perl for `pod2html`. The rest of the perl stuff is to block older
130 +# and broken installs. #455122
131 +DEPEND="
132 + ${CDEPEND}
133 + dev-lang/perl
134 + !<virtual/perl-Pod-Simple-3.170
135 + !<perl-core/Pod-Simple-3.170
136 + doc? (
137 + app-doc/doxygen
138 + app-text/asciidoc
139 + dev-libs/libxml2
140 + dev-libs/libxslt
141 + doc-pdf? ( dev-java/fop )
142 + www-client/lynx
143 + )
144 + qt5? (
145 + dev-qt/linguist-tools:5
146 + )
147 + sys-devel/bison
148 + sys-devel/flex
149 + virtual/pkgconfig
150 +"
151 +RDEPEND="
152 + ${CDEPEND}
153 + gtk? ( virtual/freedesktop-icon-theme )
154 + qt5? ( virtual/freedesktop-icon-theme )
155 + selinux? ( sec-policy/selinux-wireshark )
156 +"
157 +PATCHES=(
158 + "${FILESDIR}"/${PN}-1.99.8-qtchooser.patch
159 + "${FILESDIR}"/${PN}-2.1.0-sse4_2-r1.patch
160 + "${FILESDIR}"/${PN}-2.4-androiddump.patch
161 + "${FILESDIR}"/${PN}-99999999-androiddump.patch
162 +)
163 +
164 +pkg_setup() {
165 + enewgroup wireshark
166 +}
167 +
168 +src_prepare() {
169 + default
170 +
171 + eautoreconf
172 +}
173 +
174 +src_configure() {
175 + local myconf
176 +
177 + # Workaround bug #213705. If krb5-config --libs has -lcrypto then pass
178 + # --with-ssl to ./configure. (Mimics code from acinclude.m4).
179 + if use kerberos; then
180 + case $(krb5-config --libs) in
181 + *-lcrypto*)
182 + ewarn "Kerberos was built with ssl support: linkage with openssl is enabled."
183 + ewarn "Note there are annoying license incompatibilities between the OpenSSL"
184 + ewarn "license and the GPL, so do your check before distributing such package."
185 + myconf+=( "--with-ssl" )
186 + ;;
187 + esac
188 + fi
189 +
190 + # Enable wireshark binary with any supported GUI toolkit (bug #473188)
191 + if use gtk || use qt5; then
192 + myconf+=( "--enable-wireshark" )
193 + else
194 + myconf+=( "--disable-wireshark" )
195 + fi
196 +
197 + if ! use qt5; then
198 + myconf+=( "--with-qt=no" )
199 + fi
200 +
201 + if use qt5; then
202 + export QT_MIN_VERSION=5.3.0
203 + append-cxxflags -fPIC -DPIC
204 + fi
205 +
206 + # Hack around inability to disable doxygen/fop doc generation
207 + use doc || export ac_cv_prog_HAVE_DOXYGEN=false
208 + use doc-pdf || export ac_cv_prog_HAVE_FOP=false
209 +
210 + # dumpcap requires libcap
211 + # --disable-profile-build bugs #215806, #292991, #479602
212 + econf \
213 + $(use androiddump && use pcap && echo --enable-androiddump-use-libpcap=yes) \
214 + $(use_enable androiddump) \
215 + $(use_enable ciscodump) \
216 + $(use_enable randpkt) \
217 + $(use_enable randpktdump) \
218 + $(use_enable sshdump) \
219 + $(use_enable tfshark) \
220 + $(use_with adns c-ares) \
221 + $(use_with caps libcap) \
222 + $(use_with geoip) \
223 + $(use_with gtk gtk 3) \
224 + $(use_with kerberos krb5) \
225 + $(use_with libssh ssh) \
226 + $(use_with libxml2) \
227 + $(use_with lua) \
228 + $(use_with nghttp2) \
229 + $(use_with pcap dumpcap-group wireshark) \
230 + $(use_with pcap) \
231 + $(use_with portaudio) \
232 + $(use_with sbc) \
233 + $(use_with smi libsmi) \
234 + $(use_with snappy) \
235 + $(use_with spandsp) \
236 + $(use_with ssl gnutls) \
237 + $(use_with zlib) \
238 + $(usex cpu_flags_x86_sse4_2 --enable-sse4_2 '') \
239 + $(usex netlink --with-libnl=3 --without-libnl) \
240 + $(usex qt5 --with-qt=5 '') \
241 + $(usex qt5 LRELEASE=$(qt5_get_bindir)/lrelease '') \
242 + $(usex qt5 MOC=$(qt5_get_bindir)/moc '') \
243 + $(usex qt5 RCC=$(qt5_get_bindir)/rcc '') \
244 + $(usex qt5 UIC=$(qt5_get_bindir)/uic '') \
245 + --disable-profile-build \
246 + --disable-warnings-as-errors \
247 + --sysconfdir="${EPREFIX}"/etc/wireshark \
248 + ${myconf[@]}
249 +}
250 +
251 +src_compile() {
252 + default
253 +
254 + if use doc; then
255 + emake -j1 -C docbook
256 + if use doc-pdf; then
257 + addpredict "/root/.java"
258 + emake -C docbook all-pdf
259 + fi
260 + fi
261 +}
262 +
263 +src_install() {
264 + default
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 + if use doc; then
271 + docinto /usr/share/doc/${PF}/html
272 + dodoc -r docbook/{release-notes.html,ws{d,u}g_html{,_chunked}}
273 + if use doc-pdf; then
274 + docinto /usr/share/doc/${PF}/pdf/
275 + dodoc docbook/{developer,user}-guide-{a4,us}.pdf docbook/release-notes.pdf
276 + fi
277 + fi
278 +
279 + # install headers
280 + local wsheader
281 + for wsheader in \
282 + config.h \
283 + epan/*.h \
284 + epan/crypt/*.h \
285 + epan/dfilter/*.h \
286 + epan/dissectors/*.h \
287 + epan/ftypes/*.h \
288 + epan/wmem/*.h \
289 + register.h \
290 + wiretap/*.h \
291 + ws_diag_control.h \
292 + ws_symbol_export.h \
293 + wsutil/*.h
294 + do
295 + insinto /usr/include/wireshark/$( dirname ${wsheader} )
296 + doins ${wsheader}
297 + done
298 +
299 + #with the above this really shouldn't be needed, but things may be looking in wiretap/ instead of wireshark/wiretap/
300 + insinto /usr/include/wiretap
301 + doins wiretap/wtap.h
302 +
303 + if use gtk || use qt5; then
304 + local c d
305 + for c in hi lo; do
306 + for d in 16 32 48; do
307 + insinto /usr/share/icons/${c}color/${d}x${d}/apps
308 + newins image/${c}${d}-app-wireshark.png wireshark.png
309 + done
310 + done
311 + for d in 16 24 32 48 64 128 256 ; do
312 + insinto /usr/share/icons/hicolor/${d}x${d}/mimetypes
313 + newins image/WiresharkDoc-${d}.png application-vnd.tcpdump.pcap.png
314 + done
315 + fi
316 +
317 + prune_libtool_files
318 +}
319 +
320 +pkg_postinst() {
321 + # Add group for users allowed to sniff.
322 + enewgroup wireshark
323 +
324 + if use pcap; then
325 + fcaps -o 0 -g wireshark -m 4710 -M 0710 \
326 + cap_dac_read_search,cap_net_raw,cap_net_admin \
327 + "${EROOT}"/usr/bin/dumpcap
328 + fi
329 +
330 + ewarn "NOTE: To capture traffic with wireshark as normal user you have to"
331 + ewarn "add yourself to the wireshark group. This security measure ensures"
332 + ewarn "that only trusted users are allowed to sniff your traffic."
333 +}