net-vpn/wireguard-tools: bump to 1.0.20200510
authorJason A. Donenfeld <zx2c4@gentoo.org>
Mon, 11 May 2020 04:31:31 +0000 (22:31 -0600)
committerJason A. Donenfeld <zx2c4@gentoo.org>
Mon, 11 May 2020 04:31:43 +0000 (22:31 -0600)
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org>
net-vpn/wireguard-tools/Manifest
net-vpn/wireguard-tools/wireguard-tools-1.0.20200510.ebuild [new file with mode: 0644]

index e07c2e71cbcc79850a799d67fe1e65204cb9a076..2c183d5b27e194e81aa02768b487e577a61679c9 100644 (file)
@@ -1 +1,2 @@
 DIST wireguard-tools-1.0.20200319.tar.xz 92324 BLAKE2B 9f514748708ef6a5b7f5b043c9054c954d17bb77de7a354b5a9a4e63cfb5f441237e98b16b288426441a7e709e1874d396cf67b04b38bb0ebbe7822bb32ada57 SHA512 d5bcd153f9b10f184b9a1bf9a81f33a9713ab4863ab5aa190eac60e92919756c8fecbb0d3cfb83bae20ac78fc43fdd7168f37294cdd7c5ee21f2a1b2db5fdf41
+DIST wireguard-tools-1.0.20200510.tar.xz 94560 BLAKE2B f84b824ee63dec615a4d7e50b03e03db7c8c9ecfdf16541518a7d39e0a16d1f30e7e14eb8dae9a8011e24a13dc6306e7d473073e22c649debb77400bb4b25d5c SHA512 68a75340ebf5e28bcd751815a41f00c400ad891b483aab4a10af9de604adfde0157578f2c2724171e2a59e825c8369e81d0a0cf7a0111ba429319704c482526a
diff --git a/net-vpn/wireguard-tools/wireguard-tools-1.0.20200510.ebuild b/net-vpn/wireguard-tools/wireguard-tools-1.0.20200510.ebuild
new file mode 100644 (file)
index 0000000..ab890be
--- /dev/null
@@ -0,0 +1,101 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info bash-completion-r1 systemd toolchain-funcs
+
+DESCRIPTION="Required tools for WireGuard, such as wg(8) and wg-quick(8)"
+HOMEPAGE="https://www.wireguard.com/"
+
+if [[ ${PV} == 9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://git.zx2c4.com/wireguard-tools"
+       KEYWORDS=""
+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"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+wg-quick"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND=""
+RDEPEND="${DEPEND}
+       wg-quick? (
+               || ( net-firewall/nftables net-firewall/iptables )
+               virtual/resolvconf
+       )
+       !<virtual/wireguard-1
+"
+
+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() {
+       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 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
+       linux-info_pkg_setup
+}
+
+src_compile() {
+       emake RUNSTATEDIR="${EPREFIX}/run" -C src CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+       dodoc README.md
+       dodoc -r contrib
+       emake \
+               WITH_BASHCOMPLETION=yes \
+               WITH_SYSTEMDUNITS=yes \
+               WITH_WGQUICK=$(usex wg-quick) \
+               DESTDIR="${D}" \
+               BASHCOMPDIR="$(get_bashcompdir)" \
+               SYSTEMDUNITDIR="$(systemd_get_systemunitdir)" \
+               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 "More info on getting started can be found at: https://www.wireguard.com/quickstart/"
+       einfo
+}