blob: a11d49b981463d5e0dca1231c1d4a7eb4f49b6af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module systemd tmpfiles
# These settings are obtained by running ./build_dist.sh shellvars` in
# the upstream repo.
VERSION_MINOR="66"
VERSION_SHORT="1.66.1"
VERSION_LONG="1.66.1-t88e23b6cf"
VERSION_GIT_HASH="88e23b6cfd4b9a9cad5ce858b73ece1f07970fee"
DESCRIPTION="Tailscale vpn client"
HOMEPAGE="https://tailscale.com"
SRC_URI="https://github.com/tailscale/tailscale/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-deps.tar.xz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
RDEPEND="net-firewall/iptables"
BDEPEND=">=dev-lang/go-1.22"
RESTRICT="test"
# This translates the build command from upstream's build_dist.sh to an
# ebuild equivalent.
build_dist() {
ego build -tags xversion -ldflags "
-X tailscale.com/version.Long=${VERSION_LONG}
-X tailscale.com/version.Short=${VERSION_SHORT}
-X tailscale.com/version.GitCommit=${VERSION_GIT_HASH}" "$@"
}
src_compile() {
build_dist ./cmd/tailscale
build_dist ./cmd/tailscaled
}
src_install() {
dosbin tailscaled
dobin tailscale
systemd_dounit cmd/tailscaled/tailscaled.service
insinto /etc/default
newins cmd/tailscaled/tailscaled.defaults tailscaled
keepdir /var/lib/${PN}
fperms 0750 /var/lib/${PN}
newtmpfiles "${FILESDIR}/${PN}.tmpfiles" ${PN}.conf
newinitd "${FILESDIR}/${PN}d.initd" ${PN}
newconfd "${FILESDIR}/${PN}d.confd" ${PN}
}
pkg_postinst() {
tmpfiles_process ${PN}.conf
}
|