aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--community/wireshark/APKBUILD12
-rw-r--r--community/wireshark/wireshark.pre-install4
l---------community/wireshark/wireshark.pre-upgrade1
3 files changed, 15 insertions, 2 deletions
diff --git a/community/wireshark/APKBUILD b/community/wireshark/APKBUILD
index 1467103840..65347889fa 100644
--- a/community/wireshark/APKBUILD
+++ b/community/wireshark/APKBUILD
@@ -4,17 +4,19 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=wireshark
pkgver=3.0.7
-pkgrel=1
+pkgrel=2
pkgdesc="A network protocol analyzer"
url="https://www.wireshark.org"
arch="all"
license="GPL-2.0-or-later"
makedepends="bash bison c-ares-dev cmake flex glib glib-dev gnutls-dev
- libcap-dev libgcrypt-dev libnl3-dev libpcap-dev
+ libcap-dev libgcrypt-dev libnl3-dev libcap libpcap-dev
lua5.2-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"
+pkggroups="wireshark"
+install="$pkgname.pre-install $pkgname.pre-upgrade"
# Use mirror in the meantime
# source="https://www.wireshark.org/download/src/wireshark-$pkgver.tar.xz
source="https://1.as.dl.wireshark.org/src/wireshark-$pkgver.tar.xz
@@ -220,6 +222,12 @@ check() {
package() {
make -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
}
common() {
diff --git a/community/wireshark/wireshark.pre-install b/community/wireshark/wireshark.pre-install
new file mode 100644
index 0000000000..e9022d09cc
--- /dev/null
+++ b/community/wireshark/wireshark.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+addgroup -S wireshark 2>/dev/null
+exit 0
diff --git a/community/wireshark/wireshark.pre-upgrade b/community/wireshark/wireshark.pre-upgrade
new file mode 120000
index 0000000000..a2ff63bc76
--- /dev/null
+++ b/community/wireshark/wireshark.pre-upgrade
@@ -0,0 +1 @@
+wireshark.pre-install \ No newline at end of file