-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKGBUILD
47 lines (39 loc) · 1.6 KB
/
PKGBUILD
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
pkgname=tailscale
pkgver=1.64.0
pkgrel=1
pkgdesc="A mesh VPN that makes it easy to connect your devices, wherever they are."
arch=("x86_64")
url="https://pkgs.tailscale.com/"
license=("MIT")
makedepends=("go")
depends=("glibc")
backup=("etc/default/tailscaled")
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/tailscale/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('SKIP')
options=('!lto')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
go mod vendor
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -mod=readonly -modcacherw"
GO_LDFLAGS="-compressdwarf=false -linkmode=external"
for cmd in "./cmd/tailscale" "./cmd/tailscaled"; do
go build -v -tags xversion -ldflags "$GO_LDFLAGS" "$cmd"
done
}
package() {
install -Dm755 "${srcdir}/${pkgname}-${pkgver}"/tailscale{,d} -t "${pkgdir}/usr/bin/"
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/cmd/tailscaled/tailscaled.defaults" "${pkgdir}/etc/default/tailscaled"
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/cmd/tailscaled/tailscaled.service" -t "${pkgdir}/usr/lib/systemd/system/"
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}/"
install -dm755 "${pkgdir}/sbin/"
install -dm755 "${pkgdir}/usr/sbin/"
ln -v -f "${pkgdir}/usr/bin/tailscaled" --target-directory="${pkgdir}/sbin/"
ln -v -f "${pkgdir}/usr/bin/tailscaled" --target-directory="${pkgdir}/usr/sbin/"
}