Skip to content

Commit 281447f

Browse files
committed
net-vpn/tailscale: add 1.60.0
Signed-off-by: Ryan Qian <i@bitbili.net>
1 parent 3efc510 commit 281447f

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

net-vpn/tailscale/Manifest

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ DIST tailscale-1.42.0-vendor.tar.gz 16255676 BLAKE2B 0ed49ae5c15403c0fd32ec1a9fc
44
DIST tailscale-1.42.0.tar.gz 1719372 BLAKE2B 6dade0576e924ee55afcc8e7bead49ec383f5289ca3028cddfd6671cef6557fdb6f3e9302b952a2b8dbbcb0bfce569c893d4477033abdda993168c3009573f8f
55
DIST tailscale-1.58.2-vendor.tar.gz 17337194 BLAKE2B fdf199be2ef6bde276d9215d24d87632ede93543706670fc5aae134bf5ebd0ad74525a94f57158f2e3955ef3172a89712cba28c9a503f4738b02c2fc564fb017
66
DIST tailscale-1.58.2.tar.gz 2361679 BLAKE2B 1aa66710677ba7c648782db9f67ce8cf565812b08610bb078bcd78ee2d695601fcb2f681102eb7a1232b6c4057ba5e1fed1d26b375cec793f0fbce65aff38755
7+
DIST tailscale-1.60.0-vendor.tar.gz 17461738 BLAKE2B 3af6e69d332587672c9085f2fb752b66c64165b9d970f57898cc8688219bacc7fd16c975c31e4d72e2c05bc455aec6bcfcaf2f7067113a87c8a27529da231b84
8+
DIST tailscale-1.60.0.tar.gz 2440764 BLAKE2B f6c6ee3e378ddc37dbe67a74b1ff2b1cf5b9cbe720f6a38b3292f6fc7874b2712f00d7ba2e647a12c7b29edb2ca131605226af5fd56200b8fa7c6005e6eba778
+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Copyright 2020-2023 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
inherit go systemd tmpfiles
6+
7+
DESCRIPTION="Tailscale VPN client and CLI tools"
8+
HOMEPAGE="https://tailscale.com https://github.com/tailscale/tailscale"
9+
10+
SRC_URI="https://github.com/tailscale/tailscale/archive/v${PV}.tar.gz -> ${P}.tar.gz
11+
https://github.com/bekcpear/gopkg-vendors/archive/refs/tags/vendor-${P}.tar.gz -> ${P}-vendor.tar.gz"
12+
13+
LICENSE="Apache-2.0 BSD-2 BSD MIT"
14+
SLOT="0"
15+
KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
16+
IUSE="derp tools"
17+
18+
BDEPEND=">=dev-lang/go-1.22:="
19+
20+
# 'iptables' is no longer mandatory,
21+
# refer to https://github.com/tailscale/tailscale/issues/391 ,
22+
# and https://github.com/tailscale/tailscale/commit/243ce6ccc1a3e032e3d4a014e7dd09a9379c3c42
23+
RDEPEND="
24+
derp? (
25+
acct-user/derper
26+
acct-group/derper
27+
)
28+
"
29+
30+
GO_SBIN="tailscaled"
31+
GO_TARGET_PKGS="
32+
./cmd/tailscale
33+
./cmd/tailscaled
34+
"
35+
36+
src_configure() {
37+
use derp && GO_TARGET_PKGS+=" ./cmd/derper"
38+
use tools && GO_TARGET_PKGS+=" ./cmd/derpprobe"
39+
40+
. "$WORKDIR"/gopkg-vendors-vendor-$P/version.txt || die
41+
GO_LDFLAGS="
42+
-X 'tailscale.com/version.longStamp=${VERSION_LONG}'
43+
-X 'tailscale.com/version.shortStamp=${VERSION_SHORT}'
44+
-X 'tailscale.com/version.gitCommitStamp=${VERSION_GIT_HASH}'"
45+
}
46+
47+
src_install() {
48+
go_src_install
49+
50+
exeinto /usr/libexec
51+
doexe "$ED"/usr/bin/tailscale
52+
rm "$ED"/usr/bin/tailscale || die
53+
newbin "$FILESDIR"/tailscale.sh tailscale
54+
55+
keepdir /var/lib/${PN}
56+
fperms 0750 /var/lib/${PN}
57+
58+
insinto /etc/default
59+
newins "${FILESDIR}"/tailscaled.defaults tailscaled
60+
61+
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf
62+
63+
systemd_dounit cmd/tailscaled/tailscaled.service
64+
systemd_newunit "${FILESDIR}"/tailscaled-at.service tailscaled@.service
65+
66+
# conf for fix, should be removed later
67+
exeinto /opt/bin
68+
newexe "${FILESDIR}"/fix-mis-configured-path.sh tailscaled.misconfiged.fix.sh
69+
sed -i '/ExecStartPre=/iExecStartPre=/opt/bin/tailscaled.misconfiged.fix.sh' \
70+
"${D}$(systemd_get_systemunitdir)"/tailscaled.service \
71+
"${D}$(systemd_get_systemunitdir)"/tailscaled@.service
72+
73+
newinitd "${FILESDIR}"/${PN}d.initd ${PN}d
74+
75+
if use derp; then
76+
insinto /etc/default
77+
newins "${FILESDIR}"/derper.defaults derper
78+
79+
exeinto /usr/libexec
80+
doexe "${FILESDIR}"/derper-pre.sh
81+
82+
systemd_dounit "${FILESDIR}"/derper.service
83+
systemd_install_serviced "${FILESDIR}"/derper.service.conf derper
84+
85+
newinitd "${FILESDIR}"/derper.initd derper
86+
fi
87+
}
88+
89+
pkg_preinst() {
90+
sed -i "s#@EPREFIX@#$EPREFIX#" "$ED"/usr/bin/tailscale || die
91+
sed -i "s#@EPREFIX@#$EPREFIX#" "$ED"/opt/bin/tailscaled.misconfiged.fix.sh || die
92+
}
93+
94+
pkg_postinst() {
95+
tmpfiles_process ${PN}.conf
96+
97+
ewarn "multiple instances support still exists problems, such as iptables/nftables rules."
98+
}

0 commit comments

Comments
 (0)