1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-24 11:45:18 +03:00
aports/community/tailscale/APKBUILD
2023-02-24 03:52:43 +01:00

74 lines
3 KiB
Text

# Contributor: Robert Günzler <r@gnzler.io>
# Contributor: Xe <xe@tailscale.com>
# Maintainer: Robert Günzler <r@gnzler.io>
pkgname=tailscale
pkgver=1.36.2
pkgrel=0
pkgdesc="The easiest, most secure way to use WireGuard and 2FA"
url="https://tailscale.com/"
license="BSD-3-Clause"
arch="all !s390x" # upstream still doesn't have hardware to debug this
options="chmod-clean"
depends="iptables ip6tables" # https://github.com/tailscale/tailscale/issues/391
makedepends="go linux-headers"
checkdepends="openssh iproute2-minimal"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tailscale/tailscale/archive/v$pkgver.tar.gz
tailscale.confd
tailscale.initd
tailscale.logrotate
tailscale.modules-load
findgo.patch
"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
# secfixes:
# 1.32.3-r0:
# - CVE-2022-41924 TS-2022-004
# 0:
# - CVE-2022-41925 TS-2022-005
build() {
msg2 "Building tailscale..."
TAGS="netcgo osusergo static_build xversion"
VERSIONFLAGS="
-X tailscale.com/version.Short=$pkgver
-X tailscale.com/version.Long=$pkgver-AlpineLinux
-X tailscale.com/version.GitCommit=AlpineLinux
"
go build -tags "$TAGS" -ldflags "$VERSIONFLAGS" ./cmd/tailscale
go build -tags "$TAGS" -ldflags "$VERSIONFLAGS" ./cmd/tailscaled
}
check() {
# shellcheck disable=SC2046
go test $(go list ./... | grep -Ev '(wgengine/magicsock|tstest/archtest|tstest/integration|tstest/jsdeps|tstest/iosdeps|ssh/tailssh|containerboot)')
}
package() {
install -m755 -D tailscale \
"$pkgdir"/usr/bin/tailscale
install -m755 -D tailscaled \
"$pkgdir"/usr/sbin/tailscaled
install -m644 -D -t "$pkgdir"/usr/share/doc/$pkgname README.md
install -m755 -D "$srcdir"/tailscale.initd "$pkgdir"/etc/init.d/tailscale
install -m644 -D "$srcdir"/tailscale.confd "$pkgdir"/etc/conf.d/tailscale
install -m644 -D "$srcdir"/tailscale.logrotate "$pkgdir"/etc/logrotate.d/tailscale
install -m644 -D "$srcdir"/tailscale.modules-load "$pkgdir"/usr/lib/modules-load.d/tailscale.conf
}
sha512sums="
bb3abfc370f24534748b877fcf51e57bd575843d35fcde4653544f82f1437dbccd489dcf73b37e4ec194a1ea1d42e3397937b239db95512d701af8f078cc80fd tailscale-1.36.2.tar.gz
24706f10a6f5f7091c0f73a13e0c2d72e969e92e6f7aa21abe504f8e2c16af4d1d80fd28c33acbe4866dd8174abd9dc201d97eb5271f6355f7589a56f470f52c tailscale.confd
5cb35e0144d3bc2c20b1fde1ee402aab642b666c259bb324bf1c742a79fd8b3892cf2e7419e684764a50b6a29dc562ee674915bbf16a76eda543fd9c8988428c tailscale.initd
c139461ff829359bfdc66866ef4cd6561f781e2bc3b40e5cfe9c9d06e3e749d179835ee8548d2b2e725f9a59644db64b1136393dff78ae29955c905e76c8ef46 tailscale.logrotate
871b650ff982be061532b4c5fe4812f41e6e2c58fc69b24f8a745f9a43389da44e742a69b0467b3c3d9e2b031af0728e20f10fa4584695c4f5ac87768a1fd34e tailscale.modules-load
c06e1d1ff2037786b486de7e7f8073762eb0d9e25e965266c0258c221d4bdc3f484a4071c1c1a60bd930d510653c372dfc8fb0e17347259a185d3cc67c92ca44 findgo.patch
"