summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Levine <plevine457@gmail.com>2019-10-23 15:13:46 -0400
committerSam James <sam@gentoo.org>2021-03-15 23:32:10 +0000
commit75bf552a579f71ee671e10fab2c322d8084fab16 (patch)
treed08fb0ec6aad4737f9eded57eb025de344721570 /net-analyzer/netselect
parentnet-analyzer/netselect: Bump EAPI to 7 (diff)
downloadgentoo-75bf552a579f71ee671e10fab2c322d8084fab16.tar.gz
gentoo-75bf552a579f71ee671e10fab2c322d8084fab16.tar.bz2
gentoo-75bf552a579f71ee671e10fab2c322d8084fab16.zip
net-analyzer/netselect: Add filecaps support
Closes: https://bugs.gentoo.org/564902 Closes: https://github.com/gentoo/gentoo/pull/13388 Package-Manager: Portage-2.3.78, Repoman-2.3.17 Signed-off-by: Peter Levine <plevine457@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-analyzer/netselect')
-rw-r--r--net-analyzer/netselect/netselect-0.4-r2.ebuild19
1 files changed, 13 insertions, 6 deletions
diff --git a/net-analyzer/netselect/netselect-0.4-r2.ebuild b/net-analyzer/netselect/netselect-0.4-r2.ebuild
index 8ac47519b250..e887b8335a1a 100644
--- a/net-analyzer/netselect/netselect-0.4-r2.ebuild
+++ b/net-analyzer/netselect/netselect-0.4-r2.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-inherit toolchain-funcs
+inherit fcaps toolchain-funcs
DESCRIPTION="Ultrafast implementation of ping"
HOMEPAGE="http://apenwarr.ca/netselect/"
@@ -23,12 +23,20 @@ PATCHES=(
DOCS=( HISTORY README )
+FILECAPS=( -g wheel cap_net_raw /usr/bin/netselect )
+
S=${WORKDIR}/${PN}-${P}
src_prepare() {
use ipv6 && eapply "${WORKDIR}"/${PN}-0.4-ipv6.patch
default
+
+ # Don't warn about "root privileges required" when running as
+ # an unprivileged user with filecaps
+ if ! use prefix && use filecaps; then
+ sed -i -e '/if (geteuid () != 0)/,+2d' "${S}"/netselect.c || die
+ fi
}
src_compile() {
@@ -38,12 +46,11 @@ src_compile() {
src_install() {
dobin netselect
- if ! use prefix ; then
- fowners root:wheel /usr/bin/netselect
- fperms 4711 /usr/bin/netselect
- fi
-
einstalldocs
doman netselect.1
}
+
+pkg_postinst() {
+ ! use prefix && fcaps_pkg_postinst
+}