~dricottone/huttese-apk

e563dbf3e953b429a47690aae2703b650a704cb1 — Drew DeVault 4 years ago d942cde
prom-aggregation-gateway: new aport
A sr.ht/prom-aggregation-gateway/APKBUILD => sr.ht/prom-aggregation-gateway/APKBUILD +44 -0
@@ 0,0 1,44 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=prom-aggregation-gateway
_commit=2912c3f9fadb640217f4b004e41737fef2b4ae36
pkgver=0_git20200204
pkgrel=0
pkgdesc="An aggregating push gateway for Prometheus"
url="https://github.com/weaveworks/prom-aggregation-gateway"
arch="all"
license="LGPL-3.0-only"
install="prom-aggregation-gateway.pre-install"
makedepends="go"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/weaveworks/prom-aggregation-gateway/archive/$_commit.tar.gz
	prom-aggregation-gateway.confd
	prom-aggregation-gateway.initd
"
subpackages="$pkgname-openrc"
builddir="$srcdir/$pkgname-$_commit"

build() {
	go mod init github.com/weaveworks/prom-aggregation-gateway
	go build \
		-trimpath \
		-mod=vendor \
		-ldflags "-extldflags $LDFLAGS" \
		./cmd/prom-aggregation-gateway
}

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

package() {
	install -Dm755 prom-aggregation-gateway "$pkgdir"/usr/bin/prom-aggregation-gateway

	install -Dm644 "$srcdir"/prom-aggregation-gateway.confd \
		"$pkgdir"/etc/conf.d/prom-aggregation-gateway
	install -Dm755 "$srcdir"/prom-aggregation-gateway.initd \
		"$pkgdir"/etc/init.d/prom-aggregation-gateway
}

sha512sums="1ed2919d05b6f5bdd9d748abc76c69066bc8258da7501d52050f479cd25cd165eaa17c5bb222b7c1f8ecb71829a27dddb0cf526bef03064432f9d4f81665e90c  prom-aggregation-gateway-0_git20200204.tar.gz
51986d7caf241a52e81b2a43bb136fbe7110667ba8b75047feaeb3b0e02f82ee3be0e7b91bd795bd49d77bba5a7ac36aeec5a0f35b29c368e83527e77a94fe3c  prom-aggregation-gateway.confd
5fcfad70369189b5628fe80f08ab3e9cea029fc291b18606769ad14818330ea8157d9a7d68893a73b891118ea7dcea7c9980698c7a578f5f1ca1637e3699ac7d  prom-aggregation-gateway.initd"

A sr.ht/prom-aggregation-gateway/prom-aggregation-gateway.confd => sr.ht/prom-aggregation-gateway/prom-aggregation-gateway.confd +4 -0
@@ 0,0 1,4 @@
prom_aggregation_gateway_bind_address=':9092'

output_log=/var/log/prom-aggregation-gateway.log
error_log=/var/log/prom-aggregation-gateway.log

A sr.ht/prom-aggregation-gateway/prom-aggregation-gateway.initd => sr.ht/prom-aggregation-gateway/prom-aggregation-gateway.initd +15 -0
@@ 0,0 1,15 @@
#!/sbin/openrc-run
name="prom-aggregation-gateway"
description="An aggregating push gateway for Prometheus"
supervisor=supervise-daemon
command=/usr/bin/prom-aggregation-gateway
command_args="-listen=$prom_aggregation_gateway_bind_address"
command_user="prometheus:prometheus"
pidfile="/run/${RC_SVCNAME}.pid"

start_pre() {
	[ -n "$output_log" ] && checkpath -f "$output_log" \
		-m 644 -o prometheus:prometheus
	[ -n "$error_log" ] && checkpath -f "$error_log" \
		-m 644 -o prometheus:prometheus
}

A sr.ht/prom-aggregation-gateway/prom-aggregation-gateway.pre-install => sr.ht/prom-aggregation-gateway/prom-aggregation-gateway.pre-install +4 -0
@@ 0,0 1,4 @@
#!/bin/sh
grep '^prometheus:' /etc/group >/dev/null || addgroup -S prometheus 2>/dev/null
grep '^prometheus:' /etc/passwd >/dev/null || adduser -SDh/var/lib/prometheus \
	-s/sbin/nologin -Gprometheus -gprometheus prometheus prometheus 2>/dev/null