summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a085637fda6b8363017a89634a696be1e8632df6 (plain)
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
# Maintainer: Adrian Perez de Castro <aperez@igalia.com>
pkgname=bazel-remote
pkgver=2.4.4
pkgrel=1
pkgdesc='A remote cache server for Bazel (and other build systems)'
url=https://github.com/buchgr/bazel-remote
license=(Apache-2.0)
arch=(x86_64)
makedepends=(go)
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz"
        bazel-remote.service
		bazel-remote.conf
		sysusers.conf
		tmpfiles.conf)
b2sums=('259f70b38c1f3cfc5b90917e627545a80de15d785379d7a2b5bc9a1bc0f05968ee7c6d6e0f455b07c4648f5ed48fa65c9091166eccabd12881f884ddaaaee745'
        '99940252528b14b66d1f64b6da918d126ec5d7cb480567f7941a527761970754cfa20e3928fd6041196e51d34facc48652a0ff1021926609df8715ea63be6ac4'
        '7ac4524785343a45e649806fb19e648cbc3128cb658528b20503a71cd5cf3e0e77dd6d2811f5caa467e9254dc446b9c8cbaa98f12d3139c77718d0d057d4b137'
        'f3899570f3cbe5c36344cadd3b23be36cc0e87e18c66758f64f9ae6152126c08b695311239c9833dcf6c8512eb384537805e5b9a22c1a4076073ecd1d2268184'
        '57be109368362e1d9d1203aff1c0b6851bee2172ef5a1d1a3360062cd1432cbd7d30a584551588344bb41d252efdc488e9705b7eed46ed6d0493381f7c94ba65')

_commit=54d1782d72b291937988edad32c9752abe269d8e

build () {
	cd "$pkgname-$pkgver"

	mkdir -p _build

	CGO_ENABLED=1 \
	CGO_CPPFLAGS="$CPPFLAGS" \
	CGO_CXXFLAGS="$CXXFLAGS" \
	CGO_CFLAGS="$CFLAGS" \
	CGO_LDFLAGS="$LDFLAGS" \
	GOPATH="$srcdir" \
	GOFLAGS='-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw' \
		go build -o _build -a -ldflags "-X main.gitCommit=$_commit" .
}

package () {
	cd "$pkgname-$pkgver"
	install -Dm755 -t "$pkgdir/usr/bin" _build/*
	install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
	install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname/examples" examples/*.yml
	install -Dm644 -t "$pkgdir/usr/lib/systemd/system" "$srcdir/bazel-remote.service"
	install -Dm644 "$srcdir/sysusers.conf" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
	install -Dm644 "$srcdir/tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
	install -Dm644 "$srcdir/bazel-remote.conf" "$pkgdir/etc/bazel-remote.conf"
}