aboutsummaryrefslogtreecommitdiffstats
path: root/community/wireshark/APKBUILD
blob: b6e53615e0800fbf66005b12009620c89cef9bf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Jeremy Thomerson <jeremy@thomersonfamily.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=wireshark
# 3.3.x is an experimental release for 3.4.x, stay on stable
pkgver=3.4.8
pkgrel=0
pkgdesc="Network protocol analyzer"
url="https://www.wireshark.org"
arch="all !armhf" # blocked by qt5-qtdeclarative
license="GPL-2.0-or-later"
pkggroups="wireshark"
makedepends="
	bash
	bison
	c-ares-dev
	cmake
	flex
	glib
	glib-dev
	gnutls-dev
	libcap-dev
	libgcrypt-dev
	libnl3-dev
	libpcap-dev
	lua5.2-dev
	nghttp2-dev
	pcre-dev
	perl-dev
	portaudio-dev
	qt5-qtbase-dev
	qt5-qtmultimedia-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	"
checkdepends="py3-pytest py3-pytest-xdist"
subpackages="$pkgname-dev $pkgname-doc $pkgname-common tshark"
source="https://www.wireshark.org/download/src/wireshark-$pkgver.tar.xz
	fix-udpdump.patch
	disable-tests.patch
	"

# secfixes:
#   3.4.7-r0:
#     - CVE-2021-22235
#   3.4.6-r0:
#     - CVE-2021-22222
#   3.4.5-r0:
#     - CVE-2021-22207
#   3.4.4-r0:
#     - CVE-2021-22191
#   3.4.3-r0:
#     - CVE-2021-22173
#     - CVE-2021-22174
#   3.4.2-r0:
#     - CVE-2020-26422
#   3.4.1-r0:
#     - CVE-2020-26418
#     - CVE-2020-26419
#     - CVE-2020-26420
#     - CVE-2020-26421
#   3.4.0-r0:
#     - CVE-2020-26575
#     - CVE-2020-28030
#   3.2.7-r0:
#     - CVE-2020-25863
#     - CVE-2020-25862
#     - CVE-2020-25866
#   3.2.6-r0:
#     - CVE-2020-17498
#   3.2.5-r0:
#     - CVE-2020-15466
#   3.2.4-r0:
#     - CVE-2020-13164
#   3.2.3-r0:
#     - CVE-2020-11647
#   3.2.2-r0:
#     - CVE-2020-9428
#     - CVE-2020-9430
#     - CVE-2020-9431
#   3.0.8-r0:
#     - CVE-2020-7045
#   3.0.7-r0:
#     - CVE-2019-19553
#   3.0.4-r0:
#     - CVE-2019-16319
#   3.0.3-r0:
#     - CVE-2019-13619
#   3.0.2-r0:
#     - CVE-2019-12295
#   3.0.1-r0:
#     - CVE-2019-10897
#     - CVE-2019-10898
#     - CVE-2019-10900
#     - CVE-2019-10902
#   2.6.8-r0:
#     - CVE-2019-10894
#     - CVE-2019-10895
#     - CVE-2019-10896
#     - CVE-2019-10899
#     - CVE-2019-10901
#     - CVE-2019-10903
#   2.6.7-r0:
#     - CVE-2019-9208
#     - CVE-2019-9209
#     - CVE-2019-9214
#   2.6.6-r0:
#     - CVE-2019-5717
#     - CVE-2019-5718
#     - CVE-2019-5719
#     - CVE-2019-5721
#   2.6.5-r0:
#     - CVE-2018-19622
#     - CVE-2018-19623
#     - CVE-2018-19624
#     - CVE-2018-19625
#     - CVE-2018-19626
#     - CVE-2018-19627
#     - CVE-2018-19628
#   2.6.4-r0:
#     - CVE-2018-12086
#     - CVE-2018-18225
#     - CVE-2018-18226
#     - CVE-2018-18227
#   2.6.3-r0:
#     - CVE-2018-16056
#     - CVE-2018-16057
#     - CVE-2018-16058
#   2.6.2-r0:
#     - CVE-2018-14339
#     - CVE-2018-14340
#     - CVE-2018-14341
#     - CVE-2018-14342
#     - CVE-2018-14343
#     - CVE-2018-14344
#     - CVE-2018-14367
#     - CVE-2018-14368
#     - CVE-2018-14369
#     - CVE-2018-14370
#   2.4.7-r0:
#     - CVE-2018-11356
#     - CVE-2018-11357
#     - CVE-2018-11358
#     - CVE-2018-11359
#     - CVE-2018-11360
#     - CVE-2018-11362
#   2.4.6-r0:
#     - CVE-2018-9256
#     - CVE-2018-9257
#     - CVE-2018-9258
#     - CVE-2018-9260
#     - CVE-2018-9261
#     - CVE-2018-9262
#     - CVE-2018-9263
#     - CVE-2018-9264
#     - CVE-2018-9267
#     - CVE-2018-10194
#   2.4.5-r0:
#     - CVE-2018-7320
#     - CVE-2018-7321
#     - CVE-2018-7322
#     - CVE-2018-7323
#     - CVE-2018-7324
#     - CVE-2018-7325
#     - CVE-2018-7326
#     - CVE-2018-7327
#     - CVE-2018-7328
#     - CVE-2018-7329
#     - CVE-2018-7330
#     - CVE-2018-7331
#     - CVE-2018-7332
#     - CVE-2018-7333
#     - CVE-2018-7334
#     - CVE-2018-7335
#     - CVE-2018-7336
#     - CVE-2018-7337
#     - CVE-2018-7417
#     - CVE-2018-7418
#     - CVE-2018-7419
#     - CVE-2018-7420
#   2.4.4-r0:
#     - CVE-2018-5334
#     - CVE-2018-5335
#     - CVE-2018-5336
#   2.4.3-r0:
#     - CVE-2017-17083
#     - CVE-2017-17084
#     - CVE-2017-17085
#   2.2.10-r0:
#     - CVE-2017-15191
#     - CVE-2017-15192
#     - CVE-2017-15193
#   2.2.9-r0:
#     - CVE-2017-13765
#     - CVE-2017-13766
#     - CVE-2017-13767
#   2.2.8-r0:
#     - CVE-2017-11406
#     - CVE-2017-11407
#     - CVE-2017-11408
#   2.2.7-r0:
#     - CVE-2017-9343
#     - CVE-2017-9344
#     - CVE-2017-9345
#     - CVE-2017-9346
#     - CVE-2017-9347
#     - CVE-2017-9348
#     - CVE-2017-9349
#     - CVE-2017-9350
#     - CVE-2017-9351
#     - CVE-2017-9352
#     - CVE-2017-9353
#     - CVE-2017-9354
#   2.2.6-r0:
#     - CVE-2017-7700
#     - CVE-2017-7701
#     - CVE-2017-7702
#     - CVE-2017-7703
#     - CVE-2017-7704
#     - CVE-2017-7705
#   2.2.5-r0:
#     - CVE-2017-6467
#     - CVE-2017-6468
#     - CVE-2017-6469
#     - CVE-2017-6470
#     - CVE-2017-6471
#     - CVE-2017-6472
#     - CVE-2017-6473
#     - CVE-2017-6474
#   2.2.4-r1:
#     - CVE-2017-6014
#   2.0.5-r0:
#     - CVE-2016-6505
#     - CVE-2016-6506
#     - CVE-2016-6508
#     - CVE-2016-6509
#     - CVE-2016-6510
#     - CVE-2016-6511
#     - CVE-2016-6512
#     - CVE-2016-6513

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_GNUTLS=ON \
		-DENABLE_LUA=ON
	make -C build
}

check() {
	cd build
	make test-programs
	# Disabled tests 1, 2 fail on armhf
	# See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15771
	# Disabled tests 3-10 fail on s390x
	# See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15772
	py.test-3 ../test/ \
		--deselect test/suite_wslua.py::case_wslua::test_wslua_tvb_tree \
		--deselect test/suite_wslua.py::case_wslua::test_wslua_tvb_no_tree \
		--deselect test/suite_capture.py::case_dumpcap_pcapng_sections::test_dumpcap_pcapng_single_in_multi_out \
		--deselect test/suite_capture.py::case_dumpcap_pcapng_sections::test_dumpcap_pcapng_single_in_single_out \
		--deselect test/suite_capture.py::case_dumpcap_pcapng_sections::test_dumpcap_pcapng_multi_in_single_out \
		--deselect test/suite_capture.py::case_dumpcap_pcapng_sections::test_dumpcap_pcapng_multi_in_multi_out \
		--deselect test/suite_decryption.py::case_decrypt_smb2::test_smb311_bad_key \
		--deselect test/suite_decryption.py::case_decrypt_smb2::test_smb300_aes128ccm \
		--deselect test/suite_decryption.py::case_decrypt_smb2::test_smb300_bad_key \
		--deselect test/suite_decryption.py::case_decrypt_smb2::test_smb311_aes128ccm
}

package() {
	make -C build -j1 DESTDIR="$pkgdir" install

	# Allow users in the wireshark group to capture packages
	# See: https://wiki.wireshark.org/CaptureSetup/CapturePrivileges#Limiting_capture_permission_to_only_one_group
	chmod 0750 "$pkgdir"/usr/bin/dumpcap
	chown root:wireshark "$pkgdir"/usr/bin/dumpcap
	setcap cap_net_raw,cap_net_admin+eip "$pkgdir"/usr/bin/dumpcap

	# Move cmake files to the right location
	mkdir -p $pkgdir/usr/lib/cmake/wireshark
	mv $pkgdir/usr/lib/wireshark/cmake/*.cmake \
		$pkgdir/usr/lib/cmake/wireshark/
}

common() {
	pkgdesc="Network protoccol analyzer (Common files)"
	install="$subpkgname.pre-install $subpkgname.pre-upgrade $subpkgname.post-install"

	mkdir -p "$subpkgdir"/usr/lib "$subpkgdir"/usr/share \
		"$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/share/wireshark "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/lib*/* "$subpkgdir"/usr/lib/

	# Move all bins except wireshark
	local i
	for i in "$pkgdir"/usr/bin/*; do
		case "$i" in
			*/tshark|*/wireshark) continue;;
			*) mv "$i" "$subpkgdir"/usr/bin/
		esac
	done
}

tshark() {
	pkgdesc="Network protoccol analyzer (Console version)"
	install -d "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/tshark "$subpkgdir"/usr/bin/tshark
}

sha512sums="
962ab4d85ca0686c69470a63e516c0e46fbd8f9eb09e1c5f689f37b5c804c6da3e50b96144adc8e2bff6af67e1c9435db54581c8f1ec5908e27e348691bda1c8  wireshark-3.4.8.tar.xz
fb7594ee632174d12ab070a68f2d6070026e3111c164fc5815c03066efe960b31cde801b205087c672782f04aaabedd23979a4fb071db233879a820350a7c9d3  fix-udpdump.patch
3c907a037504d39a56766db37eecc9d5f968fdcb90c431e099b3f77e4ffc52fb65cb6c3896406aa939a846d526daf5676693ae5c2ff933e1d878e39ac074417a  disable-tests.patch
"