1 |
commit: 45406b9c8c459feec233bc4f7f1e4aa07352f536 |
2 |
Author: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 31 12:04:50 2020 +0000 |
4 |
Commit: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 31 12:12:06 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45406b9c |
7 |
|
8 |
net-vpn/wireguard-tools: require CONFIG_WIREGUARD=y|m |
9 |
|
10 |
Package-Manager: Portage-3.0.1, Repoman-2.3.23 |
11 |
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org> |
12 |
|
13 |
.../wireguard-tools-1.0.20200513.ebuild | 62 +++++++++++++--------- |
14 |
1 file changed, 38 insertions(+), 24 deletions(-) |
15 |
|
16 |
diff --git a/net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild |
17 |
index 07fee8d9101..05151edab94 100644 |
18 |
--- a/net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild |
19 |
+++ b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200513.ebuild |
20 |
@@ -27,7 +27,6 @@ RDEPEND="${DEPEND} |
21 |
|| ( net-firewall/nftables net-firewall/iptables ) |
22 |
virtual/resolvconf |
23 |
) |
24 |
- !<virtual/wireguard-1 |
25 |
" |
26 |
|
27 |
wg_quick_optional_config_nob() { |
28 |
@@ -36,29 +35,44 @@ wg_quick_optional_config_nob() { |
29 |
} |
30 |
|
31 |
pkg_setup() { |
32 |
- use wg-quick || return 0 |
33 |
- wg_quick_optional_config_nob IP_ADVANCED_ROUTER |
34 |
- wg_quick_optional_config_nob IP_MULTIPLE_TABLES |
35 |
- wg_quick_optional_config_nob IPV6_MULTIPLE_TABLES |
36 |
- if has_version net-firewall/nftables; then |
37 |
- wg_quick_optional_config_nob NF_TABLES |
38 |
- wg_quick_optional_config_nob NF_TABLES_IPV4 |
39 |
- wg_quick_optional_config_nob NF_TABLES_IPV6 |
40 |
- wg_quick_optional_config_nob NFT_CT |
41 |
- wg_quick_optional_config_nob NFT_FIB |
42 |
- wg_quick_optional_config_nob NFT_FIB_IPV4 |
43 |
- wg_quick_optional_config_nob NFT_FIB_IPV6 |
44 |
- wg_quick_optional_config_nob NF_CONNTRACK_MARK |
45 |
- elif has_version net-firewall/iptables; then |
46 |
- wg_quick_optional_config_nob NETFILTER_XTABLES |
47 |
- wg_quick_optional_config_nob NETFILTER_XT_MARK |
48 |
- wg_quick_optional_config_nob NETFILTER_XT_CONNMARK |
49 |
- wg_quick_optional_config_nob NETFILTER_XT_MATCH_COMMENT |
50 |
- wg_quick_optional_config_nob NETFILTER_XT_MATCH_ADDRTYPE |
51 |
- wg_quick_optional_config_nob IP6_NF_RAW |
52 |
- wg_quick_optional_config_nob IP_NF_RAW |
53 |
- wg_quick_optional_config_nob IP6_NF_FILTER |
54 |
- wg_quick_optional_config_nob IP_NF_FILTER |
55 |
+ if use wg-quick; then |
56 |
+ wg_quick_optional_config_nob IP_ADVANCED_ROUTER |
57 |
+ wg_quick_optional_config_nob IP_MULTIPLE_TABLES |
58 |
+ wg_quick_optional_config_nob IPV6_MULTIPLE_TABLES |
59 |
+ if has_version net-firewall/nftables; then |
60 |
+ wg_quick_optional_config_nob NF_TABLES |
61 |
+ wg_quick_optional_config_nob NF_TABLES_IPV4 |
62 |
+ wg_quick_optional_config_nob NF_TABLES_IPV6 |
63 |
+ wg_quick_optional_config_nob NFT_CT |
64 |
+ wg_quick_optional_config_nob NFT_FIB |
65 |
+ wg_quick_optional_config_nob NFT_FIB_IPV4 |
66 |
+ wg_quick_optional_config_nob NFT_FIB_IPV6 |
67 |
+ wg_quick_optional_config_nob NF_CONNTRACK_MARK |
68 |
+ elif has_version net-firewall/iptables; then |
69 |
+ wg_quick_optional_config_nob NETFILTER_XTABLES |
70 |
+ wg_quick_optional_config_nob NETFILTER_XT_MARK |
71 |
+ wg_quick_optional_config_nob NETFILTER_XT_CONNMARK |
72 |
+ wg_quick_optional_config_nob NETFILTER_XT_MATCH_COMMENT |
73 |
+ wg_quick_optional_config_nob NETFILTER_XT_MATCH_ADDRTYPE |
74 |
+ wg_quick_optional_config_nob IP6_NF_RAW |
75 |
+ wg_quick_optional_config_nob IP_NF_RAW |
76 |
+ wg_quick_optional_config_nob IP6_NF_FILTER |
77 |
+ wg_quick_optional_config_nob IP_NF_FILTER |
78 |
+ fi |
79 |
+ fi |
80 |
+ get_version |
81 |
+ if [[ -f $KERNEL_DIR/include/uapi/linux/wireguard.h ]]; then |
82 |
+ CONFIG_CHECK="~WIREGUARD $CONFIG_CHECK" |
83 |
+ declare -g ERROR_WIREGUARD="CONFIG_WIREGUARD: This option is required for using WireGuard." |
84 |
+ elif kernel_is -ge 3 10 0 && kernel_is -lt 5 6 0 && ! has_version net-vpn/wireguard-modules; then |
85 |
+ ewarn |
86 |
+ ewarn "Your kernel does not appear to have upstream support for WireGuard" |
87 |
+ ewarn "via CONFIG_WIREGUARD. However, the net-vpn/wireguard-modules ebuild" |
88 |
+ ewarn "contains a compatibility module that should work for your kernel." |
89 |
+ ewarn "It is highly recommended to install it:" |
90 |
+ ewarn |
91 |
+ ewarn " emerge -av net-vpn/wireguard-modules" |
92 |
+ ewarn |
93 |
fi |
94 |
linux-info_pkg_setup |
95 |
} |