# Contributor: Patrycja Rosa # Maintainer: Patrycja Rosa pkgname=headscale pkgver=0.22.3 pkgrel=1 pkgdesc="Open source, self-hosted implementation of the Tailscale control server" url="https://github.com/juanfont/headscale" arch="all !ppc64le !riscv64" # go build fails license="BSD-3-Clause" pkgusers="headscale" pkggroups="headscale" makedepends="go" subpackages="$pkgname-openrc" install="$pkgname.pre-install" source="https://github.com/juanfont/headscale/archive/v$pkgver/headscale-$pkgver.tar.gz headscale.initd " options="net" # fetch dependencies export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" prepare() { default_prepare # move socket to a subdirectory to allow running as non-root sed -i 's|/var/run/headscale.sock|/run/headscale/headscale.sock|' config-example.yaml } build() { go build -ldflags "-X github.com/juanfont/headscale/cmd/headscale/cli.Version=v$pkgver" ./cmd/headscale } check() { go test ./... } package() { install -Dm755 headscale "$pkgdir"/usr/bin/headscale install -Dm755 "$srcdir"/headscale.initd "$pkgdir"/etc/init.d/headscale install -Dm644 config-example.yaml "$pkgdir"/etc/headscale/config.yaml } sha512sums=" c3ce7ae023dd0bd5c52e00ec2564b68eb87074a804a9982a3eb6f1e64335621a312cbb650d79571e89bef3f0d8e6d602b732156aa8851b67dfd455ac1156b311 headscale-0.22.3.tar.gz 0800829bfc087af283afc117406324a0129b30b587c8cc5df85e147ac09fc879d726fc2d0b62ed545fb0190ed887641f07256745da9dea56932dd2d90aa41625 headscale.initd "