summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO20
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD40
-rw-r--r--headscale.service14
-rw-r--r--headscale.sysusers1
-rw-r--r--headscale.tmpfiles2
6 files changed, 45 insertions, 33 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2fb5fa437e3a..f489ac68f714 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,19 +1,23 @@
pkgbase = headscale
pkgdesc = An open source, self-hosted implementation of the Tailscale coordination server.
- pkgver = 0.14.0
+ pkgver = 0.22.3
pkgrel = 1
url = https://github.com/juanfont/headscale
- arch = any
+ arch = x86_64
+ arch = armv7h
+ arch = aarch64
license = BSD
makedepends = go
- depends = tailscale
+ depends = glibc
optdepends = wireguard-tools: CLI tools for generating keys
optdepends = postgresql: alternative database provider
- conflicts = headscale-git
backup = etc/headscale/config.yaml
- source = headscale-0.14.0.tar.gz::https://github.com/juanfont/headscale/archive/refs/tags/v0.14.0.tar.gz
- source = headscale.service
- sha256sums = aabbc69c7ba1c3da70a34256fe53e8bb3897b19fb70ff03dfc01f06847a11e93
- sha256sums = 000457ad0cfaca8513c0f1be5b0a04beb673576e019c7184e5fb3a78e57738ab
+ backup = etc/headscale/derp.yaml
+ source = headscale-0.22.3.tar.gz::https://github.com/juanfont/headscale/archive/refs/tags/v0.22.3.tar.gz
+ source = headscale.sysusers
+ source = headscale.tmpfiles
+ sha256sums = ee408065c879fc5148a10050d663f93148eccdd6bf59d3b953673a36eaad4070
+ sha256sums = 059353f4843dec6eb447c567fac890ef63cc9c8acea18840fcfc3f4a76d596db
+ sha256sums = 8a22d7193ceeac0be32725cf8108f963be3a21855e6099de964f810094d0adc7
pkgname = headscale
diff --git a/.gitignore b/.gitignore
index 832a2faf833b..b882116f824b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
/src
/headscale
/*.pkg.tar.*
+/*.gz
diff --git a/PKGBUILD b/PKGBUILD
index d5616c512f6e..652c0f486f88 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,36 +1,54 @@
+# Maintainer: Matt Harrison <matt@harrison.us.com>
+# Maintained at: https://github.com/matt-h/aur-pkgbuilds
+
pkgname=headscale
-pkgver=0.14.0
+pkgver=0.22.3
pkgrel=1
pkgdesc="An open source, self-hosted implementation of the Tailscale coordination server."
-arch=('any')
+arch=('x86_64' 'armv7h' 'aarch64')
url="https://github.com/juanfont/headscale"
license=('BSD')
-depends=('tailscale')
+depends=('glibc')
makedepends=('go')
optdepends=(
'wireguard-tools: CLI tools for generating keys'
'postgresql: alternative database provider'
)
-conflicts=("${pkgname}-git")
-backup=("etc/${pkgname}/config.yaml")
+backup=("etc/${pkgname}/config.yaml" "etc/${pkgname}/derp.yaml")
source=(
"${pkgname}-${pkgver}.tar.gz::https://github.com/juanfont/headscale/archive/refs/tags/v${pkgver}.tar.gz"
- 'headscale.service'
+ 'headscale.sysusers'
+ 'headscale.tmpfiles'
)
-sha256sums=('aabbc69c7ba1c3da70a34256fe53e8bb3897b19fb70ff03dfc01f06847a11e93'
- '000457ad0cfaca8513c0f1be5b0a04beb673576e019c7184e5fb3a78e57738ab')
+sha256sums=('ee408065c879fc5148a10050d663f93148eccdd6bf59d3b953673a36eaad4070'
+ '059353f4843dec6eb447c567fac890ef63cc9c8acea18840fcfc3f4a76d596db'
+ '8a22d7193ceeac0be32725cf8108f963be3a21855e6099de964f810094d0adc7')
build() {
- cd "${srcdir}/${pkgname}-${pkgver}"
- go build -v -o headscale -ldflags "-s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=${pkgver}" ./cmd/headscale
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
+ go build -v -o headscale -tags="ts2019" -ldflags "-linkmode external -extldflags \"${LDFLAGS}\" -s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=${pkgver}" ./cmd/headscale
}
package() {
cd "$srcdir/${pkgname}-${pkgver}"
install -D -m755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+
install -D -m644 "config-example.yaml" "${pkgdir}/etc/${pkgname}/config.yaml"
+ install -D -m644 "config-example.yaml" "${pkgdir}/usr/share/${pkgname}/config-example.yaml"
+
+ install -D -m644 "derp-example.yaml" "${pkgdir}/etc/${pkgname}/derp.yaml"
+ install -D -m644 "derp-example.yaml" "${pkgdir}/usr/share/${pkgname}/derp-example.yaml"
+
+ install -D -m644 "${srcdir}/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
+ install -D -m644 "${srcdir}/${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
+
install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- install -D -m644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+ install -D -m644 "docs/packaging/headscale.systemd.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
}
diff --git a/headscale.service b/headscale.service
deleted file mode 100644
index 8645af4c8b60..000000000000
--- a/headscale.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=Headscale server
-After=network.target
-
-[Service]
-Type=simple
-RemainAfterExit=yes
-Environment=GIN_MODE=release
-ExecStart=/usr/bin/headscale serve
-ExecReload=/bin/kill -HUP $MAINPID
-Restart=on-failure
-
-[Install]
-WantedBy=multi-user.target
diff --git a/headscale.sysusers b/headscale.sysusers
new file mode 100644
index 000000000000..a9238cceba1c
--- /dev/null
+++ b/headscale.sysusers
@@ -0,0 +1 @@
+u headscale - "Headscale user"
diff --git a/headscale.tmpfiles b/headscale.tmpfiles
new file mode 100644
index 000000000000..7c49e08fa752
--- /dev/null
+++ b/headscale.tmpfiles
@@ -0,0 +1,2 @@
+d /var/lib/headscale 0750 headscale headscale
+h /var/lib/headscale - - - - +C