aboutsummaryrefslogtreecommitdiffstats
path: root/community/prometheus/APKBUILD
blob: b89bd388f78b06b31d9e8188b1266edcf79c70dd (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
48
49
50
51
52
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=prometheus
pkgver=2.15.1
pkgrel=0
pkgdesc="The Prometheus monitoring system and time series database"
url="https://github.com/prometheus/prometheus"
arch="all"
license="Apache-2.0"
install="prometheus.pre-install"
makedepends="go"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/prometheus/prometheus/archive/v$pkgver.tar.gz
	prometheus.confd
	prometheus.initd
"
subpackages="$pkgname-openrc"
options="!check" # Broken by integrations we don't care about

build() {
	go build \
		-trimpath \
		-mod=vendor \
		-ldflags "-extldflags $LDFLAGS" \
		./cmd/prometheus
	go build \
		-trimpath \
		-mod=vendor \
		-ldflags "-extldflags $LDFLAGS" \
		./cmd/promtool
}

check() {
	go test ./...
}

package() {
	install -Dm755 prometheus "$pkgdir"/usr/bin/prometheus
	install -Dm755 promtool "$pkgdir"/usr/bin/promtool

	install -Dm644 "$srcdir"/prometheus.confd \
		"$pkgdir"/etc/conf.d/prometheus
	install -Dm755 "$srcdir"/prometheus.initd \
		"$pkgdir"/etc/init.d/prometheus
	install -dm644 "$pkgdir"/var/lib/prometheus/data

	install -Dm644 -t "$pkgdir"/etc/prometheus \
		documentation/examples/prometheus.yml
}

sha512sums="b08dfa48bddb6e007cd0fd4553847e824d6adfc047d97151b8dd12dbd1f67cfb9301824b320f1cabe9644159e6968b3fd2ee8104a5d53822a9965423c4bb47b5  prometheus-2.15.1.tar.gz
6e0edcae0c64b319926b2cbe92b59be51b00fde15f83098bfe9f622a71d60598aa87d26aaec802716ace17e399900cb05b106087ab28e5dd4eff5106c0f1cbfc  prometheus.confd
e747fa8d806ef9cdf224d63f9802646985b812aaddfd9b6fcc453348f810fec8cce30605f9bbd709809cb66b4638903623a1284efdbdf09725135cc956165475  prometheus.initd"