Gentoo Archives: gentoo-commits

From: "Jason A. Donenfeld" <zx2c4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/wireguard-tools/
Date: Mon, 11 May 2020 04:32:05
Message-Id: 1589171503.65857dd65788f65159a457d2a2c7be0a4750b352.zx2c4@gentoo
1 commit: 65857dd65788f65159a457d2a2c7be0a4750b352
2 Author: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 11 04:31:31 2020 +0000
4 Commit: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
5 CommitDate: Mon May 11 04:31:43 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65857dd6
7
8 net-vpn/wireguard-tools: bump to 1.0.20200510
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org>
12
13 net-vpn/wireguard-tools/Manifest | 1 +
14 .../wireguard-tools-1.0.20200510.ebuild | 101 +++++++++++++++++++++
15 2 files changed, 102 insertions(+)
16
17 diff --git a/net-vpn/wireguard-tools/Manifest b/net-vpn/wireguard-tools/Manifest
18 index e07c2e71cbc..2c183d5b27e 100644
19 --- a/net-vpn/wireguard-tools/Manifest
20 +++ b/net-vpn/wireguard-tools/Manifest
21 @@ -1 +1,2 @@
22 DIST wireguard-tools-1.0.20200319.tar.xz 92324 BLAKE2B 9f514748708ef6a5b7f5b043c9054c954d17bb77de7a354b5a9a4e63cfb5f441237e98b16b288426441a7e709e1874d396cf67b04b38bb0ebbe7822bb32ada57 SHA512 d5bcd153f9b10f184b9a1bf9a81f33a9713ab4863ab5aa190eac60e92919756c8fecbb0d3cfb83bae20ac78fc43fdd7168f37294cdd7c5ee21f2a1b2db5fdf41
23 +DIST wireguard-tools-1.0.20200510.tar.xz 94560 BLAKE2B f84b824ee63dec615a4d7e50b03e03db7c8c9ecfdf16541518a7d39e0a16d1f30e7e14eb8dae9a8011e24a13dc6306e7d473073e22c649debb77400bb4b25d5c SHA512 68a75340ebf5e28bcd751815a41f00c400ad891b483aab4a10af9de604adfde0157578f2c2724171e2a59e825c8369e81d0a0cf7a0111ba429319704c482526a
24
25 diff --git a/net-vpn/wireguard-tools/wireguard-tools-1.0.20200510.ebuild b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200510.ebuild
26 new file mode 100644
27 index 00000000000..ab890be7d84
28 --- /dev/null
29 +++ b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200510.ebuild
30 @@ -0,0 +1,101 @@
31 +# Copyright 1999-2020 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +inherit linux-info bash-completion-r1 systemd toolchain-funcs
37 +
38 +DESCRIPTION="Required tools for WireGuard, such as wg(8) and wg-quick(8)"
39 +HOMEPAGE="https://www.wireguard.com/"
40 +
41 +if [[ ${PV} == 9999 ]]; then
42 + inherit git-r3
43 + EGIT_REPO_URI="https://git.zx2c4.com/wireguard-tools"
44 + KEYWORDS=""
45 +else
46 + SRC_URI="https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${PV}.tar.xz"
47 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
48 +fi
49 +
50 +LICENSE="GPL-2"
51 +SLOT="0"
52 +IUSE="+wg-quick"
53 +
54 +BDEPEND="virtual/pkgconfig"
55 +DEPEND=""
56 +RDEPEND="${DEPEND}
57 + wg-quick? (
58 + || ( net-firewall/nftables net-firewall/iptables )
59 + virtual/resolvconf
60 + )
61 + !<virtual/wireguard-1
62 +"
63 +
64 +wg_quick_optional_config_nob() {
65 + CONFIG_CHECK="$CONFIG_CHECK ~$1"
66 + 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."
67 +}
68 +
69 +pkg_setup() {
70 + use wg-quick || return 0
71 + wg_quick_optional_config_nob IP_ADVANCED_ROUTER
72 + wg_quick_optional_config_nob IP_MULTIPLE_TABLES
73 + wg_quick_optional_config_nob IPV6_MULTIPLE_TABLES
74 + if has_version net-firewall/nftables; then
75 + wg_quick_optional_config_nob NF_TABLES
76 + wg_quick_optional_config_nob NF_TABLES_IPV4
77 + wg_quick_optional_config_nob NF_TABLES_IPV6
78 + wg_quick_optional_config_nob NFT_CT
79 + wg_quick_optional_config_nob NFT_FIB
80 + wg_quick_optional_config_nob NFT_FIB_IPV4
81 + wg_quick_optional_config_nob NFT_FIB_IPV6
82 + wg_quick_optional_config_nob NF_CONNTRACK_MARK
83 + elif has_version net-firewall/iptables; then
84 + wg_quick_optional_config_nob NETFILTER_XTABLES
85 + wg_quick_optional_config_nob NETFILTER_XT_MARK
86 + wg_quick_optional_config_nob NETFILTER_XT_CONNMARK
87 + wg_quick_optional_config_nob NETFILTER_XT_MATCH_COMMENT
88 + wg_quick_optional_config_nob IP6_NF_RAW
89 + wg_quick_optional_config_nob IP_NF_RAW
90 + wg_quick_optional_config_nob IP6_NF_FILTER
91 + wg_quick_optional_config_nob IP_NF_FILTER
92 + fi
93 + linux-info_pkg_setup
94 +}
95 +
96 +src_compile() {
97 + emake RUNSTATEDIR="${EPREFIX}/run" -C src CC="$(tc-getCC)" LD="$(tc-getLD)"
98 +}
99 +
100 +src_install() {
101 + dodoc README.md
102 + dodoc -r contrib
103 + emake \
104 + WITH_BASHCOMPLETION=yes \
105 + WITH_SYSTEMDUNITS=yes \
106 + WITH_WGQUICK=$(usex wg-quick) \
107 + DESTDIR="${D}" \
108 + BASHCOMPDIR="$(get_bashcompdir)" \
109 + SYSTEMDUNITDIR="$(systemd_get_systemunitdir)" \
110 + PREFIX="${EPREFIX}/usr" \
111 + -C src install
112 +}
113 +
114 +pkg_postinst() {
115 + einfo
116 + einfo "After installing WireGuard, if you'd like to try sending some packets through"
117 + einfo "WireGuard, you may use, for testing purposes only, the insecure client.sh"
118 + einfo "test example script:"
119 + einfo
120 + einfo " \$ bzcat ${ROOT}/usr/share/doc/${PF}/contrib/ncat-client-server/client.sh.bz2 | sudo bash -"
121 + einfo
122 + einfo "This will automatically setup interface wg0, through a very insecure transport"
123 + einfo "that is only suitable for demonstration purposes. You can then try loading the"
124 + einfo "hidden website or sending pings:"
125 + einfo
126 + einfo " \$ chromium http://192.168.4.1"
127 + einfo " \$ ping 192.168.4.1"
128 + einfo
129 + einfo "More info on getting started can be found at: https://www.wireguard.com/quickstart/"
130 + einfo
131 +}