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/
Date: Thu, 07 Oct 2021 02:41:21
Message-Id: 1633574465.b9e1235bd22d32199f68927c21dd84c79f917afe.sam@gentoo
1 commit: b9e1235bd22d32199f68927c21dd84c79f917afe
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 7 02:41:05 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 7 02:41:05 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9e1235b
7
8 net-analyzer/wireshark: add 3.4.9
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 net-analyzer/wireshark/Manifest | 1 +
13 net-analyzer/wireshark/wireshark-3.4.9.ebuild | 280 ++++++++++++++++++++++++++
14 2 files changed, 281 insertions(+)
15
16 diff --git a/net-analyzer/wireshark/Manifest b/net-analyzer/wireshark/Manifest
17 index 6002f96ee43..a36dea5ccec 100644
18 --- a/net-analyzer/wireshark/Manifest
19 +++ b/net-analyzer/wireshark/Manifest
20 @@ -1,2 +1,3 @@
21 DIST wireshark-3.4.7.tar.xz 32311140 BLAKE2B 0a6112ed667739935417350660e31d64747cb81295db058e0a27c38387b2ed2b9806f8d61925c262d531fb96d87e230d1cd5d511ae0bdba973373835bf5d7bc5 SHA512 26546828d26f0fef1021ae9fccf5c3f1d7cb3bd05ce63ec37259a1938546ec427415d542fe985c11f95055f7677a19b010be57c7082848714b1755565f092ed0
22 DIST wireshark-3.4.8.tar.xz 32314976 BLAKE2B bdd70b77b2582339fc563c91596b0419789f08c6a9e4895910cc703ba5726229acceeccdcf41b3c5831df711f3d635217f123759b86055d1b03742afed7c68e5 SHA512 962ab4d85ca0686c69470a63e516c0e46fbd8f9eb09e1c5f689f37b5c804c6da3e50b96144adc8e2bff6af67e1c9435db54581c8f1ec5908e27e348691bda1c8
23 +DIST wireshark-3.4.9.tar.xz 32335284 BLAKE2B 95b3e6804225af7043fa1f4e5dc53785d939b56c81983a010a579c61b10eed989e695601c7ac67eb3aa00f9314236dd03e1e9ebb35c17ca81b832bad654523de SHA512 479abcf7b44504a269b73201da5aabac0d7770cd779a325df3214b6df5dc37e175f2889165a933c2902001a06c8141768f35cd8ca35cc55fc6cf30a482ea27eb
24
25 diff --git a/net-analyzer/wireshark/wireshark-3.4.9.ebuild b/net-analyzer/wireshark/wireshark-3.4.9.ebuild
26 new file mode 100644
27 index 00000000000..4871d3fcafe
28 --- /dev/null
29 +++ b/net-analyzer/wireshark/wireshark-3.4.9.ebuild
30 @@ -0,0 +1,280 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +LUA_COMPAT=( lua5-{1..2} )
37 +PYTHON_COMPAT=( python3_{8..9} )
38 +
39 +inherit fcaps flag-o-matic lua-single python-any-r1 qmake-utils xdg-utils cmake
40 +
41 +DESCRIPTION="A network protocol analyzer formerly known as ethereal"
42 +HOMEPAGE="https://www.wireshark.org/"
43 +
44 +if [[ ${PV} == *9999* ]] ; then
45 + EGIT_REPO_URI="https://gitlab.com/wireshark/wireshark"
46 + inherit git-r3
47 +else
48 + SRC_URI="https://www.wireshark.org/download/src/all-versions/${P/_/}.tar.xz"
49 + S="${WORKDIR}/${P/_/}"
50 +
51 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~x86"
52 +fi
53 +
54 +LICENSE="GPL-2"
55 +SLOT="0/${PV}"
56 +IUSE="androiddump bcg729 brotli +capinfos +captype ciscodump +dftest doc dpauxmon"
57 +IUSE+=" +dumpcap +editcap http2 ilbc kerberos libxml2 lto lua lz4 maxminddb"
58 +IUSE+=" +mergecap +minizip +netlink opus +plugins plugin-ifdemo +pcap +qt5 +randpkt"
59 +IUSE+=" +randpktdump +reordercap sbc selinux +sharkd smi snappy spandsp sshdump ssl"
60 +IUSE+=" sdjournal test +text2pcap tfshark +tshark +udpdump zlib +zstd"
61 +
62 +# bug #753062 for speexdsp
63 +CDEPEND="
64 + acct-group/pcap
65 + >=dev-libs/glib-2.32:2
66 + >=net-dns/c-ares-1.5:=
67 + dev-libs/libgcrypt:=
68 + media-libs/speexdsp
69 + bcg729? ( media-libs/bcg729 )
70 + brotli? ( app-arch/brotli:= )
71 + ciscodump? ( >=net-libs/libssh-0.6 )
72 + filecaps? ( sys-libs/libcap )
73 + http2? ( net-libs/nghttp2:= )
74 + ilbc? ( media-libs/libilbc )
75 + kerberos? ( virtual/krb5 )
76 + libxml2? ( dev-libs/libxml2 )
77 + lua? ( ${LUA_DEPS} )
78 + lz4? ( app-arch/lz4:= )
79 + maxminddb? ( dev-libs/libmaxminddb:= )
80 + minizip? ( sys-libs/zlib[minizip] )
81 + netlink? ( dev-libs/libnl:3 )
82 + opus? ( media-libs/opus )
83 + pcap? ( net-libs/libpcap )
84 + qt5? (
85 + dev-qt/qtcore:5
86 + dev-qt/qtgui:5
87 + dev-qt/qtmultimedia:5
88 + dev-qt/qtprintsupport:5
89 + dev-qt/qtwidgets:5
90 + x11-misc/xdg-utils
91 + )
92 + sbc? ( media-libs/sbc )
93 + sdjournal? ( sys-apps/systemd )
94 + smi? ( net-libs/libsmi )
95 + snappy? ( app-arch/snappy )
96 + spandsp? ( media-libs/spandsp )
97 + sshdump? ( >=net-libs/libssh-0.6 )
98 + ssl? ( net-libs/gnutls:= )
99 + zlib? ( sys-libs/zlib )
100 + zstd? ( app-arch/zstd:= )
101 +"
102 +# We need perl for `pod2html`. The rest of the perl stuff is to block older
103 +# and broken installs. #455122
104 +DEPEND="
105 + ${CDEPEND}
106 + ${PYTHON_DEPS}
107 +"
108 +BDEPEND="
109 + dev-lang/perl
110 + sys-devel/bison
111 + sys-devel/flex
112 + virtual/pkgconfig
113 + doc? (
114 + app-doc/doxygen
115 + dev-ruby/asciidoctor
116 + )
117 + qt5? (
118 + dev-qt/linguist-tools:5
119 + )
120 + test? (
121 + dev-python/pytest
122 + dev-python/pytest-xdist
123 + )
124 +"
125 +RDEPEND="
126 + ${CDEPEND}
127 + qt5? ( virtual/freedesktop-icon-theme )
128 + selinux? ( sec-policy/selinux-wireshark )
129 +"
130 +REQUIRED_USE="
131 + lua? ( ${LUA_REQUIRED_USE} )
132 + plugin-ifdemo? ( plugins )
133 +"
134 +
135 +RESTRICT="test"
136 +
137 +PATCHES=(
138 + "${FILESDIR}"/${PN}-2.6.0-redhat.patch
139 + "${FILESDIR}"/${PN}-3.4.2-cmake-lua-version.patch
140 + "${FILESDIR}"/${PN}-9999-ui-needs-wiretap.patch
141 +)
142 +
143 +pkg_setup() {
144 + use lua && lua-single_pkg_setup
145 +}
146 +
147 +src_configure() {
148 + local mycmakeargs
149 +
150 + # Workaround bug #213705. If krb5-config --libs has -lcrypto then pass
151 + # --with-ssl to ./configure. (Mimics code from acinclude.m4).
152 + if use kerberos; then
153 + case $(krb5-config --libs) in
154 + *-lcrypto*)
155 + ewarn "Kerberos was built with ssl support: linkage with openssl is enabled."
156 + ewarn "Note there are annoying license incompatibilities between the OpenSSL"
157 + ewarn "license and the GPL, so do your check before distributing such package."
158 + mycmakeargs+=( -DENABLE_GNUTLS=$(usex ssl) )
159 + ;;
160 + esac
161 + fi
162 +
163 + if use qt5; then
164 + export QT_MIN_VERSION=5.3.0
165 + append-cxxflags -fPIC -DPIC
166 + fi
167 +
168 + python_setup
169 +
170 + mycmakeargs+=(
171 + $(use androiddump && use pcap && echo -DEXTCAP_ANDROIDDUMP_LIBPCAP=yes)
172 + $(usex qt5 LRELEASE=$(qt5_get_bindir)/lrelease '')
173 + $(usex qt5 MOC=$(qt5_get_bindir)/moc '')
174 + $(usex qt5 RCC=$(qt5_get_bindir)/rcc '')
175 + $(usex qt5 UIC=$(qt5_get_bindir)/uic '')
176 + -DBUILD_androiddump=$(usex androiddump)
177 + -DBUILD_capinfos=$(usex capinfos)
178 + -DBUILD_captype=$(usex captype)
179 + -DBUILD_ciscodump=$(usex ciscodump)
180 + -DBUILD_dftest=$(usex dftest)
181 + -DBUILD_dpauxmon=$(usex dpauxmon)
182 + -DBUILD_dumpcap=$(usex dumpcap)
183 + -DBUILD_editcap=$(usex editcap)
184 + -DBUILD_mergecap=$(usex mergecap)
185 + -DBUILD_mmdbresolve=$(usex maxminddb)
186 + -DBUILD_randpkt=$(usex randpkt)
187 + -DBUILD_randpktdump=$(usex randpktdump)
188 + -DBUILD_reordercap=$(usex reordercap)
189 + -DBUILD_sdjournal=$(usex sdjournal)
190 + -DBUILD_sharkd=$(usex sharkd)
191 + -DBUILD_sshdump=$(usex sshdump)
192 + -DBUILD_text2pcap=$(usex text2pcap)
193 + -DBUILD_tfshark=$(usex tfshark)
194 + -DBUILD_tshark=$(usex tshark)
195 + -DBUILD_udpdump=$(usex udpdump)
196 + -DBUILD_wireshark=$(usex qt5)
197 + -DDISABLE_WERROR=yes
198 + -DENABLE_BCG729=$(usex bcg729)
199 + -DENABLE_BROTLI=$(usex brotli)
200 + -DENABLE_CAP=$(usex filecaps caps)
201 + -DENABLE_GNUTLS=$(usex ssl)
202 + -DENABLE_ILBC=$(usex ilbc)
203 + -DENABLE_KERBEROS=$(usex kerberos)
204 + -DENABLE_LIBXML2=$(usex libxml2)
205 + -DENABLE_LTO=$(usex lto)
206 + -DENABLE_LUA=$(usex lua)
207 + -DENABLE_LZ4=$(usex lz4)
208 + -DENABLE_MINIZIP=$(usex minizip)
209 + -DENABLE_NETLINK=$(usex netlink)
210 + -DENABLE_NGHTTP2=$(usex http2)
211 + -DENABLE_OPUS=$(usex opus)
212 + -DENABLE_PCAP=$(usex pcap)
213 + -DENABLE_PLUGINS=$(usex plugins)
214 + -DENABLE_PLUGIN_IFDEMO=$(usex plugin-ifdemo)
215 + -DENABLE_SBC=$(usex sbc)
216 + -DENABLE_SMI=$(usex smi)
217 + -DENABLE_SNAPPY=$(usex snappy)
218 + -DENABLE_SPANDSP=$(usex spandsp)
219 + -DENABLE_ZLIB=$(usex zlib)
220 + -DENABLE_ZSTD=$(usex zstd)
221 + )
222 +
223 + cmake_src_configure
224 +}
225 +
226 +src_test() {
227 + cmake_build test-programs
228 +
229 + myctestargs=(
230 + --disable-capture
231 + --skip-missing-programs=all
232 + --verbose
233 + )
234 +
235 + cmake_src_test
236 +}
237 +
238 +src_install() {
239 + cmake_src_install
240 +
241 + # FAQ is not required as is installed from help/faq.txt
242 + dodoc AUTHORS ChangeLog NEWS README* doc/randpkt.txt doc/README*
243 +
244 + # install headers
245 + insinto /usr/include/wireshark
246 + doins ws_diag_control.h ws_symbol_export.h \
247 + "${BUILD_DIR}"/config.h "${BUILD_DIR}"/version.h
248 +
249 + local dir dirs=(
250 + epan
251 + epan/crypt
252 + epan/dfilter
253 + epan/dissectors
254 + epan/ftypes
255 + epan/wmem
256 + wiretap
257 + wsutil
258 + )
259 +
260 + for dir in "${dirs[@]}" ; do
261 + insinto /usr/include/wireshark/${dir}
262 + doins ${dir}/*.h
263 + done
264 +
265 + #with the above this really shouldn't be needed, but things may be looking
266 + # in wiretap/ instead of wireshark/wiretap/
267 + insinto /usr/include/wiretap
268 + doins wiretap/wtap.h
269 +
270 + if use qt5; then
271 + local s
272 + for s in 16 32 48 64 128 256 512 1024; do
273 + insinto /usr/share/icons/hicolor/${s}x${s}/apps
274 + newins image/wsicon${s}.png wireshark.png
275 + done
276 + for s in 16 24 32 48 64 128 256 ; do
277 + insinto /usr/share/icons/hicolor/${s}x${s}/mimetypes
278 + newins image/WiresharkDoc-${s}.png application-vnd.tcpdump.pcap.png
279 + done
280 + fi
281 +
282 + if [[ -d "${ED}"/usr/share/appdata ]]; then
283 + rm -r "${ED}"/usr/share/appdata || die
284 + fi
285 +}
286 +
287 +pkg_postinst() {
288 + xdg_desktop_database_update
289 + xdg_icon_cache_update
290 + xdg_mimeinfo_database_update
291 +
292 + # Add group for users allowed to sniff.
293 + chgrp pcap "${EROOT}"/usr/bin/dumpcap
294 +
295 + if use dumpcap && use pcap; then
296 + fcaps -o 0 -g pcap -m 4710 -M 0710 \
297 + cap_dac_read_search,cap_net_raw,cap_net_admin \
298 + "${EROOT}"/usr/bin/dumpcap
299 + fi
300 +
301 + ewarn "NOTE: To capture traffic with wireshark as normal user you have to"
302 + ewarn "add yourself to the pcap group. This security measure ensures"
303 + ewarn "that only trusted users are allowed to sniff your traffic."
304 +}
305 +
306 +pkg_postrm() {
307 + xdg_desktop_database_update
308 + xdg_icon_cache_update
309 + xdg_mimeinfo_database_update
310 +}