commit: 733183e990df8ca3ab8d72a0fc8bf24b6c4b3d04
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 24 21:14:54 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Nov 24 22:01:27 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=733183e9
sys-apps/net-tools: add USE flags to control
arp/hostname/nis/plipconfig/slattach programs #128538
Default the old crufty stuff to off (parallel port, serial port, and
NIS/YP).
sys-apps/net-tools/metadata.xml | 4 +++
.../net-tools-1.60_p20151124144947.ebuild | 36 ++++++++++++++++++++--
sys-apps/net-tools/net-tools-9999.ebuild | 36 ++++++++++++++++++++--
3 files changed, 70 insertions(+), 6 deletions(-)
diff --git a/sys-apps/net-tools/metadata.xml b/sys-apps/net-tools/metadata.xml
index cd6f227..8ba2926 100644
--- a/sys-apps/net-tools/metadata.xml
+++ b/sys-apps/net-tools/metadata.xml
@@ -3,7 +3,11 @@
<pkgmetadata>
<herd>base-system</herd>
<use>
+ <flag name='arp'>build the arp and rarp tools (for manipulating the ARP
cache)</flag>
+ <flag name='hostname'>build the hostname and dnsdomainname tools</flag>
<flag name='old-output'>use old ifconfig output style (useful for when
new output breaks scripts)</flag>
+ <flag name='plipconfig'>build the plipconfig tool (for working with old
PLIP hardware)</flag>
+ <flag name='slattach'>build the slattach tool (for working with old
serial ports)</flag>
</use>
<upstream>
<remote-id type='sourceforge'>net-tools</remote-id>
diff --git a/sys-apps/net-tools/net-tools-1.60_p20151124144947.ebuild
b/sys-apps/net-tools/net-tools-1.60_p20151124144947.ebuild
index 40970a4..059a1aa 100644
--- a/sys-apps/net-tools/net-tools-1.60_p20151124144947.ebuild
+++ b/sys-apps/net-tools/net-tools-1.60_p20151124144947.ebuild
@@ -19,16 +19,18 @@ HOMEPAGE="http://net-tools.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
-IUSE="ipv6 nls selinux static"
+IUSE="+arp +hostname ipv6 nis nls plipconfig selinux slattach static"
-RDEPEND="!<sys-apps/openrc-0.9.9.3
- selinux? ( sys-libs/libselinux )"
+RDEPEND="selinux? ( sys-libs/libselinux )"
DEPEND="${RDEPEND}
selinux? ( virtual/pkgconfig )
app-arch/xz-utils"
if [[ ${PV} == "9999" ]]; then
DEPEND+=" nls? ( sys-devel/gettext )"
fi
+RDEPEND+="
+ hostname? ( !sys-apps/coreutils[hostname] )
+ !<sys-apps/openrc-0.9.9.3"
maint_pkg_create() {
cd /usr/local/src/net-tools
@@ -72,3 +74,31 @@ src_configure() {
tc-export AR CC
yes "" | ./configure.sh config.in || die
}
+
+src_install() {
+ default
+
+ # TODO: Make these into config knobs upstream.
+ if ! use arp ; then
+ rm "${ED}"/sbin/{,r}arp "${ED}"/usr/share/man/man8/{,r}arp.8*
|| die
+ fi
+ if ! use hostname ; then
+ if use nis ; then
+ # Since all the tools are symlinks, repoint them.
+ rm "${ED}"/bin/domainname || die
+ cp -p "${ED}"/bin/{host,domain}name || die
+ dosym domainname /bin/nisdomainname
+ dosym domainname /bin/ypdomainname
+ fi
+ rm "${ED}"/bin/{host,dnsdomain}name
"${ED}"/usr/share/man/man1/{host,dnsdomain}name.1* || die
+ fi
+ if ! use nis ; then
+ rm "${ED}"/bin/{,nis,yp}domainname
"${ED}"/usr/share/man/man1/{,nis,yp}domainname.1* || die
+ fi
+ if ! use plipconfig ; then
+ rm "${ED}"/sbin/plipconfig
"${ED}"/usr/share/man/man8/plipconfig.8* || die
+ fi
+ if ! use slattach ; then
+ rm "${ED}"/sbin/slattach "${ED}"/usr/share/man/man8/slattach.8*
|| die
+ fi
+}
diff --git a/sys-apps/net-tools/net-tools-9999.ebuild
b/sys-apps/net-tools/net-tools-9999.ebuild
index 40970a4..059a1aa 100644
--- a/sys-apps/net-tools/net-tools-9999.ebuild
+++ b/sys-apps/net-tools/net-tools-9999.ebuild
@@ -19,16 +19,18 @@ HOMEPAGE="http://net-tools.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
-IUSE="ipv6 nls selinux static"
+IUSE="+arp +hostname ipv6 nis nls plipconfig selinux slattach static"
-RDEPEND="!<sys-apps/openrc-0.9.9.3
- selinux? ( sys-libs/libselinux )"
+RDEPEND="selinux? ( sys-libs/libselinux )"
DEPEND="${RDEPEND}
selinux? ( virtual/pkgconfig )
app-arch/xz-utils"
if [[ ${PV} == "9999" ]]; then
DEPEND+=" nls? ( sys-devel/gettext )"
fi
+RDEPEND+="
+ hostname? ( !sys-apps/coreutils[hostname] )
+ !<sys-apps/openrc-0.9.9.3"
maint_pkg_create() {
cd /usr/local/src/net-tools
@@ -72,3 +74,31 @@ src_configure() {
tc-export AR CC
yes "" | ./configure.sh config.in || die
}
+
+src_install() {
+ default
+
+ # TODO: Make these into config knobs upstream.
+ if ! use arp ; then
+ rm "${ED}"/sbin/{,r}arp "${ED}"/usr/share/man/man8/{,r}arp.8*
|| die
+ fi
+ if ! use hostname ; then
+ if use nis ; then
+ # Since all the tools are symlinks, repoint them.
+ rm "${ED}"/bin/domainname || die
+ cp -p "${ED}"/bin/{host,domain}name || die
+ dosym domainname /bin/nisdomainname
+ dosym domainname /bin/ypdomainname
+ fi
+ rm "${ED}"/bin/{host,dnsdomain}name
"${ED}"/usr/share/man/man1/{host,dnsdomain}name.1* || die
+ fi
+ if ! use nis ; then
+ rm "${ED}"/bin/{,nis,yp}domainname
"${ED}"/usr/share/man/man1/{,nis,yp}domainname.1* || die
+ fi
+ if ! use plipconfig ; then
+ rm "${ED}"/sbin/plipconfig
"${ED}"/usr/share/man/man8/plipconfig.8* || die
+ fi
+ if ! use slattach ; then
+ rm "${ED}"/sbin/slattach "${ED}"/usr/share/man/man8/slattach.8*
|| die
+ fi
+}