commit:     c0379432b1fe95cf29150ba25b60113b3649aa35
Author:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 26 16:40:15 2019 +0000
Commit:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Thu Dec 26 16:47:16 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0379432

net-vpn/wireguard-tools: add missing info from monolithic ebuild

Package-Manager: Portage-2.3.83, Repoman-2.3.20
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org>

 .../wireguard-tools-1.0.20191226.ebuild            | 40 +++++++++++++++++++++-
 .../wireguard-tools/wireguard-tools-9999.ebuild    | 40 +++++++++++++++++++++-
 2 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/net-vpn/wireguard-tools/wireguard-tools-1.0.20191226.ebuild 
b/net-vpn/wireguard-tools/wireguard-tools-1.0.20191226.ebuild
index db33e8d6af8..700f6f9b03e 100644
--- a/net-vpn/wireguard-tools/wireguard-tools-1.0.20191226.ebuild
+++ b/net-vpn/wireguard-tools/wireguard-tools-1.0.20191226.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-inherit bash-completion-r1
+inherit linux-mod bash-completion-r1
 
 DESCRIPTION="Required tools for WireGuard, such as wg(8) and wg-quick(8)"
 HOMEPAGE="https://www.wireguard.com/";
@@ -26,6 +26,21 @@ RDEPEND="${DEPEND}
        !<=net-vpn/wireguard-0.0.20191219
 "
 
+wg_quick_optional_config_nob() {
+       CONFIG_CHECK="$CONFIG_CHECK ~$1"
+       declare -g ERROR_$1="CONFIG_$1: This option is required for automatic 
routing of default routes inside of wg-quick(8), though it is not required for 
general WireGuard usage."
+}
+
+pkg_setup() {
+       wg_quick_optional_config_nob IP_ADVANCED_ROUTER
+       wg_quick_optional_config_nob IP_MULTIPLE_TABLES
+       wg_quick_optional_config_nob NETFILTER_XT_MARK
+       wg_quick_optional_config_nob NETFILTER_XT_CONNMARK
+       wg_quick_optional_config_nob IP6_NF_RAW
+       wg_quick_optional_config_nob IP_NF_RAW
+       linux-mod_pkg_setup
+}
+
 src_compile() {
        emake RUNSTATEDIR="${EPREFIX}/run" -C src CC="$(tc-getCC)" 
LD="$(tc-getLD)"
 }
@@ -42,3 +57,26 @@ src_install() {
                PREFIX="${EPREFIX}/usr" \
                -C src install
 }
+
+pkg_postinst() {
+       einfo
+       einfo "After installing WireGuard, if you'd like to try sending some 
packets through"
+       einfo "WireGuard, you may use, for testing purposes only, the insecure 
client.sh"
+       einfo "test example script:"
+       einfo
+       einfo "  \$ bzcat 
${ROOT}usr/share/doc/${PF}/contrib/ncat-client-server/client.sh.bz2 | sudo bash 
-"
+       einfo
+       einfo "This will automatically setup interface wg0, through a very 
insecure transport"
+       einfo "that is only suitable for demonstration purposes. You can then 
try loading the"
+       einfo "hidden website or sending pings:"
+       einfo
+       einfo "  \$ chromium http://192.168.4.1";
+       einfo "  \$ ping 192.168.4.1"
+       einfo
+       einfo "If you'd like to redirect your internet traffic, you can run it 
with the"
+       einfo "\"default-route\" argument. You may not use this server for any 
abusive or illegal"
+       einfo "purposes. It is for quick testing only."
+       einfo
+       einfo "More info on getting started can be found at: 
https://www.wireguard.com/quickstart/";
+       einfo
+}

diff --git a/net-vpn/wireguard-tools/wireguard-tools-9999.ebuild 
b/net-vpn/wireguard-tools/wireguard-tools-9999.ebuild
index db33e8d6af8..700f6f9b03e 100644
--- a/net-vpn/wireguard-tools/wireguard-tools-9999.ebuild
+++ b/net-vpn/wireguard-tools/wireguard-tools-9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-inherit bash-completion-r1
+inherit linux-mod bash-completion-r1
 
 DESCRIPTION="Required tools for WireGuard, such as wg(8) and wg-quick(8)"
 HOMEPAGE="https://www.wireguard.com/";
@@ -26,6 +26,21 @@ RDEPEND="${DEPEND}
        !<=net-vpn/wireguard-0.0.20191219
 "
 
+wg_quick_optional_config_nob() {
+       CONFIG_CHECK="$CONFIG_CHECK ~$1"
+       declare -g ERROR_$1="CONFIG_$1: This option is required for automatic 
routing of default routes inside of wg-quick(8), though it is not required for 
general WireGuard usage."
+}
+
+pkg_setup() {
+       wg_quick_optional_config_nob IP_ADVANCED_ROUTER
+       wg_quick_optional_config_nob IP_MULTIPLE_TABLES
+       wg_quick_optional_config_nob NETFILTER_XT_MARK
+       wg_quick_optional_config_nob NETFILTER_XT_CONNMARK
+       wg_quick_optional_config_nob IP6_NF_RAW
+       wg_quick_optional_config_nob IP_NF_RAW
+       linux-mod_pkg_setup
+}
+
 src_compile() {
        emake RUNSTATEDIR="${EPREFIX}/run" -C src CC="$(tc-getCC)" 
LD="$(tc-getLD)"
 }
@@ -42,3 +57,26 @@ src_install() {
                PREFIX="${EPREFIX}/usr" \
                -C src install
 }
+
+pkg_postinst() {
+       einfo
+       einfo "After installing WireGuard, if you'd like to try sending some 
packets through"
+       einfo "WireGuard, you may use, for testing purposes only, the insecure 
client.sh"
+       einfo "test example script:"
+       einfo
+       einfo "  \$ bzcat 
${ROOT}usr/share/doc/${PF}/contrib/ncat-client-server/client.sh.bz2 | sudo bash 
-"
+       einfo
+       einfo "This will automatically setup interface wg0, through a very 
insecure transport"
+       einfo "that is only suitable for demonstration purposes. You can then 
try loading the"
+       einfo "hidden website or sending pings:"
+       einfo
+       einfo "  \$ chromium http://192.168.4.1";
+       einfo "  \$ ping 192.168.4.1"
+       einfo
+       einfo "If you'd like to redirect your internet traffic, you can run it 
with the"
+       einfo "\"default-route\" argument. You may not use this server for any 
abusive or illegal"
+       einfo "purposes. It is for quick testing only."
+       einfo
+       einfo "More info on getting started can be found at: 
https://www.wireguard.com/quickstart/";
+       einfo
+}

Reply via email to