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
53
54
55
56
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=prometheus
pkgver=2.14.0
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"
builddir="$srcdir/$pkgname-$pkgver"
options="!check" # Broken by integrations we don't care about
build() {
cd "$builddir"
go build \
-gcflags "all=-trimpath=$PWD" \
-asmflags "all=-trimpath=$PWD" \
-ldflags "-extldflags $LDFLAGS" \
./cmd/prometheus
go build \
-gcflags "all=-trimpath=$PWD" \
-asmflags "all=-trimpath=$PWD" \
-ldflags "-extldflags $LDFLAGS" \
./cmd/promtool
}
check() {
cd "$builddir"
go test ./...
}
package() {
cd "$builddir"
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="077d83ef06a6ef77b6aa0d47ef0aa276f50b89c818f6cbe0163a4167d0ceb7fbcaf828a6341ba91cde303a0c6c7e2440de99ea0500a48a9059adb37a34a78a7a prometheus-2.14.0.tar.gz
82f90ef730935b9dfc67877098ab0dcada0da941e273b241826b1e9bd2474202f2df5dd976dbed016652219cf0cfd1d77b8df72367ed1ac15c6f0cc38800cac5 prometheus.confd
3eaf6183a3dcf39169383861eff0e15dba16cbd08673815bf936a55ef17803a283c871f1f4534a61d1d0349227122e64a1cf5dac1b10adc504107aba869fff1c prometheus.initd"