aboutsummaryrefslogtreecommitdiffstats
path: root/community/consul-template/APKBUILD
blob: 8f2665833b8c3b5071353088516d2b01c2112d2f (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
# Contributor: Gennady Feldman <gena01@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=consul-template
pkgver=0.29.0
pkgrel=6
pkgdesc="Generic template rendering and notifications with Consul"
url="https://www.consul.io/"
arch="all"
license="MPL-2.0"
makedepends="go"
options="!check"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/consul-template/archive/refs/tags/v$pkgver.tar.gz
	consul-template.hcl
	consul-template.initd
	"

build() {
	CGO_ENABLED="0" go build -a -v -o bin/$pkgname \
		-ldflags "-s -w
			-X github.com/hashicorp/$pkgname/version.Name=$pkgname \
			-X github.com/hashicorp/$pkgname/version.GitCommit=$pkgver"
}

package() {
	# Main binary
	install -m750 -D bin/$pkgname "$pkgdir"/usr/sbin/$pkgname
	install -Dm644 "$srcdir"/consul-template.hcl "$pkgdir"/etc/"$pkgname"/"$pkgname".hcl
	install -Dm755 "$srcdir"/consul-template.initd "$pkgdir"/etc/init.d/"$pkgname"
}

cleanup_srcdir() {
	[ -d src ] && chmod -R +w src
	default_cleanup_srcdir
}

sha512sums="
e562d89c753ca2bbd14ae57e084e7e2b0aac28c92c210357e22d32d5c3c138054a46f5fb8883a44f64bdd8e9654f457230cef3b24513fa7eeaefd177fd8004c7  consul-template-0.29.0.tar.gz
bfb5c7eed53cfe45d9e03eeb68eb454d2f47a47402a99b008895c261389160d611ab72903cdfb98e99a88749e0fd00733a9fad70b9def9af35657cba12987ea9  consul-template.hcl
d8465a24ca721d57677a25f3f988f37f78147aae83d00c9055663cbd76734a490233691827561138bd02f10067c94c309fb8a0c3473c3b361edb4faa7005fbcb  consul-template.initd
"