sys-apps/net-tools: add USE flags to control arp/hostname/nis/plipconfig/slattach...
authorMike Frysinger <vapier@gentoo.org>
Tue, 24 Nov 2015 21:14:54 +0000 (16:14 -0500)
committerMike Frysinger <vapier@gentoo.org>
Tue, 24 Nov 2015 22:01:27 +0000 (17:01 -0500)
Default the old crufty stuff to off (parallel port, serial port, and
NIS/YP).

sys-apps/net-tools/metadata.xml
sys-apps/net-tools/net-tools-1.60_p20151124144947.ebuild
sys-apps/net-tools/net-tools-9999.ebuild

index cd6f2273ff86915f0301130f45ca5860d1b37646..8ba2926c8a7902b66149af61a8f029caf1ce2254 100644 (file)
@@ -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>
index 40970a43c2e1a64422cfbff8a70542c17b93c592..059a1aaef1adbbeb33705a6e7f42c4e46886c21f 100644 (file)
@@ -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
+}
index 40970a43c2e1a64422cfbff8a70542c17b93c592..059a1aaef1adbbeb33705a6e7f42c4e46886c21f 100644 (file)
@@ -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
+}