net-vpn/wireguard-tools: make wg-quick(8) optional
authorJason A. Donenfeld <zx2c4@gentoo.org>
Sat, 28 Dec 2019 08:03:27 +0000 (09:03 +0100)
committerJason A. Donenfeld <zx2c4@gentoo.org>
Sat, 28 Dec 2019 08:04:14 +0000 (09:04 +0100)
Closes: https://bugs.gentoo.org/671894
Suggested-by: Aaron Jones <aaronmdjones@gmail.com>
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org>
net-vpn/wireguard-tools/metadata.xml
net-vpn/wireguard-tools/wireguard-tools-1.0.20191226.ebuild
net-vpn/wireguard-tools/wireguard-tools-9999.ebuild

index 915f00227065a9d4a499b0690f4c3d1015297cb5..652da2d16d0cdd24024361d848dc572092cb4753 100644 (file)
@@ -5,4 +5,7 @@
                <email>zx2c4@gentoo.org</email>
                <name>Jason A. Donenfeld</name>
        </maintainer>
+       <use>
+               <flag name="wg-quick">Install the wg-quick(8) helper tool. Most users want to use this.</flag>
+       </use>
 </pkgmetadata>
index 5c75ad1f60b787b005fbcdc2b271b19e066a8049..8a3241a03556faaa17cbba0b5b52f5d788e927d8 100644 (file)
@@ -19,11 +19,15 @@ fi
 
 LICENSE="GPL-2"
 SLOT="0"
+IUSE="+wg-quick"
 
 BDEPEND="virtual/pkgconfig"
 DEPEND="net-libs/libmnl"
 RDEPEND="${DEPEND}
-       || ( net-firewall/nftables net-firewall/iptables )
+       wg-quick? (
+               || ( net-firewall/nftables net-firewall/iptables )
+               virtual/resolvconf
+       )
        !<=net-vpn/wireguard-0.0.20191219
 "
 
@@ -33,6 +37,7 @@ wg_quick_optional_config_nob() {
 }
 
 pkg_setup() {
+       use wg-quick || return 0
        wg_quick_optional_config_nob IP_ADVANCED_ROUTER
        wg_quick_optional_config_nob IP_MULTIPLE_TABLES
        wg_quick_optional_config_nob IPV6_MULTIPLE_TABLES
@@ -67,7 +72,7 @@ src_install() {
        emake \
                WITH_BASHCOMPLETION=yes \
                WITH_SYSTEMDUNITS=yes \
-               WITH_WGQUICK=yes \
+               WITH_WGQUICK=$(usex wg-quick) \
                DESTDIR="${D}" \
                BASHCOMPDIR="$(get_bashcompdir)" \
                SYSTEMDUNITDIR="$(systemd_get_systemunitdir)" \
index 5c75ad1f60b787b005fbcdc2b271b19e066a8049..8a3241a03556faaa17cbba0b5b52f5d788e927d8 100644 (file)
@@ -19,11 +19,15 @@ fi
 
 LICENSE="GPL-2"
 SLOT="0"
+IUSE="+wg-quick"
 
 BDEPEND="virtual/pkgconfig"
 DEPEND="net-libs/libmnl"
 RDEPEND="${DEPEND}
-       || ( net-firewall/nftables net-firewall/iptables )
+       wg-quick? (
+               || ( net-firewall/nftables net-firewall/iptables )
+               virtual/resolvconf
+       )
        !<=net-vpn/wireguard-0.0.20191219
 "
 
@@ -33,6 +37,7 @@ wg_quick_optional_config_nob() {
 }
 
 pkg_setup() {
+       use wg-quick || return 0
        wg_quick_optional_config_nob IP_ADVANCED_ROUTER
        wg_quick_optional_config_nob IP_MULTIPLE_TABLES
        wg_quick_optional_config_nob IPV6_MULTIPLE_TABLES
@@ -67,7 +72,7 @@ src_install() {
        emake \
                WITH_BASHCOMPLETION=yes \
                WITH_SYSTEMDUNITS=yes \
-               WITH_WGQUICK=yes \
+               WITH_WGQUICK=$(usex wg-quick) \
                DESTDIR="${D}" \
                BASHCOMPDIR="$(get_bashcompdir)" \
                SYSTEMDUNITDIR="$(systemd_get_systemunitdir)" \