commit:     d7a0661fc8c35f383eda3c00a9b9ecb39d6817b6
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 24 09:59:51 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Oct 24 09:59:51 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7a0661f

net-analyzer/tcpdump: Port to GLEP 81 'pcap' group/user

Closes: https://bugs.gentoo.org/314463
Closes: https://github.com/gentoo/gentoo/pull/18015
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-analyzer/tcpdump/metadata.xml                  |  2 +-
 ...0.0_rc1.ebuild => tcpdump-4.10.0_rc1-r1.ebuild} | 32 +++++++++-------------
 ...cpdump-4.9.3.ebuild => tcpdump-4.9.3-r2.ebuild} | 32 +++++++++-------------
 ...ump-4.9.3-r1.ebuild => tcpdump-4.9.3-r3.ebuild} | 32 +++++++++-------------
 net-analyzer/tcpdump/tcpdump-9999.ebuild           | 32 +++++++++-------------
 5 files changed, 53 insertions(+), 77 deletions(-)

diff --git a/net-analyzer/tcpdump/metadata.xml 
b/net-analyzer/tcpdump/metadata.xml
index 926985b6a8c..cacdf5c6298 100644
--- a/net-analyzer/tcpdump/metadata.xml
+++ b/net-analyzer/tcpdump/metadata.xml
@@ -7,7 +7,7 @@
        </maintainer>
        <use>
                <flag name="smi">Build with <pkg>net-libs/libsmi</pkg> to load 
MIBs on the fly to decode SNMP packets</flag>
-               <flag name="drop-root">Drop privileges to tcpdump:tcpdump when 
run as root</flag>
+               <flag name="drop-root">Drop privileges to pcap:pcap when run as 
root</flag>
        </use>
        <upstream>
                <remote-id type="cpe">cpe:/a:tcpdump:tcpdump</remote-id>

diff --git a/net-analyzer/tcpdump/tcpdump-4.10.0_rc1.ebuild 
b/net-analyzer/tcpdump/tcpdump-4.10.0_rc1-r1.ebuild
similarity index 77%
rename from net-analyzer/tcpdump/tcpdump-4.10.0_rc1.ebuild
rename to net-analyzer/tcpdump/tcpdump-4.10.0_rc1-r1.ebuild
index c2cf8713eac..aa6aa458165 100644
--- a/net-analyzer/tcpdump/tcpdump-4.10.0_rc1.ebuild
+++ b/net-analyzer/tcpdump/tcpdump-4.10.0_rc1-r1.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit autotools user
+inherit autotools
 
 DESCRIPTION="A Tool for network monitoring and data acquisition"
 HOMEPAGE="
@@ -22,12 +22,20 @@ REQUIRED_USE="test? ( samba )"
 
 RDEPEND="
        net-libs/libpcap
-       drop-root? ( sys-libs/libcap-ng )
+       drop-root? (
+               acct-group/pcap
+               acct-user/pcap
+               sys-libs/libcap-ng
+       )
        smi? ( net-libs/libsmi )
        ssl? (
                !libressl? ( >=dev-libs/openssl-0.9.6m:0= )
                libressl? ( dev-libs/libressl:= )
        )
+       suid? (
+               acct-group/pcap
+               acct-user/pcap
+       )
 "
 BDEPEND="
        drop-root? ( virtual/pkgconfig )
@@ -44,13 +52,6 @@ PATCHES=(
 )
 S=${WORKDIR}/${PN}-${P/_}
 
-pkg_setup() {
-       if use drop-root || use suid; then
-               enewgroup tcpdump
-               enewuser tcpdump -1 -1 -1 tcpdump
-       fi
-}
-
 src_prepare() {
        default
 
@@ -64,7 +65,7 @@ src_configure() {
                $(use_with drop-root chroot '') \
                $(use_with smi) \
                $(use_with ssl crypto "${ESYSROOT}/usr") \
-               $(usex drop-root "--with-user=tcpdump" "")
+               $(usex drop-root "--with-user=pcap" "")
 }
 
 src_test() {
@@ -83,18 +84,11 @@ src_install() {
        dodoc CHANGES CREDITS README.md
 
        if use suid; then
-               fowners root:tcpdump /usr/sbin/tcpdump
+               fowners root:pcap /usr/sbin/tcpdump
                fperms 4110 /usr/sbin/tcpdump
        fi
 }
 
-pkg_preinst() {
-       if use drop-root || use suid; then
-               enewgroup tcpdump
-               enewuser tcpdump -1 -1 -1 tcpdump
-       fi
-}
-
 pkg_postinst() {
-       use suid && elog "To let normal users run tcpdump add them into tcpdump 
group."
+       use suid && elog "To let normal users run tcpdump add them to the pcap 
group."
 }

diff --git a/net-analyzer/tcpdump/tcpdump-4.9.3.ebuild 
b/net-analyzer/tcpdump/tcpdump-4.9.3-r2.ebuild
similarity index 75%
rename from net-analyzer/tcpdump/tcpdump-4.9.3.ebuild
rename to net-analyzer/tcpdump/tcpdump-4.9.3-r2.ebuild
index 3731233ad94..e4c232ea119 100644
--- a/net-analyzer/tcpdump/tcpdump-4.9.3.ebuild
+++ b/net-analyzer/tcpdump/tcpdump-4.9.3-r2.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit flag-o-matic toolchain-funcs user
+inherit flag-o-matic toolchain-funcs
 
 DESCRIPTION="A Tool for network monitoring and data acquisition"
 HOMEPAGE="
@@ -20,13 +20,21 @@ IUSE="+drop-root libressl smi ssl samba suid test"
 RESTRICT="!test? ( test )"
 
 RDEPEND="
-       drop-root? ( sys-libs/libcap-ng )
+       drop-root? (
+               acct-group/pcap
+               acct-user/pcap
+               sys-libs/libcap-ng
+       )
        net-libs/libpcap
        smi? ( net-libs/libsmi )
        ssl? (
                !libressl? ( >=dev-libs/openssl-0.9.6m:0= )
                libressl? ( dev-libs/libressl:= )
        )
+       suid? (
+               acct-group/pcap
+               acct-user/pcap
+       )
 "
 DEPEND="
        ${RDEPEND}
@@ -38,13 +46,6 @@ DEPEND="
        )
 "
 
-pkg_setup() {
-       if use drop-root || use suid; then
-               enewgroup tcpdump
-               enewuser tcpdump -1 -1 -1 tcpdump
-       fi
-}
-
 src_configure() {
        if use drop-root; then
                append-cppflags -DHAVE_CAP_NG_H
@@ -56,7 +57,7 @@ src_configure() {
                $(use_with drop-root chroot '') \
                $(use_with smi) \
                $(use_with ssl crypto "${ESYSROOT}/usr") \
-               $(usex drop-root "--with-user=tcpdump" "")
+               $(usex drop-root "--with-user=pcap" "")
 }
 
 src_test() {
@@ -75,18 +76,11 @@ src_install() {
        dodoc CHANGES CREDITS README.md
 
        if use suid; then
-               fowners root:tcpdump /usr/sbin/tcpdump
+               fowners root:pcap /usr/sbin/tcpdump
                fperms 4110 /usr/sbin/tcpdump
        fi
 }
 
-pkg_preinst() {
-       if use drop-root || use suid; then
-               enewgroup tcpdump
-               enewuser tcpdump -1 -1 -1 tcpdump
-       fi
-}
-
 pkg_postinst() {
-       use suid && elog "To let normal users run tcpdump add them into tcpdump 
group."
+       use suid && elog "To let normal users run tcpdump add them to the pcap 
group."
 }

diff --git a/net-analyzer/tcpdump/tcpdump-4.9.3-r1.ebuild 
b/net-analyzer/tcpdump/tcpdump-4.9.3-r3.ebuild
similarity index 75%
rename from net-analyzer/tcpdump/tcpdump-4.9.3-r1.ebuild
rename to net-analyzer/tcpdump/tcpdump-4.9.3-r3.ebuild
index e23d799be4b..b348a3434e1 100644
--- a/net-analyzer/tcpdump/tcpdump-4.9.3-r1.ebuild
+++ b/net-analyzer/tcpdump/tcpdump-4.9.3-r3.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit autotools user
+inherit autotools
 
 DESCRIPTION="A Tool for network monitoring and data acquisition"
 HOMEPAGE="
@@ -21,12 +21,20 @@ RESTRICT="!test? ( test )"
 
 RDEPEND="
        net-libs/libpcap
-       drop-root? ( sys-libs/libcap-ng )
+       drop-root? (
+               acct-group/pcap
+               acct-user/pcap
+               sys-libs/libcap-ng
+       )
        smi? ( net-libs/libsmi )
        ssl? (
                !libressl? ( >=dev-libs/openssl-0.9.6m:0= )
                libressl? ( dev-libs/libressl:= )
        )
+       suid? (
+               acct-group/pcap
+               acct-user/pcap
+       )
 "
 DEPEND="
        ${RDEPEND}
@@ -39,13 +47,6 @@ PATCHES=(
        "${FILESDIR}"/${PN}-9999-libdir.patch
 )
 
-pkg_setup() {
-       if use drop-root || use suid; then
-               enewgroup tcpdump
-               enewuser tcpdump -1 -1 -1 tcpdump
-       fi
-}
-
 src_prepare() {
        default
        eautoreconf
@@ -58,7 +59,7 @@ src_configure() {
                $(use_with drop-root chroot '') \
                $(use_with smi) \
                $(use_with ssl crypto "${ESYSROOT}/usr") \
-               $(usex drop-root "--with-user=tcpdump" "")
+               $(usex drop-root "--with-user=pcap" "")
 }
 
 src_test() {
@@ -77,18 +78,11 @@ src_install() {
        dodoc CHANGES CREDITS README.md
 
        if use suid; then
-               fowners root:tcpdump /usr/sbin/tcpdump
+               fowners root:pcap /usr/sbin/tcpdump
                fperms 4110 /usr/sbin/tcpdump
        fi
 }
 
-pkg_preinst() {
-       if use drop-root || use suid; then
-               enewgroup tcpdump
-               enewuser tcpdump -1 -1 -1 tcpdump
-       fi
-}
-
 pkg_postinst() {
-       use suid && elog "To let normal users run tcpdump add them into tcpdump 
group."
+       use suid && elog "To let normal users run tcpdump add them to the pcap 
group."
 }

diff --git a/net-analyzer/tcpdump/tcpdump-9999.ebuild 
b/net-analyzer/tcpdump/tcpdump-9999.ebuild
index 8352b63b1cc..6f074f38fb2 100644
--- a/net-analyzer/tcpdump/tcpdump-9999.ebuild
+++ b/net-analyzer/tcpdump/tcpdump-9999.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit autotools git-r3 user
+inherit autotools git-r3
 
 DESCRIPTION="A Tool for network monitoring and data acquisition"
 HOMEPAGE="
@@ -20,12 +20,20 @@ REQUIRED_USE="test? ( samba )"
 
 RDEPEND="
        net-libs/libpcap
-       drop-root? ( sys-libs/libcap-ng )
+       drop-root? (
+               acct-group/pcap
+               acct-user/pcap
+               sys-libs/libcap-ng
+       )
        smi? ( net-libs/libsmi )
        ssl? (
                !libressl? ( >=dev-libs/openssl-0.9.6m:0= )
                libressl? ( dev-libs/libressl:= )
        )
+       suid? (
+               acct-group/pcap
+               acct-user/pcap
+       )
 "
 BDEPEND="
        drop-root? ( virtual/pkgconfig )
@@ -41,13 +49,6 @@ PATCHES=(
        "${FILESDIR}"/${PN}-9999-libdir.patch
 )
 
-pkg_setup() {
-       if use drop-root || use suid; then
-               enewgroup tcpdump
-               enewuser tcpdump -1 -1 -1 tcpdump
-       fi
-}
-
 src_prepare() {
        default
 
@@ -61,7 +62,7 @@ src_configure() {
                $(use_with drop-root chroot '') \
                $(use_with smi) \
                $(use_with ssl crypto "${ESYSROOT}/usr") \
-               $(usex drop-root "--with-user=tcpdump" "")
+               $(usex drop-root "--with-user=pcap" "")
 }
 
 src_test() {
@@ -80,18 +81,11 @@ src_install() {
        dodoc CHANGES CREDITS README.md
 
        if use suid; then
-               fowners root:tcpdump /usr/sbin/tcpdump
+               fowners root:pcap /usr/sbin/tcpdump
                fperms 4110 /usr/sbin/tcpdump
        fi
 }
 
-pkg_preinst() {
-       if use drop-root || use suid; then
-               enewgroup tcpdump
-               enewuser tcpdump -1 -1 -1 tcpdump
-       fi
-}
-
 pkg_postinst() {
-       use suid && elog "To let normal users run tcpdump add them into tcpdump 
group."
+       use suid && elog "To let normal users run tcpdump add them to the pcap 
group."
 }

Reply via email to