Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/wireshark/, net-analyzer/wireshark/files/
Date: Sun, 20 Feb 2022 06:31:26
Message-Id: 1645338607.11d357718ec192403193260fe033e93973c3aa5f.sam@gentoo
1 commit: 11d357718ec192403193260fe033e93973c3aa5f
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 20 06:29:48 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 20 06:30:07 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11d35771
7
8 Revert "net-analyzer/wireshark: drop 3.4.10, 3.4.11, 3.6.0-r1"
9
10 This reverts commit c2f163b2438b412dffa637ae892000c2913d546f.
11
12 Needed by stable libvirt.
13
14 Bug: https://bugs.gentoo.org/830343
15 Signed-off-by: Sam James <sam <AT> gentoo.org>
16
17 net-analyzer/wireshark/Manifest | 3 +
18 .../files/wireshark-3.6.0-fix-no-tshark.patch | 32 +++
19 net-analyzer/wireshark/wireshark-3.4.10.ebuild | 283 ++++++++++++++++++++
20 net-analyzer/wireshark/wireshark-3.4.11.ebuild | 285 +++++++++++++++++++++
21 net-analyzer/wireshark/wireshark-3.6.0-r1.ebuild | 272 ++++++++++++++++++++
22 5 files changed, 875 insertions(+)
23
24 diff --git a/net-analyzer/wireshark/Manifest b/net-analyzer/wireshark/Manifest
25 index b3b50a90c00b..df169bc81082 100644
26 --- a/net-analyzer/wireshark/Manifest
27 +++ b/net-analyzer/wireshark/Manifest
28 @@ -1,2 +1,5 @@
29 +DIST wireshark-3.4.10.tar.xz 32344804 BLAKE2B fe2ececd4a02530176725d62524fe000816f7f12dd58082d4966dfe7e5e0b90be669ed216c5a664f6496e74cb5dc5e4fb5beeaf513570ae503e3181692635563 SHA512 8a57d5279e9f3821b6ba3dceba89ad77fa8d0cf8cf421eab4d32e039497b429444c147b31abebd65b11b0b3ff73cf10d484480bcf0aedb206011819df8ab0257
30 +DIST wireshark-3.4.11.tar.xz 32354216 BLAKE2B 3e08d01f2d89f5ddd74c4e2215e6852f30c7419234a45b52a25aa9119995ec2c2882cc3993dce7941e6e73230eb4d295bf0785dda5fe8c3df99f9efdb1e42bfd SHA512 cfef2c3e56279baadb7f41a1f46fde9214a467972f69914c14a8153ea2f2adcb55832413bcaf7a3f8d98b4b62d0574f12144de6c06ff382b4fa8b071903993dc
31 +DIST wireshark-3.6.0.tar.xz 39687684 BLAKE2B 17af7046662087a18d0708ab0b5bc00bd4d43db848e14217e046dd551e57decd0a258f67c7fd82e1e10e0dceb249618e41ded5a6cd2e0a79d2ee5b7bf397cea7 SHA512 7c8afdee8957eb794030e0818a686c0efabc8ad9547449f434fc7299c7b7e624347698fdc7a42afac150eb86c8ca3d1d6360c29525bb35946619c4636f721094
32 DIST wireshark-3.6.1.tar.xz 39632140 BLAKE2B 49a7385946001a3b4a9890751cfea678c8aefcf8180e1a3008085a453d34e458d60d071975eeb585b92c6d9a210b732cc9fdb4fd952f1a9d74decad79c145fe0 SHA512 8b036d623010a5c4ece22de869847b3d999dac1c1e874e957c091a65c18351d9a1cc400828a70caf3c9f9900f8971dc585a5fafb7b08d446cd5d1d68938b0e81
33 DIST wireshark-3.6.2.tar.xz 39654296 BLAKE2B 585cf925892ec9d5b6413ccc53c49035eba8a7cd9206f1354f0a808daec9b0f20fc72b3427a2b592f196dd6b2ab67fd35e73d152a20c16fb0f0153c6a03d3156 SHA512 cd4a8077629632e9a924600f9af2ffd01917726fd64504d6f3b4a2a1cb5340c9c0bac23e4abab63743952a0a78efd2e09bb125b127d24e85eca6fa41928fd070
34
35 diff --git a/net-analyzer/wireshark/files/wireshark-3.6.0-fix-no-tshark.patch b/net-analyzer/wireshark/files/wireshark-3.6.0-fix-no-tshark.patch
36 new file mode 100644
37 index 000000000000..dd497c51391c
38 --- /dev/null
39 +++ b/net-analyzer/wireshark/files/wireshark-3.6.0-fix-no-tshark.patch
40 @@ -0,0 +1,32 @@
41 +https://gitlab.com/wireshark/wireshark/-/commit/411df7ca34027d87fe6ecc06a07c816a401c4cb5
42 +https://gitlab.com/wireshark/wireshark/-/issues/17766
43 +https://bugs.gentoo.org/823720
44 +
45 +From: Gerald Combs <gerald@×××××××××.org>
46 +Date: Mon, 6 Dec 2021 19:01:10 -0800
47 +Subject: [PATCH] CMake: Remove the update_tools_help target.
48 +
49 +Remove the update_tools_help target. Despite the comment, the weekly
50 +update job doesn't use it, we don't have targets for our other update
51 +scripts, and it currently causes issues if BUILD_tshark is disabled.
52 +Fixes #17766.
53 +--- a/docbook/CMakeLists.txt
54 ++++ b/docbook/CMakeLists.txt
55 +@@ -33,16 +33,6 @@ set(COMMON_GRAPHICS
56 +
57 + set(GUIDE_INSTALL_DIRS)
58 +
59 +-# This is automatically updated each week. You probably don't need to run it
60 +-# or depend on it.
61 +-add_custom_target(update_tools_help
62 +- COMMAND ${CMAKE_COMMAND} -E env PYTHONIOENCODING=UTF-8
63 +- ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/update-tools-help.py
64 +- --program-path $<TARGET_FILE_DIR:tshark>
65 +- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
66 +-)
67 +-set_docbook_target_properties(update_tools_help)
68 +-
69 + set(WSUG_TITLE "Wireshark User's Guide")
70 +
71 + set(WSUG_FILES
72 +GitLab
73
74 diff --git a/net-analyzer/wireshark/wireshark-3.4.10.ebuild b/net-analyzer/wireshark/wireshark-3.4.10.ebuild
75 new file mode 100644
76 index 000000000000..c3e28e4115a4
77 --- /dev/null
78 +++ b/net-analyzer/wireshark/wireshark-3.4.10.ebuild
79 @@ -0,0 +1,283 @@
80 +# Copyright 1999-2021 Gentoo Authors
81 +# Distributed under the terms of the GNU General Public License v2
82 +
83 +EAPI=7
84 +
85 +LUA_COMPAT=( lua5-{1..2} )
86 +PYTHON_COMPAT=( python3_{8..9} )
87 +
88 +inherit fcaps flag-o-matic lua-single python-any-r1 qmake-utils xdg-utils cmake
89 +
90 +DESCRIPTION="A network protocol analyzer formerly known as ethereal"
91 +HOMEPAGE="https://www.wireshark.org/"
92 +
93 +if [[ ${PV} == *9999* ]] ; then
94 + EGIT_REPO_URI="https://gitlab.com/wireshark/wireshark"
95 + inherit git-r3
96 +else
97 + SRC_URI="https://www.wireshark.org/download/src/all-versions/${P/_/}.tar.xz"
98 + S="${WORKDIR}/${P/_/}"
99 +
100 + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc64 x86"
101 +fi
102 +
103 +LICENSE="GPL-2"
104 +SLOT="0/${PV}"
105 +IUSE="androiddump bcg729 brotli +capinfos +captype ciscodump +dftest doc dpauxmon"
106 +IUSE+=" +dumpcap +editcap http2 ilbc kerberos libxml2 lto lua lz4 maxminddb"
107 +IUSE+=" +mergecap +minizip +netlink opus +plugins plugin-ifdemo +pcap +qt5 +randpkt"
108 +IUSE+=" +randpktdump +reordercap sbc selinux +sharkd smi snappy spandsp sshdump ssl"
109 +IUSE+=" sdjournal test +text2pcap tfshark +tshark +udpdump zlib +zstd"
110 +
111 +RESTRICT="!test? ( test )"
112 +
113 +# bug #753062 for speexdsp
114 +CDEPEND="
115 + acct-group/pcap
116 + >=dev-libs/glib-2.32:2
117 + >=net-dns/c-ares-1.5:=
118 + dev-libs/libgcrypt:=
119 + media-libs/speexdsp
120 + bcg729? ( media-libs/bcg729 )
121 + brotli? ( app-arch/brotli:= )
122 + ciscodump? ( >=net-libs/libssh-0.6 )
123 + filecaps? ( sys-libs/libcap )
124 + http2? ( net-libs/nghttp2:= )
125 + ilbc? ( media-libs/libilbc )
126 + kerberos? ( virtual/krb5 )
127 + libxml2? ( dev-libs/libxml2 )
128 + lua? ( ${LUA_DEPS} )
129 + lz4? ( app-arch/lz4:= )
130 + maxminddb? ( dev-libs/libmaxminddb:= )
131 + minizip? ( sys-libs/zlib[minizip] )
132 + netlink? ( dev-libs/libnl:3 )
133 + opus? ( media-libs/opus )
134 + pcap? ( net-libs/libpcap )
135 + qt5? (
136 + dev-qt/qtcore:5
137 + dev-qt/qtgui:5
138 + dev-qt/qtmultimedia:5
139 + dev-qt/qtprintsupport:5
140 + dev-qt/qtwidgets:5
141 + x11-misc/xdg-utils
142 + )
143 + sbc? ( media-libs/sbc )
144 + sdjournal? ( sys-apps/systemd )
145 + smi? ( net-libs/libsmi )
146 + snappy? ( app-arch/snappy )
147 + spandsp? ( media-libs/spandsp )
148 + sshdump? ( >=net-libs/libssh-0.6 )
149 + ssl? ( net-libs/gnutls:= )
150 + zlib? ( sys-libs/zlib )
151 + zstd? ( app-arch/zstd:= )
152 +"
153 +# We need perl for `pod2html`. The rest of the perl stuff is to block older
154 +# and broken installs. #455122
155 +DEPEND="
156 + ${CDEPEND}
157 + ${PYTHON_DEPS}
158 +"
159 +BDEPEND="
160 + dev-lang/perl
161 + sys-devel/bison
162 + sys-devel/flex
163 + virtual/pkgconfig
164 + doc? (
165 + app-doc/doxygen
166 + dev-ruby/asciidoctor
167 + )
168 + qt5? (
169 + dev-qt/linguist-tools:5
170 + )
171 + test? (
172 + dev-python/pytest
173 + dev-python/pytest-xdist
174 + )
175 +"
176 +RDEPEND="
177 + ${CDEPEND}
178 + qt5? ( virtual/freedesktop-icon-theme )
179 + selinux? ( sec-policy/selinux-wireshark )
180 +"
181 +REQUIRED_USE="
182 + lua? ( ${LUA_REQUIRED_USE} )
183 + plugin-ifdemo? ( plugins )
184 +"
185 +
186 +PATCHES=(
187 + "${FILESDIR}"/${PN}-2.6.0-redhat.patch
188 + "${FILESDIR}"/${PN}-3.4.2-cmake-lua-version.patch
189 + "${FILESDIR}"/${PN}-9999-ui-needs-wiretap.patch
190 +)
191 +
192 +pkg_setup() {
193 + use lua && lua-single_pkg_setup
194 +}
195 +
196 +src_configure() {
197 + local mycmakeargs
198 +
199 + # Workaround bug #213705. If krb5-config --libs has -lcrypto then pass
200 + # --with-ssl to ./configure. (Mimics code from acinclude.m4).
201 + if use kerberos; then
202 + case $(krb5-config --libs) in
203 + *-lcrypto*)
204 + ewarn "Kerberos was built with ssl support: linkage with openssl is enabled."
205 + ewarn "Note there are annoying license incompatibilities between the OpenSSL"
206 + ewarn "license and the GPL, so do your check before distributing such package."
207 + mycmakeargs+=( -DENABLE_GNUTLS=$(usex ssl) )
208 + ;;
209 + esac
210 + fi
211 +
212 + if use qt5; then
213 + export QT_MIN_VERSION=5.3.0
214 + append-cxxflags -fPIC -DPIC
215 + fi
216 +
217 + python_setup
218 +
219 + mycmakeargs+=(
220 + $(use androiddump && use pcap && echo -DEXTCAP_ANDROIDDUMP_LIBPCAP=yes)
221 + $(usex qt5 LRELEASE=$(qt5_get_bindir)/lrelease '')
222 + $(usex qt5 MOC=$(qt5_get_bindir)/moc '')
223 + $(usex qt5 RCC=$(qt5_get_bindir)/rcc '')
224 + $(usex qt5 UIC=$(qt5_get_bindir)/uic '')
225 + -DBUILD_androiddump=$(usex androiddump)
226 + -DBUILD_capinfos=$(usex capinfos)
227 + -DBUILD_captype=$(usex captype)
228 + -DBUILD_ciscodump=$(usex ciscodump)
229 + -DBUILD_dftest=$(usex dftest)
230 + -DBUILD_dpauxmon=$(usex dpauxmon)
231 + -DBUILD_dumpcap=$(usex dumpcap)
232 + -DBUILD_editcap=$(usex editcap)
233 + -DBUILD_mergecap=$(usex mergecap)
234 + -DBUILD_mmdbresolve=$(usex maxminddb)
235 + -DBUILD_randpkt=$(usex randpkt)
236 + -DBUILD_randpktdump=$(usex randpktdump)
237 + -DBUILD_reordercap=$(usex reordercap)
238 + -DBUILD_sdjournal=$(usex sdjournal)
239 + -DBUILD_sharkd=$(usex sharkd)
240 + -DBUILD_sshdump=$(usex sshdump)
241 + -DBUILD_text2pcap=$(usex text2pcap)
242 + -DBUILD_tfshark=$(usex tfshark)
243 + -DBUILD_tshark=$(usex tshark)
244 + -DBUILD_udpdump=$(usex udpdump)
245 + -DBUILD_wireshark=$(usex qt5)
246 + -DDISABLE_WERROR=yes
247 + -DENABLE_BCG729=$(usex bcg729)
248 + -DENABLE_BROTLI=$(usex brotli)
249 + -DENABLE_CAP=$(usex filecaps caps)
250 + -DENABLE_GNUTLS=$(usex ssl)
251 + -DENABLE_ILBC=$(usex ilbc)
252 + -DENABLE_KERBEROS=$(usex kerberos)
253 + -DENABLE_LIBXML2=$(usex libxml2)
254 + -DENABLE_LTO=$(usex lto)
255 + -DENABLE_LUA=$(usex lua)
256 + -DENABLE_LZ4=$(usex lz4)
257 + -DENABLE_MINIZIP=$(usex minizip)
258 + -DENABLE_NETLINK=$(usex netlink)
259 + -DENABLE_NGHTTP2=$(usex http2)
260 + -DENABLE_OPUS=$(usex opus)
261 + -DENABLE_PCAP=$(usex pcap)
262 + -DENABLE_PLUGINS=$(usex plugins)
263 + -DENABLE_PLUGIN_IFDEMO=$(usex plugin-ifdemo)
264 + -DENABLE_SBC=$(usex sbc)
265 + -DENABLE_SMI=$(usex smi)
266 + -DENABLE_SNAPPY=$(usex snappy)
267 + -DENABLE_SPANDSP=$(usex spandsp)
268 + -DENABLE_ZLIB=$(usex zlib)
269 + -DENABLE_ZSTD=$(usex zstd)
270 + )
271 +
272 + cmake_src_configure
273 +}
274 +
275 +src_test() {
276 + cmake_build test-programs
277 +
278 + myctestargs=(
279 + --disable-capture
280 + --skip-missing-programs=all
281 + --verbose
282 +
283 + # Skip known failing tests
284 + -E "(suite_decryption|suite_extcaps|suite_nameres)"
285 + )
286 +
287 + cmake_src_test
288 +}
289 +
290 +src_install() {
291 + cmake_src_install
292 +
293 + # FAQ is not required as is installed from help/faq.txt
294 + dodoc AUTHORS ChangeLog NEWS README* doc/randpkt.txt doc/README*
295 +
296 + # install headers
297 + insinto /usr/include/wireshark
298 + doins ws_diag_control.h ws_symbol_export.h \
299 + "${BUILD_DIR}"/config.h "${BUILD_DIR}"/version.h
300 +
301 + local dir dirs=(
302 + epan
303 + epan/crypt
304 + epan/dfilter
305 + epan/dissectors
306 + epan/ftypes
307 + epan/wmem
308 + wiretap
309 + wsutil
310 + )
311 +
312 + for dir in "${dirs[@]}" ; do
313 + insinto /usr/include/wireshark/${dir}
314 + doins ${dir}/*.h
315 + done
316 +
317 + #with the above this really shouldn't be needed, but things may be looking
318 + # in wiretap/ instead of wireshark/wiretap/
319 + insinto /usr/include/wiretap
320 + doins wiretap/wtap.h
321 +
322 + if use qt5; then
323 + local s
324 + for s in 16 32 48 64 128 256 512 1024; do
325 + insinto /usr/share/icons/hicolor/${s}x${s}/apps
326 + newins image/wsicon${s}.png wireshark.png
327 + done
328 + for s in 16 24 32 48 64 128 256 ; do
329 + insinto /usr/share/icons/hicolor/${s}x${s}/mimetypes
330 + newins image/WiresharkDoc-${s}.png application-vnd.tcpdump.pcap.png
331 + done
332 + fi
333 +
334 + if [[ -d "${ED}"/usr/share/appdata ]]; then
335 + rm -r "${ED}"/usr/share/appdata || die
336 + fi
337 +}
338 +
339 +pkg_postinst() {
340 + xdg_desktop_database_update
341 + xdg_icon_cache_update
342 + xdg_mimeinfo_database_update
343 +
344 + # Add group for users allowed to sniff.
345 + chgrp pcap "${EROOT}"/usr/bin/dumpcap
346 +
347 + if use dumpcap && use pcap; then
348 + fcaps -o 0 -g pcap -m 4710 -M 0710 \
349 + cap_dac_read_search,cap_net_raw,cap_net_admin \
350 + "${EROOT}"/usr/bin/dumpcap
351 + fi
352 +
353 + ewarn "NOTE: To capture traffic with wireshark as normal user you have to"
354 + ewarn "add yourself to the pcap group. This security measure ensures"
355 + ewarn "that only trusted users are allowed to sniff your traffic."
356 +}
357 +
358 +pkg_postrm() {
359 + xdg_desktop_database_update
360 + xdg_icon_cache_update
361 + xdg_mimeinfo_database_update
362 +}
363
364 diff --git a/net-analyzer/wireshark/wireshark-3.4.11.ebuild b/net-analyzer/wireshark/wireshark-3.4.11.ebuild
365 new file mode 100644
366 index 000000000000..d1c09690a523
367 --- /dev/null
368 +++ b/net-analyzer/wireshark/wireshark-3.4.11.ebuild
369 @@ -0,0 +1,285 @@
370 +# Copyright 1999-2022 Gentoo Authors
371 +# Distributed under the terms of the GNU General Public License v2
372 +
373 +EAPI=7
374 +
375 +LUA_COMPAT=( lua5-{1..2} )
376 +PYTHON_COMPAT=( python3_{8..9} )
377 +
378 +inherit fcaps flag-o-matic lua-single python-any-r1 qmake-utils xdg-utils cmake
379 +
380 +DESCRIPTION="A network protocol analyzer formerly known as ethereal"
381 +HOMEPAGE="https://www.wireshark.org/"
382 +
383 +if [[ ${PV} == *9999* ]] ; then
384 + EGIT_REPO_URI="https://gitlab.com/wireshark/wireshark"
385 + inherit git-r3
386 +else
387 + SRC_URI="https://www.wireshark.org/download/src/all-versions/${P/_/}.tar.xz"
388 + S="${WORKDIR}/${P/_/}"
389 +
390 + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc64 x86"
391 +fi
392 +
393 +LICENSE="GPL-2"
394 +SLOT="0/${PV}"
395 +IUSE="androiddump bcg729 brotli +capinfos +captype ciscodump +dftest doc dpauxmon"
396 +IUSE+=" +dumpcap +editcap http2 ilbc kerberos libxml2 lto lua lz4 maxminddb"
397 +IUSE+=" +mergecap +minizip +netlink opus +plugins plugin-ifdemo +pcap +qt5 +randpkt"
398 +IUSE+=" +randpktdump +reordercap sbc selinux +sharkd smi snappy spandsp sshdump ssl"
399 +IUSE+=" sdjournal test +text2pcap tfshark +tshark +udpdump zlib +zstd"
400 +
401 +RESTRICT="!test? ( test )"
402 +
403 +# bug #753062 for speexdsp
404 +CDEPEND="
405 + acct-group/pcap
406 + >=dev-libs/glib-2.32:2
407 + >=net-dns/c-ares-1.5:=
408 + dev-libs/libgcrypt:=
409 + media-libs/speexdsp
410 + bcg729? ( media-libs/bcg729 )
411 + brotli? ( app-arch/brotli:= )
412 + ciscodump? ( >=net-libs/libssh-0.6 )
413 + filecaps? ( sys-libs/libcap )
414 + http2? ( net-libs/nghttp2:= )
415 + ilbc? ( media-libs/libilbc )
416 + kerberos? ( virtual/krb5 )
417 + libxml2? ( dev-libs/libxml2 )
418 + lua? ( ${LUA_DEPS} )
419 + lz4? ( app-arch/lz4:= )
420 + maxminddb? ( dev-libs/libmaxminddb:= )
421 + minizip? ( sys-libs/zlib[minizip] )
422 + netlink? ( dev-libs/libnl:3 )
423 + opus? ( media-libs/opus )
424 + pcap? ( net-libs/libpcap )
425 + qt5? (
426 + dev-qt/qtcore:5
427 + dev-qt/qtgui:5
428 + dev-qt/qtmultimedia:5
429 + dev-qt/qtprintsupport:5
430 + dev-qt/qtwidgets:5
431 + x11-misc/xdg-utils
432 + )
433 + sbc? ( media-libs/sbc )
434 + sdjournal? ( sys-apps/systemd )
435 + smi? ( net-libs/libsmi )
436 + snappy? ( app-arch/snappy )
437 + spandsp? ( media-libs/spandsp )
438 + sshdump? ( >=net-libs/libssh-0.6 )
439 + ssl? ( net-libs/gnutls:= )
440 + zlib? ( sys-libs/zlib )
441 + zstd? ( app-arch/zstd:= )
442 +"
443 +# We need perl for `pod2html`. The rest of the perl stuff is to block older
444 +# and broken installs. #455122
445 +DEPEND="
446 + ${CDEPEND}
447 + ${PYTHON_DEPS}
448 +"
449 +BDEPEND="
450 + dev-lang/perl
451 + sys-devel/bison
452 + sys-devel/flex
453 + virtual/pkgconfig
454 + doc? (
455 + app-doc/doxygen
456 + dev-ruby/asciidoctor
457 + )
458 + qt5? (
459 + dev-qt/linguist-tools:5
460 + )
461 + test? (
462 + dev-python/pytest
463 + dev-python/pytest-xdist
464 + )
465 +"
466 +RDEPEND="
467 + ${CDEPEND}
468 + qt5? ( virtual/freedesktop-icon-theme )
469 + selinux? ( sec-policy/selinux-wireshark )
470 +"
471 +REQUIRED_USE="
472 + lua? ( ${LUA_REQUIRED_USE} )
473 + plugin-ifdemo? ( plugins )
474 +"
475 +
476 +PATCHES=(
477 + "${FILESDIR}"/${PN}-2.6.0-redhat.patch
478 + "${FILESDIR}"/${PN}-3.4.2-cmake-lua-version.patch
479 + "${FILESDIR}"/${PN}-9999-ui-needs-wiretap.patch
480 +)
481 +
482 +pkg_setup() {
483 + use lua && lua-single_pkg_setup
484 +}
485 +
486 +src_configure() {
487 + local mycmakeargs
488 +
489 + # Workaround bug #213705. If krb5-config --libs has -lcrypto then pass
490 + # --with-ssl to ./configure. (Mimics code from acinclude.m4).
491 + if use kerberos; then
492 + case $(krb5-config --libs) in
493 + *-lcrypto*)
494 + ewarn "Kerberos was built with ssl support: linkage with openssl is enabled."
495 + ewarn "Note there are annoying license incompatibilities between the OpenSSL"
496 + ewarn "license and the GPL, so do your check before distributing such package."
497 + mycmakeargs+=( -DENABLE_GNUTLS=$(usex ssl) )
498 + ;;
499 + esac
500 + fi
501 +
502 + if use qt5; then
503 + export QT_MIN_VERSION=5.3.0
504 + append-cxxflags -fPIC -DPIC
505 + fi
506 +
507 + python_setup
508 +
509 + mycmakeargs+=(
510 + $(use androiddump && use pcap && echo -DEXTCAP_ANDROIDDUMP_LIBPCAP=yes)
511 + $(usex qt5 LRELEASE=$(qt5_get_bindir)/lrelease '')
512 + $(usex qt5 MOC=$(qt5_get_bindir)/moc '')
513 + $(usex qt5 RCC=$(qt5_get_bindir)/rcc '')
514 + $(usex qt5 UIC=$(qt5_get_bindir)/uic '')
515 + -DBUILD_androiddump=$(usex androiddump)
516 + -DBUILD_capinfos=$(usex capinfos)
517 + -DBUILD_captype=$(usex captype)
518 + -DBUILD_ciscodump=$(usex ciscodump)
519 + -DBUILD_dftest=$(usex dftest)
520 + -DBUILD_dpauxmon=$(usex dpauxmon)
521 + -DBUILD_dumpcap=$(usex dumpcap)
522 + -DBUILD_editcap=$(usex editcap)
523 + -DBUILD_mergecap=$(usex mergecap)
524 + -DBUILD_mmdbresolve=$(usex maxminddb)
525 + -DBUILD_randpkt=$(usex randpkt)
526 + -DBUILD_randpktdump=$(usex randpktdump)
527 + -DBUILD_reordercap=$(usex reordercap)
528 + -DBUILD_sdjournal=$(usex sdjournal)
529 + -DBUILD_sharkd=$(usex sharkd)
530 + -DBUILD_sshdump=$(usex sshdump)
531 + -DBUILD_text2pcap=$(usex text2pcap)
532 + -DBUILD_tfshark=$(usex tfshark)
533 + -DBUILD_tshark=$(usex tshark)
534 + -DBUILD_udpdump=$(usex udpdump)
535 + -DBUILD_wireshark=$(usex qt5)
536 + -DDISABLE_WERROR=yes
537 + -DENABLE_BCG729=$(usex bcg729)
538 + -DENABLE_BROTLI=$(usex brotli)
539 + -DENABLE_CAP=$(usex filecaps caps)
540 + -DENABLE_GNUTLS=$(usex ssl)
541 + -DENABLE_ILBC=$(usex ilbc)
542 + -DENABLE_KERBEROS=$(usex kerberos)
543 + -DENABLE_LIBXML2=$(usex libxml2)
544 + -DENABLE_LTO=$(usex lto)
545 + -DENABLE_LUA=$(usex lua)
546 + -DENABLE_LZ4=$(usex lz4)
547 + -DENABLE_MINIZIP=$(usex minizip)
548 + -DENABLE_NETLINK=$(usex netlink)
549 + -DENABLE_NGHTTP2=$(usex http2)
550 + -DENABLE_OPUS=$(usex opus)
551 + -DENABLE_PCAP=$(usex pcap)
552 + -DENABLE_PLUGINS=$(usex plugins)
553 + -DENABLE_PLUGIN_IFDEMO=$(usex plugin-ifdemo)
554 + -DENABLE_SBC=$(usex sbc)
555 + -DENABLE_SMI=$(usex smi)
556 + -DENABLE_SNAPPY=$(usex snappy)
557 + -DENABLE_SPANDSP=$(usex spandsp)
558 + -DENABLE_ZLIB=$(usex zlib)
559 + -DENABLE_ZSTD=$(usex zstd)
560 + )
561 +
562 + cmake_src_configure
563 +}
564 +
565 +src_test() {
566 + cmake_build test-programs
567 +
568 + myctestargs=(
569 + --disable-capture
570 + --skip-missing-programs=all
571 + --verbose
572 +
573 + # Skip known failing tests
574 + # extcaps needs a bunch of external programs
575 + # decryption/nameres seem to be fixed in 3.6.x
576 + -E "(suite_decryption|suite_extcaps|suite_nameres)"
577 + )
578 +
579 + cmake_src_test
580 +}
581 +
582 +src_install() {
583 + cmake_src_install
584 +
585 + # FAQ is not required as is installed from help/faq.txt
586 + dodoc AUTHORS ChangeLog NEWS README* doc/randpkt.txt doc/README*
587 +
588 + # install headers
589 + insinto /usr/include/wireshark
590 + doins ws_diag_control.h ws_symbol_export.h \
591 + "${BUILD_DIR}"/config.h "${BUILD_DIR}"/version.h
592 +
593 + local dir dirs=(
594 + epan
595 + epan/crypt
596 + epan/dfilter
597 + epan/dissectors
598 + epan/ftypes
599 + epan/wmem
600 + wiretap
601 + wsutil
602 + )
603 +
604 + for dir in "${dirs[@]}" ; do
605 + insinto /usr/include/wireshark/${dir}
606 + doins ${dir}/*.h
607 + done
608 +
609 + #with the above this really shouldn't be needed, but things may be looking
610 + # in wiretap/ instead of wireshark/wiretap/
611 + insinto /usr/include/wiretap
612 + doins wiretap/wtap.h
613 +
614 + if use qt5; then
615 + local s
616 + for s in 16 32 48 64 128 256 512 1024; do
617 + insinto /usr/share/icons/hicolor/${s}x${s}/apps
618 + newins image/wsicon${s}.png wireshark.png
619 + done
620 + for s in 16 24 32 48 64 128 256 ; do
621 + insinto /usr/share/icons/hicolor/${s}x${s}/mimetypes
622 + newins image/WiresharkDoc-${s}.png application-vnd.tcpdump.pcap.png
623 + done
624 + fi
625 +
626 + if [[ -d "${ED}"/usr/share/appdata ]]; then
627 + rm -r "${ED}"/usr/share/appdata || die
628 + fi
629 +}
630 +
631 +pkg_postinst() {
632 + xdg_desktop_database_update
633 + xdg_icon_cache_update
634 + xdg_mimeinfo_database_update
635 +
636 + # Add group for users allowed to sniff.
637 + chgrp pcap "${EROOT}"/usr/bin/dumpcap
638 +
639 + if use dumpcap && use pcap; then
640 + fcaps -o 0 -g pcap -m 4710 -M 0710 \
641 + cap_dac_read_search,cap_net_raw,cap_net_admin \
642 + "${EROOT}"/usr/bin/dumpcap
643 + fi
644 +
645 + ewarn "NOTE: To capture traffic with wireshark as normal user you have to"
646 + ewarn "add yourself to the pcap group. This security measure ensures"
647 + ewarn "that only trusted users are allowed to sniff your traffic."
648 +}
649 +
650 +pkg_postrm() {
651 + xdg_desktop_database_update
652 + xdg_icon_cache_update
653 + xdg_mimeinfo_database_update
654 +}
655
656 diff --git a/net-analyzer/wireshark/wireshark-3.6.0-r1.ebuild b/net-analyzer/wireshark/wireshark-3.6.0-r1.ebuild
657 new file mode 100644
658 index 000000000000..520a2dc646a6
659 --- /dev/null
660 +++ b/net-analyzer/wireshark/wireshark-3.6.0-r1.ebuild
661 @@ -0,0 +1,272 @@
662 +# Copyright 1999-2021 Gentoo Authors
663 +# Distributed under the terms of the GNU General Public License v2
664 +
665 +EAPI=7
666 +
667 +LUA_COMPAT=( lua5-{1..2} )
668 +PYTHON_COMPAT=( python3_{8..10} )
669 +
670 +inherit fcaps flag-o-matic lua-single python-any-r1 qmake-utils xdg-utils cmake
671 +
672 +DESCRIPTION="A network protocol analyzer formerly known as ethereal"
673 +HOMEPAGE="https://www.wireshark.org/"
674 +
675 +if [[ ${PV} == *9999* ]] ; then
676 + EGIT_REPO_URI="https://gitlab.com/wireshark/wireshark"
677 + inherit git-r3
678 +else
679 + SRC_URI="https://www.wireshark.org/download/src/all-versions/${P/_/}.tar.xz"
680 + S="${WORKDIR}/${P/_/}"
681 +
682 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~riscv ~x86"
683 +fi
684 +
685 +LICENSE="GPL-2"
686 +SLOT="0/${PV}"
687 +IUSE="androiddump bcg729 brotli +capinfos +captype ciscodump +dftest doc dpauxmon"
688 +IUSE+=" +dumpcap +editcap http2 ilbc kerberos libxml2 lto lua lz4 maxminddb"
689 +IUSE+=" +mergecap +minizip +netlink opus +plugins plugin-ifdemo +pcap +qt5 +randpkt"
690 +IUSE+=" +randpktdump +reordercap sbc selinux +sharkd smi snappy spandsp sshdump ssl"
691 +IUSE+=" sdjournal test +text2pcap tfshark +tshark +udpdump zlib +zstd"
692 +
693 +REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )
694 + plugin-ifdemo? ( plugins )"
695 +
696 +RESTRICT="!test? ( test )"
697 +
698 +# bug #753062 for speexdsp
699 +RDEPEND="acct-group/pcap
700 + >=dev-libs/glib-2.38:2
701 + >=net-dns/c-ares-1.5:=
702 + dev-libs/libgcrypt:=
703 + media-libs/speexdsp
704 + bcg729? ( media-libs/bcg729 )
705 + brotli? ( app-arch/brotli:= )
706 + ciscodump? ( >=net-libs/libssh-0.6 )
707 + filecaps? ( sys-libs/libcap )
708 + http2? ( net-libs/nghttp2:= )
709 + ilbc? ( media-libs/libilbc )
710 + kerberos? ( virtual/krb5 )
711 + libxml2? ( dev-libs/libxml2 )
712 + lua? ( ${LUA_DEPS} )
713 + lz4? ( app-arch/lz4:= )
714 + maxminddb? ( dev-libs/libmaxminddb:= )
715 + minizip? ( sys-libs/zlib[minizip] )
716 + netlink? ( dev-libs/libnl:3 )
717 + opus? ( media-libs/opus )
718 + pcap? ( net-libs/libpcap )
719 + qt5? (
720 + dev-qt/qtcore:5
721 + dev-qt/qtgui:5
722 + dev-qt/qtmultimedia:5
723 + dev-qt/qtprintsupport:5
724 + dev-qt/qtwidgets:5
725 + x11-misc/xdg-utils
726 + )
727 + sbc? ( media-libs/sbc )
728 + sdjournal? ( sys-apps/systemd )
729 + smi? ( net-libs/libsmi )
730 + snappy? ( app-arch/snappy )
731 + spandsp? ( media-libs/spandsp )
732 + sshdump? ( >=net-libs/libssh-0.6 )
733 + ssl? ( net-libs/gnutls:= )
734 + zlib? ( sys-libs/zlib )
735 + zstd? ( app-arch/zstd:= )"
736 +DEPEND="${RDEPEND}"
737 +BDEPEND="${PYTHON_DEPS}
738 + dev-lang/perl
739 + sys-devel/flex
740 + sys-devel/gettext
741 + virtual/pkgconfig
742 + doc? (
743 + app-doc/doxygen
744 + dev-ruby/asciidoctor
745 + )
746 + qt5? (
747 + dev-qt/linguist-tools:5
748 + )
749 + test? (
750 + dev-python/pytest
751 + dev-python/pytest-xdist
752 + )"
753 +RDEPEND="${RDEPEND}
754 + qt5? ( virtual/freedesktop-icon-theme )
755 + selinux? ( sec-policy/selinux-wireshark )"
756 +
757 +PATCHES=(
758 + "${FILESDIR}"/${PN}-2.6.0-redhat.patch
759 + "${FILESDIR}"/${PN}-3.4.2-cmake-lua-version.patch
760 + "${FILESDIR}"/${PN}-3.6.0-fix-no-tshark.patch
761 +)
762 +
763 +pkg_setup() {
764 + use lua && lua-single_pkg_setup
765 +}
766 +
767 +src_configure() {
768 + local mycmakeargs
769 +
770 + # Workaround bug #213705. If krb5-config --libs has -lcrypto then pass
771 + # --with-ssl to ./configure. (Mimics code from acinclude.m4).
772 + if use kerberos ; then
773 + case $(krb5-config --libs) in
774 + *-lcrypto*)
775 + ewarn "Kerberos was built with ssl support: linkage with openssl is enabled."
776 + ewarn "Note there are annoying license incompatibilities between the OpenSSL"
777 + ewarn "license and the GPL, so do your check before distributing such package."
778 + mycmakeargs+=( -DENABLE_GNUTLS=$(usex ssl) )
779 + ;;
780 + esac
781 + fi
782 +
783 + if use qt5 ; then
784 + export QT_MIN_VERSION=5.3.0
785 + append-cxxflags -fPIC -DPIC
786 + fi
787 +
788 + python_setup
789 +
790 + mycmakeargs+=(
791 + -DCMAKE_DISABLE_FIND_PACKAGE_{Asciidoctor,DOXYGEN}=$(usex !doc)
792 + $(use androiddump && use pcap && echo -DEXTCAP_ANDROIDDUMP_LIBPCAP=yes)
793 + $(usex qt5 LRELEASE=$(qt5_get_bindir)/lrelease '')
794 + $(usex qt5 MOC=$(qt5_get_bindir)/moc '')
795 + $(usex qt5 RCC=$(qt5_get_bindir)/rcc '')
796 + $(usex qt5 UIC=$(qt5_get_bindir)/uic '')
797 + -DBUILD_androiddump=$(usex androiddump)
798 + -DBUILD_capinfos=$(usex capinfos)
799 + -DBUILD_captype=$(usex captype)
800 + -DBUILD_ciscodump=$(usex ciscodump)
801 + -DBUILD_dftest=$(usex dftest)
802 + -DBUILD_dpauxmon=$(usex dpauxmon)
803 + -DBUILD_dumpcap=$(usex dumpcap)
804 + -DBUILD_editcap=$(usex editcap)
805 + -DBUILD_mergecap=$(usex mergecap)
806 + -DBUILD_mmdbresolve=$(usex maxminddb)
807 + -DBUILD_randpkt=$(usex randpkt)
808 + -DBUILD_randpktdump=$(usex randpktdump)
809 + -DBUILD_reordercap=$(usex reordercap)
810 + -DBUILD_sdjournal=$(usex sdjournal)
811 + -DBUILD_sharkd=$(usex sharkd)
812 + -DBUILD_sshdump=$(usex sshdump)
813 + -DBUILD_text2pcap=$(usex text2pcap)
814 + -DBUILD_tfshark=$(usex tfshark)
815 + -DBUILD_tshark=$(usex tshark)
816 + -DBUILD_udpdump=$(usex udpdump)
817 + -DBUILD_wireshark=$(usex qt5)
818 + -DDISABLE_WERROR=yes
819 + -DENABLE_BCG729=$(usex bcg729)
820 + -DENABLE_BROTLI=$(usex brotli)
821 + -DENABLE_CAP=$(usex filecaps caps)
822 + -DENABLE_GNUTLS=$(usex ssl)
823 + -DENABLE_ILBC=$(usex ilbc)
824 + -DENABLE_KERBEROS=$(usex kerberos)
825 + -DENABLE_LIBXML2=$(usex libxml2)
826 + -DENABLE_LTO=$(usex lto)
827 + -DENABLE_LUA=$(usex lua)
828 + -DENABLE_LZ4=$(usex lz4)
829 + -DENABLE_MINIZIP=$(usex minizip)
830 + -DENABLE_NETLINK=$(usex netlink)
831 + -DENABLE_NGHTTP2=$(usex http2)
832 + -DENABLE_OPUS=$(usex opus)
833 + -DENABLE_PCAP=$(usex pcap)
834 + -DENABLE_PLUGINS=$(usex plugins)
835 + -DENABLE_PLUGIN_IFDEMO=$(usex plugin-ifdemo)
836 + -DENABLE_SBC=$(usex sbc)
837 + -DENABLE_SMI=$(usex smi)
838 + -DENABLE_SNAPPY=$(usex snappy)
839 + -DENABLE_SPANDSP=$(usex spandsp)
840 + -DENABLE_ZLIB=$(usex zlib)
841 + -DENABLE_ZSTD=$(usex zstd)
842 + )
843 +
844 + cmake_src_configure
845 +}
846 +
847 +src_test() {
848 + cmake_build test-programs
849 +
850 + myctestargs=(
851 + --disable-capture
852 + --skip-missing-programs=all
853 + --verbose
854 +
855 + # Skip known failing tests
856 + -E "(suite_decryption|suite_extcaps|suite_nameres)"
857 + )
858 +
859 + cmake_src_test
860 +}
861 +
862 +src_install() {
863 + cmake_src_install
864 +
865 + # FAQ is not required as is installed from help/faq.txt
866 + dodoc AUTHORS ChangeLog NEWS README* doc/randpkt.txt doc/README*
867 +
868 + # install headers
869 + insinto /usr/include/wireshark
870 + doins ws_diag_control.h ws_symbol_export.h \
871 + "${BUILD_DIR}"/config.h
872 +
873 + # If trying to remove this, try build e.g. libvirt first!
874 + # At last check, Fedora is still doing this too.
875 + local dir dirs=(
876 + epan
877 + epan/crypt
878 + epan/dfilter
879 + epan/dissectors
880 + epan/ftypes
881 + wiretap
882 + wsutil
883 + wsutil/wmem
884 + )
885 +
886 + for dir in "${dirs[@]}" ; do
887 + insinto /usr/include/wireshark/${dir}
888 + doins ${dir}/*.h
889 + done
890 +
891 + if use qt5 ; then
892 + local s
893 +
894 + for s in 16 32 48 64 128 256 512 1024 ; do
895 + insinto /usr/share/icons/hicolor/${s}x${s}/apps
896 + newins image/wsicon${s}.png wireshark.png
897 + done
898 +
899 + for s in 16 24 32 48 64 128 256 ; do
900 + insinto /usr/share/icons/hicolor/${s}x${s}/mimetypes
901 + newins image/WiresharkDoc-${s}.png application-vnd.tcpdump.pcap.png
902 + done
903 + fi
904 +
905 + if [[ -d "${ED}"/usr/share/appdata ]] ; then
906 + rm -r "${ED}"/usr/share/appdata || die
907 + fi
908 +}
909 +
910 +pkg_postinst() {
911 + xdg_desktop_database_update
912 + xdg_icon_cache_update
913 + xdg_mimeinfo_database_update
914 +
915 + # Add group for users allowed to sniff.
916 + chgrp pcap "${EROOT}"/usr/bin/dumpcap
917 +
918 + if use dumpcap && use pcap ; then
919 + fcaps -o 0 -g pcap -m 4710 -M 0710 \
920 + cap_dac_read_search,cap_net_raw,cap_net_admin \
921 + "${EROOT}"/usr/bin/dumpcap
922 + fi
923 +
924 + ewarn "NOTE: To capture traffic with wireshark as normal user you have to"
925 + ewarn "add yourself to the pcap group. This security measure ensures"
926 + ewarn "that only trusted users are allowed to sniff your traffic."
927 +}
928 +
929 +pkg_postrm() {
930 + xdg_desktop_database_update
931 + xdg_icon_cache_update
932 + xdg_mimeinfo_database_update
933 +}