apkbuilds @ 3a981c0912f4e229e5a11c97230d2f57d1f01c3c

 1# Maintainer: Gabriel Arakaki Giovanini <mail@gabrielgio.me>
 2pkgname=s4o
 3pkgver=0.1.0
 4pkgrel=3
 5pkgdesc="Static server behing single sign on"
 6url="https://git.sr.ht/~gabrielgio/s4o"
 7arch="x86_64"
 8license="MIT"
 9makedepends="
10    go
11"
12builddir="$srcdir/$pkgname-v$pkgver/"
13install="$pkgname.pre-install"
14subpackages="$pkgname-openrc"
15source="
16    ${pkgname}-${pkgver}.tar.gz::https://artifacts.gabrielgio.me/archive/${pkgname}/${pkgname}-v${pkgver}.tar.gz
17"
18
19build() {
20    go mod vendor
21    go build \
22        -trimpath \
23        -mod=vendor \
24        -ldflags="-X 'main.Version=${pkgver}'" \
25        .
26}
27
28package() {
29	install -Dm755 "$pkgname" "$pkgdir"/usr/lib/"$pkgname"/"$pkgname"
30
31    mkdir -p "$pkgdir"/usr/bin
32
33    ln -s /usr/lib/"$pkgname"/"$pkgname" "$pkgdir"/usr/bin/"$pkgname"
34}
35
36sha512sums="
37bc165a49aaedd72be4df129c7db2b4f5f41c56ce3f573b35c29f8c616236eb50ef65d19e2e879c682322914c960d118b01928ee916b35afbebd205d1bf38e389  s4o-0.1.0.tar.gz
38"