From 281447f00986e2c66a315e46f9a9cad9237de4c8 Mon Sep 17 00:00:00 2001 From: Ryan Qian Date: Mon, 26 Feb 2024 16:10:56 +0800 Subject: [PATCH] net-vpn/tailscale: add 1.60.0 Signed-off-by: Ryan Qian --- net-vpn/tailscale/Manifest | 2 + net-vpn/tailscale/tailscale-1.60.0.ebuild | 98 +++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 net-vpn/tailscale/tailscale-1.60.0.ebuild diff --git a/net-vpn/tailscale/Manifest b/net-vpn/tailscale/Manifest index 9c3d685..ccd1321 100644 --- a/net-vpn/tailscale/Manifest +++ b/net-vpn/tailscale/Manifest @@ -4,3 +4,5 @@ DIST tailscale-1.42.0-vendor.tar.gz 16255676 BLAKE2B 0ed49ae5c15403c0fd32ec1a9fc DIST tailscale-1.42.0.tar.gz 1719372 BLAKE2B 6dade0576e924ee55afcc8e7bead49ec383f5289ca3028cddfd6671cef6557fdb6f3e9302b952a2b8dbbcb0bfce569c893d4477033abdda993168c3009573f8f DIST tailscale-1.58.2-vendor.tar.gz 17337194 BLAKE2B fdf199be2ef6bde276d9215d24d87632ede93543706670fc5aae134bf5ebd0ad74525a94f57158f2e3955ef3172a89712cba28c9a503f4738b02c2fc564fb017 DIST tailscale-1.58.2.tar.gz 2361679 BLAKE2B 1aa66710677ba7c648782db9f67ce8cf565812b08610bb078bcd78ee2d695601fcb2f681102eb7a1232b6c4057ba5e1fed1d26b375cec793f0fbce65aff38755 +DIST tailscale-1.60.0-vendor.tar.gz 17461738 BLAKE2B 3af6e69d332587672c9085f2fb752b66c64165b9d970f57898cc8688219bacc7fd16c975c31e4d72e2c05bc455aec6bcfcaf2f7067113a87c8a27529da231b84 +DIST tailscale-1.60.0.tar.gz 2440764 BLAKE2B f6c6ee3e378ddc37dbe67a74b1ff2b1cf5b9cbe720f6a38b3292f6fc7874b2712f00d7ba2e647a12c7b29edb2ca131605226af5fd56200b8fa7c6005e6eba778 diff --git a/net-vpn/tailscale/tailscale-1.60.0.ebuild b/net-vpn/tailscale/tailscale-1.60.0.ebuild new file mode 100644 index 0000000..256f3a8 --- /dev/null +++ b/net-vpn/tailscale/tailscale-1.60.0.ebuild @@ -0,0 +1,98 @@ +# Copyright 2020-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit go systemd tmpfiles + +DESCRIPTION="Tailscale VPN client and CLI tools" +HOMEPAGE="https://tailscale.com https://github.com/tailscale/tailscale" + +SRC_URI="https://github.com/tailscale/tailscale/archive/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/bekcpear/gopkg-vendors/archive/refs/tags/vendor-${P}.tar.gz -> ${P}-vendor.tar.gz" + +LICENSE="Apache-2.0 BSD-2 BSD MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86" +IUSE="derp tools" + +BDEPEND=">=dev-lang/go-1.22:=" + +# 'iptables' is no longer mandatory, +# refer to https://github.com/tailscale/tailscale/issues/391 , +# and https://github.com/tailscale/tailscale/commit/243ce6ccc1a3e032e3d4a014e7dd09a9379c3c42 +RDEPEND=" + derp? ( + acct-user/derper + acct-group/derper + ) +" + +GO_SBIN="tailscaled" +GO_TARGET_PKGS=" + ./cmd/tailscale + ./cmd/tailscaled +" + +src_configure() { + use derp && GO_TARGET_PKGS+=" ./cmd/derper" + use tools && GO_TARGET_PKGS+=" ./cmd/derpprobe" + + . "$WORKDIR"/gopkg-vendors-vendor-$P/version.txt || die + GO_LDFLAGS=" + -X 'tailscale.com/version.longStamp=${VERSION_LONG}' + -X 'tailscale.com/version.shortStamp=${VERSION_SHORT}' + -X 'tailscale.com/version.gitCommitStamp=${VERSION_GIT_HASH}'" +} + +src_install() { + go_src_install + + exeinto /usr/libexec + doexe "$ED"/usr/bin/tailscale + rm "$ED"/usr/bin/tailscale || die + newbin "$FILESDIR"/tailscale.sh tailscale + + keepdir /var/lib/${PN} + fperms 0750 /var/lib/${PN} + + insinto /etc/default + newins "${FILESDIR}"/tailscaled.defaults tailscaled + + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf + + systemd_dounit cmd/tailscaled/tailscaled.service + systemd_newunit "${FILESDIR}"/tailscaled-at.service tailscaled@.service + + # conf for fix, should be removed later + exeinto /opt/bin + newexe "${FILESDIR}"/fix-mis-configured-path.sh tailscaled.misconfiged.fix.sh + sed -i '/ExecStartPre=/iExecStartPre=/opt/bin/tailscaled.misconfiged.fix.sh' \ + "${D}$(systemd_get_systemunitdir)"/tailscaled.service \ + "${D}$(systemd_get_systemunitdir)"/tailscaled@.service + + newinitd "${FILESDIR}"/${PN}d.initd ${PN}d + + if use derp; then + insinto /etc/default + newins "${FILESDIR}"/derper.defaults derper + + exeinto /usr/libexec + doexe "${FILESDIR}"/derper-pre.sh + + systemd_dounit "${FILESDIR}"/derper.service + systemd_install_serviced "${FILESDIR}"/derper.service.conf derper + + newinitd "${FILESDIR}"/derper.initd derper + fi +} + +pkg_preinst() { + sed -i "s#@EPREFIX@#$EPREFIX#" "$ED"/usr/bin/tailscale || die + sed -i "s#@EPREFIX@#$EPREFIX#" "$ED"/opt/bin/tailscaled.misconfiged.fix.sh || die +} + +pkg_postinst() { + tmpfiles_process ${PN}.conf + + ewarn "multiple instances support still exists problems, such as iptables/nftables rules." +}