apkbuilds @ 2a53753fc4006af8456c282edf88aad35fce52c7

 1# Contributor: Alex Denes <caskd@redxen.eu>
 2# Maintainer: Alex Denes <caskd@redxen.eu>
 3pkgname=prometheus-postgres-exporter
 4_pkgname=postgres_exporter
 5pkgver=0.11.1
 6pkgrel=7
 7pkgdesc="Prometheus exporter for PostgreSQL database"
 8url="https://github.com/prometheus-community/postgres_exporter"
 9license="Apache-2.0"
10arch="x86_64"
11makedepends="go>=1.14 bash sed"
12install="$pkgname.pre-install $pkgname.pre-upgrade"
13subpackages="$pkgname-openrc $pkgname-doc"
14source="$_pkgname-$pkgver.tar.gz::https://github.com/prometheus-community/postgres_exporter/archive/v$pkgver.tar.gz
15	postgres-exporter.initd
16	postgres-exporter.confd
17	disable-go-race-detector.patch
18	README.Alpine"
19builddir="$srcdir/$_pkgname-$pkgver"
20
21export GOFLAGS="$GOFLAGS -modcacherw -buildvcs=false"
22export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
23export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
24export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
25
26build() {
27	make build
28}
29
30check() {
31	make test
32}
33
34package() {
35	install -Dm755 postgres_exporter "$pkgdir"/usr/bin/postgres_exporter
36
37	install -Dm755 "$srcdir"/postgres-exporter.initd "$pkgdir"/etc/init.d/postgres-exporter
38	install -Dm644 "$srcdir"/postgres-exporter.confd "$pkgdir"/etc/conf.d/postgres-exporter
39	install -Dm644 "$srcdir"/README.Alpine "$pkgdir"/usr/share/doc/postgres-exporter/README.Alpine
40}
41
42sha512sums="
43e5bd0ddaac53a8693017a174842831a9bddd1e555b10c1cf61d12d1e9585e1cdaedece378681afdfda46ba6db53aadc10ceecaca0396a330d181d7f06f2665fc  postgres_exporter-0.11.1.tar.gz
44e083183953fee8976765a872b7e21b859a4d907ef650e0320e63da4eff388b6c7f63c82a75cbd14e8f78e06018bae6d67666ebf2451adcbe7261e30f3889125f  postgres-exporter.initd
4514646244988a670caa12eb6cb5e8bea7259c27ec5fe8d89ee6f73675348a66fdfec68cc06304fcf1ce637737c3be7c38e25824e6efe302ed99ced73021d045c3  postgres-exporter.confd
460e916a9216fbf21865a3672a1159836993048de1112dc8ddbd4e8283264d7fe12c5a5e2b08adeced2db6d4d35feb799c59eae7e55d010d045e825b4a524ae5e2  disable-go-race-detector.patch
47d4d8131a2d4787a50f4376cda01f52cc4d40e41088342db7a559e58d464fc92e3110bed542f8622259dd45990e1a95a73806310e1f80c212065e265181e22b32  README.Alpine
48"