summaryrefslogtreecommitdiff
path: root/net-vpn/wireguard-tools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
commit3cf7c3ef441822c889356fd1812ebf2944a59851 (patch)
treec513fe68548b40365c1c2ebfe35c58ad431cdd77 /net-vpn/wireguard-tools
parent05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff)
gentoo resync : 25.08.2020
Diffstat (limited to 'net-vpn/wireguard-tools')
-rw-r--r--net-vpn/wireguard-tools/Manifest7
-rw-r--r--net-vpn/wireguard-tools/files/wg-quick.init38
-rw-r--r--net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild63
-rw-r--r--net-vpn/wireguard-tools/wireguard-tools-1.0.20200820.ebuild (renamed from net-vpn/wireguard-tools/wireguard-tools-1.0.20200319.ebuild)65
4 files changed, 121 insertions, 52 deletions
diff --git a/net-vpn/wireguard-tools/Manifest b/net-vpn/wireguard-tools/Manifest
index e7ae98cc4150..3ac1bb90313b 100644
--- a/net-vpn/wireguard-tools/Manifest
+++ b/net-vpn/wireguard-tools/Manifest
@@ -1,5 +1,6 @@
-DIST wireguard-tools-1.0.20200319.tar.xz 92324 BLAKE2B 9f514748708ef6a5b7f5b043c9054c954d17bb77de7a354b5a9a4e63cfb5f441237e98b16b288426441a7e709e1874d396cf67b04b38bb0ebbe7822bb32ada57 SHA512 d5bcd153f9b10f184b9a1bf9a81f33a9713ab4863ab5aa190eac60e92919756c8fecbb0d3cfb83bae20ac78fc43fdd7168f37294cdd7c5ee21f2a1b2db5fdf41
+AUX wg-quick.init 885 BLAKE2B 440224b688b1a1b4762bac7ac3bd6cb6fbee546543f1da70fcf5ee1c6d213ff62c43d502fd88d1778913455cc233b6419b3176690b471a71aaf2792671045eee SHA512 3de3edb359a786bdb8de06f496caced1293048c2ec489073c0525b4eca61365424ffde6a7eb899d7672db38872b6c67436b2e39019e92300ca5e590ba02c2e84
DIST wireguard-tools-1.0.20200513.tar.xz 94500 BLAKE2B 34a39533018416df382d180da76d6494feec1d40208c9df427c1979817dbe138c217fe4c4f4cf5cecd3c4053e6f73f1863d1e0a9ed2cad41899dda5387c15844 SHA512 4d27b262350b6b47843a323c2e7ab8d2bdd48065c265778abdec85b3f6fc92aa9af77d76e368df9cc8e435eae1c0ce50fed52e1d78db54358c1884d34be08d2c
-EBUILD wireguard-tools-1.0.20200319.ebuild 3272 BLAKE2B 800f2ec75e42ac5adb2ef8ffd0403ebd448e19f27609e6d9883d252743e838bd3a017ef86561d4aa8c82e0e67ec7f3b5d3c543ca100f495935bdb6d45faebe25 SHA512 714e11822d0854acb7eb86db716266cd53ff0ae8eb713c962b2aacaaa35b72dcca5ed03562c1a858e6cb204ae85ab25a9097f0db1516fb2ba62d33f1186f35a5
-EBUILD wireguard-tools-1.0.20200513.ebuild 3272 BLAKE2B 800f2ec75e42ac5adb2ef8ffd0403ebd448e19f27609e6d9883d252743e838bd3a017ef86561d4aa8c82e0e67ec7f3b5d3c543ca100f495935bdb6d45faebe25 SHA512 714e11822d0854acb7eb86db716266cd53ff0ae8eb713c962b2aacaaa35b72dcca5ed03562c1a858e6cb204ae85ab25a9097f0db1516fb2ba62d33f1186f35a5
+DIST wireguard-tools-1.0.20200820.tar.xz 94812 BLAKE2B 68e3db7cc337e8cf0b35d192f38d6303696c19956661a10d253241864a8b22c666b99ea62d9533bc661353c77a7df4333e336ee00235d9492347beaf58b78396 SHA512 d30ff3c4381e65cd0a751110e66f3ad1aa274b22962da748af6373210d3e4824d066a74655156d7a3d1fe6f96187a49408bc590a8023bc706c1824c0546b874c
+EBUILD wireguard-tools-1.0.20200513.ebuild 4006 BLAKE2B f4232d1407542539df55e3dcffde13421fc0ac49adec0f0d6f57bcc606416c2e845eb180243acec3151ec36f814902dd088f8c36290ecff3bf3ce40c297ba603 SHA512 6cc57a52d4a2c193799a3b497c79786cf03ab763a6ed7bcc2ae8956212a19a1dc6a67ade1074d7001e30e266c888c0a29ac93e5cb6b776b6b4146d917f8883bb
+EBUILD wireguard-tools-1.0.20200820.ebuild 4014 BLAKE2B 7cbfad529059e2e54e3e2d9c8aae986c8e15cc58a17679c8f315e4fa68d98f961a433f35c67c88e563978989be12f1a438b8a34861d09a6fe6a94645a5e535ae SHA512 5232fd852509d26b6014f9222c4d0c7e9b57bd87ba23bd44fc3d926d4e7818fae5b51eed9dbeb6633b7a2cd9e81c37b85b55c6e4ad6d427c78dabe7a186575fa
MISC metadata.xml 362 BLAKE2B b6c8384cc5434b65a80b2326df412ca38a96bfd137feb34cea5124eebe13d383851b3ceea17cfc0b937555a0760608e0f3d0a7834da15271e65f669bfbfb8d2a SHA512 bf494cd4c95dbbbf783fc847cdf03f9a83b2673bf3a0a78fa12480abd1e2657f255019cf4f68db5143b11c5c63d6c16e9e18480800115751be9bc3cae910c8ea
diff --git a/net-vpn/wireguard-tools/files/wg-quick.init b/net-vpn/wireguard-tools/files/wg-quick.init
new file mode 100644
index 000000000000..780472782031
--- /dev/null
+++ b/net-vpn/wireguard-tools/files/wg-quick.init
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="WireGuard"
+description="WireGuard via wg-quick(8)"
+
+depend() {
+ need net
+ use dns
+}
+
+CONF="${SVCNAME#*.}"
+
+checkconfig() {
+ if [ "$CONF" = "$SVCNAME" ]; then
+ eerror "You cannot call this init script directly. You must create a symbolic link to it with the configuration name:"
+ eerror " ln -s /etc/init.d/wg-quick /etc/init.d/wg-quick.vpn0"
+ eerror "And then call it instead:"
+ eerror " /etc/init.d/wg-quick.vpn0 start"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting $description for $CONF"
+ wg-quick up "$CONF"
+ eend $? "Failed to start $description for $CONF"
+}
+
+stop() {
+ checkconfig || return 1
+ ebegin "Stopping $description for $CONF"
+ wg-quick down "$CONF"
+ eend $? "Failed to stop $description for $CONF"
+}
diff --git a/net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild
index 07fee8d91012..17cfcbbb8f2e 100644
--- a/net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild
+++ b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild
@@ -27,7 +27,6 @@ RDEPEND="${DEPEND}
|| ( net-firewall/nftables net-firewall/iptables )
virtual/resolvconf
)
- !<virtual/wireguard-1
"
wg_quick_optional_config_nob() {
@@ -36,29 +35,44 @@ 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
- if has_version net-firewall/nftables; then
- wg_quick_optional_config_nob NF_TABLES
- wg_quick_optional_config_nob NF_TABLES_IPV4
- wg_quick_optional_config_nob NF_TABLES_IPV6
- wg_quick_optional_config_nob NFT_CT
- wg_quick_optional_config_nob NFT_FIB
- wg_quick_optional_config_nob NFT_FIB_IPV4
- wg_quick_optional_config_nob NFT_FIB_IPV6
- wg_quick_optional_config_nob NF_CONNTRACK_MARK
- elif has_version net-firewall/iptables; then
- wg_quick_optional_config_nob NETFILTER_XTABLES
- wg_quick_optional_config_nob NETFILTER_XT_MARK
- wg_quick_optional_config_nob NETFILTER_XT_CONNMARK
- wg_quick_optional_config_nob NETFILTER_XT_MATCH_COMMENT
- wg_quick_optional_config_nob NETFILTER_XT_MATCH_ADDRTYPE
- wg_quick_optional_config_nob IP6_NF_RAW
- wg_quick_optional_config_nob IP_NF_RAW
- wg_quick_optional_config_nob IP6_NF_FILTER
- wg_quick_optional_config_nob IP_NF_FILTER
+ if use wg-quick; then
+ wg_quick_optional_config_nob IP_ADVANCED_ROUTER
+ wg_quick_optional_config_nob IP_MULTIPLE_TABLES
+ wg_quick_optional_config_nob IPV6_MULTIPLE_TABLES
+ if has_version net-firewall/nftables; then
+ wg_quick_optional_config_nob NF_TABLES
+ wg_quick_optional_config_nob NF_TABLES_IPV4
+ wg_quick_optional_config_nob NF_TABLES_IPV6
+ wg_quick_optional_config_nob NFT_CT
+ wg_quick_optional_config_nob NFT_FIB
+ wg_quick_optional_config_nob NFT_FIB_IPV4
+ wg_quick_optional_config_nob NFT_FIB_IPV6
+ wg_quick_optional_config_nob NF_CONNTRACK_MARK
+ elif has_version net-firewall/iptables; then
+ wg_quick_optional_config_nob NETFILTER_XTABLES
+ wg_quick_optional_config_nob NETFILTER_XT_MARK
+ wg_quick_optional_config_nob NETFILTER_XT_CONNMARK
+ wg_quick_optional_config_nob NETFILTER_XT_MATCH_COMMENT
+ wg_quick_optional_config_nob NETFILTER_XT_MATCH_ADDRTYPE
+ wg_quick_optional_config_nob IP6_NF_RAW
+ wg_quick_optional_config_nob IP_NF_RAW
+ wg_quick_optional_config_nob IP6_NF_FILTER
+ wg_quick_optional_config_nob IP_NF_FILTER
+ fi
+ fi
+ get_version
+ if [[ -f $KERNEL_DIR/include/uapi/linux/wireguard.h ]]; then
+ CONFIG_CHECK="~WIREGUARD $CONFIG_CHECK"
+ declare -g ERROR_WIREGUARD="CONFIG_WIREGUARD: This option is required for using WireGuard."
+ elif kernel_is -ge 3 10 0 && kernel_is -lt 5 6 0 && ! has_version net-vpn/wireguard-modules; then
+ ewarn
+ ewarn "Your kernel does not appear to have upstream support for WireGuard"
+ ewarn "via CONFIG_WIREGUARD. However, the net-vpn/wireguard-modules ebuild"
+ ewarn "contains a compatibility module that should work for your kernel."
+ ewarn "It is highly recommended to install it:"
+ ewarn
+ ewarn " emerge -av net-vpn/wireguard-modules"
+ ewarn
fi
linux-info_pkg_setup
}
@@ -79,6 +93,7 @@ src_install() {
SYSTEMDUNITDIR="$(systemd_get_systemunitdir)" \
PREFIX="${EPREFIX}/usr" \
-C src install
+ use wg-quick && newinitd "${FILESDIR}/wg-quick.init" wg-quick
}
pkg_postinst() {
diff --git a/net-vpn/wireguard-tools/wireguard-tools-1.0.20200319.ebuild b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200820.ebuild
index 07fee8d91012..f61364d1c25e 100644
--- a/net-vpn/wireguard-tools/wireguard-tools-1.0.20200319.ebuild
+++ b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200820.ebuild
@@ -13,7 +13,7 @@ if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://git.zx2c4.com/wireguard-tools"
else
SRC_URI="https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${PV}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
fi
LICENSE="GPL-2"
@@ -27,7 +27,6 @@ RDEPEND="${DEPEND}
|| ( net-firewall/nftables net-firewall/iptables )
virtual/resolvconf
)
- !<virtual/wireguard-1
"
wg_quick_optional_config_nob() {
@@ -36,29 +35,44 @@ 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
- if has_version net-firewall/nftables; then
- wg_quick_optional_config_nob NF_TABLES
- wg_quick_optional_config_nob NF_TABLES_IPV4
- wg_quick_optional_config_nob NF_TABLES_IPV6
- wg_quick_optional_config_nob NFT_CT
- wg_quick_optional_config_nob NFT_FIB
- wg_quick_optional_config_nob NFT_FIB_IPV4
- wg_quick_optional_config_nob NFT_FIB_IPV6
- wg_quick_optional_config_nob NF_CONNTRACK_MARK
- elif has_version net-firewall/iptables; then
- wg_quick_optional_config_nob NETFILTER_XTABLES
- wg_quick_optional_config_nob NETFILTER_XT_MARK
- wg_quick_optional_config_nob NETFILTER_XT_CONNMARK
- wg_quick_optional_config_nob NETFILTER_XT_MATCH_COMMENT
- wg_quick_optional_config_nob NETFILTER_XT_MATCH_ADDRTYPE
- wg_quick_optional_config_nob IP6_NF_RAW
- wg_quick_optional_config_nob IP_NF_RAW
- wg_quick_optional_config_nob IP6_NF_FILTER
- wg_quick_optional_config_nob IP_NF_FILTER
+ if use wg-quick; then
+ wg_quick_optional_config_nob IP_ADVANCED_ROUTER
+ wg_quick_optional_config_nob IP_MULTIPLE_TABLES
+ wg_quick_optional_config_nob IPV6_MULTIPLE_TABLES
+ if has_version net-firewall/nftables; then
+ wg_quick_optional_config_nob NF_TABLES
+ wg_quick_optional_config_nob NF_TABLES_IPV4
+ wg_quick_optional_config_nob NF_TABLES_IPV6
+ wg_quick_optional_config_nob NFT_CT
+ wg_quick_optional_config_nob NFT_FIB
+ wg_quick_optional_config_nob NFT_FIB_IPV4
+ wg_quick_optional_config_nob NFT_FIB_IPV6
+ wg_quick_optional_config_nob NF_CONNTRACK_MARK
+ elif has_version net-firewall/iptables; then
+ wg_quick_optional_config_nob NETFILTER_XTABLES
+ wg_quick_optional_config_nob NETFILTER_XT_MARK
+ wg_quick_optional_config_nob NETFILTER_XT_CONNMARK
+ wg_quick_optional_config_nob NETFILTER_XT_MATCH_COMMENT
+ wg_quick_optional_config_nob NETFILTER_XT_MATCH_ADDRTYPE
+ wg_quick_optional_config_nob IP6_NF_RAW
+ wg_quick_optional_config_nob IP_NF_RAW
+ wg_quick_optional_config_nob IP6_NF_FILTER
+ wg_quick_optional_config_nob IP_NF_FILTER
+ fi
+ fi
+ get_version
+ if [[ -f $KERNEL_DIR/include/uapi/linux/wireguard.h ]]; then
+ CONFIG_CHECK="~WIREGUARD $CONFIG_CHECK"
+ declare -g ERROR_WIREGUARD="CONFIG_WIREGUARD: This option is required for using WireGuard."
+ elif kernel_is -ge 3 10 0 && kernel_is -lt 5 6 0 && ! has_version net-vpn/wireguard-modules; then
+ ewarn
+ ewarn "Your kernel does not appear to have upstream support for WireGuard"
+ ewarn "via CONFIG_WIREGUARD. However, the net-vpn/wireguard-modules ebuild"
+ ewarn "contains a compatibility module that should work for your kernel."
+ ewarn "It is highly recommended to install it:"
+ ewarn
+ ewarn " emerge -av net-vpn/wireguard-modules"
+ ewarn
fi
linux-info_pkg_setup
}
@@ -79,6 +93,7 @@ src_install() {
SYSTEMDUNITDIR="$(systemd_get_systemunitdir)" \
PREFIX="${EPREFIX}/usr" \
-C src install
+ use wg-quick && newinitd "${FILESDIR}/wg-quick.init" wg-quick
}
pkg_postinst() {