From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A3D271382C5 for ; Mon, 15 Mar 2021 23:35:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D577BE0841; Mon, 15 Mar 2021 23:35:03 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1E633E0848 for ; Mon, 15 Mar 2021 23:35:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0A840340F59 for ; Mon, 15 Mar 2021 23:35:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9F0D7597 for ; Mon, 15 Mar 2021 23:35:00 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1615851130.75bf552a579f71ee671e10fab2c322d8084fab16.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/netselect/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-analyzer/netselect/netselect-0.4-r2.ebuild X-VCS-Directories: net-analyzer/netselect/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 75bf552a579f71ee671e10fab2c322d8084fab16 X-VCS-Branch: master Date: Mon, 15 Mar 2021 23:35:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 45410834-038c-49eb-b345-7ddea5c05dfd X-Archives-Hash: 7b00493ca96dccf5e12a202f2e1fff80 commit: 75bf552a579f71ee671e10fab2c322d8084fab16 Author: Peter Levine gmail com> AuthorDate: Wed Oct 23 19:13:46 2019 +0000 Commit: Sam James gentoo org> CommitDate: Mon Mar 15 23:32:10 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75bf552a 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 gmail.com> Signed-off-by: Sam James gentoo.org> net-analyzer/netselect/netselect-0.4-r2.ebuild | 19 +++++++++++++------ 1 file 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 8ac47519b25..e887b8335a1 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 +}