2021-06-06 00:26:48 +00:00
|
|
|
# Maintainer: George Rawlinson <george@rawlinson.net.nz>
|
|
|
|
|
|
|
|
pkgname=prometheus-bind-exporter
|
|
|
|
_pkgname=bind_exporter
|
2023-02-24 01:48:14 +00:00
|
|
|
pkgver=0.6.0
|
2021-06-06 00:26:48 +00:00
|
|
|
pkgrel=1
|
2023-02-24 01:48:14 +00:00
|
|
|
pkgdesc='Prometheus exporter for BIND metrics'
|
2021-06-06 00:26:48 +00:00
|
|
|
arch=('x86_64')
|
2023-02-24 01:48:14 +00:00
|
|
|
url='https://github.com/prometheus-community/bind_exporter'
|
2021-06-06 00:26:48 +00:00
|
|
|
license=('Apache')
|
|
|
|
depends=('glibc')
|
|
|
|
makedepends=('go')
|
|
|
|
optdepends=('bind: for monitoring a local BIND server')
|
2023-02-24 01:48:14 +00:00
|
|
|
options=('!lto')
|
2021-06-06 00:26:48 +00:00
|
|
|
source=(
|
|
|
|
"$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
|
|
|
|
'systemd.service'
|
|
|
|
'sysusers.conf'
|
|
|
|
)
|
2023-02-24 01:48:14 +00:00
|
|
|
sha512sums=('fe909968dd6f5ddf7350ad0c284d33a896beaedd755d0073f90c5d79c093a43527e339f8600b51a1faf7fb50d1a5ef561c482983d8eeaa1a8001b8fc43353005'
|
2021-11-24 06:55:22 +00:00
|
|
|
'8c22cfadddd8820258e02f53253de78cc1707f6220da13f36e682b79d58a3b59ef615b3f0c74ced01bcb6afb19c35414821575d265227512f5192182aca2d042'
|
|
|
|
'143591ed6c2550085a2ab5c292aa57a6ab047826158270c630acaf1dd1afc9e3cbccb612f0b684206832c8d641eb432bf4f474dd07b9dc744cfd7174d320b552')
|
2023-02-24 01:48:14 +00:00
|
|
|
b2sums=('7c680a6dbf5681bf1ad718ae79d88d1a7438939ce47c76ab304f40f2ffa9427ffb349104569cd6e67a61b22524db09fabd2982247abdf2726994332c61b845ef'
|
2021-06-06 00:26:48 +00:00
|
|
|
'83ac2fb9b39f10f9eb130fc566887a5dc70447265d9d567221ceccf83a9fe7ad8035dfa751ecefe9681c64fd8ddb260b3e370f956350b9cab699eed507d9affc'
|
|
|
|
'739b1e4e7ab277096d0875ed14d61f223e7b990e7081721e4638aebad9c3beccc270ce9944384784af8eab035dbb34a86badae687c065291bfb384abfb42573a')
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "$_pkgname-$pkgver"
|
|
|
|
|
|
|
|
# create folder for build output
|
|
|
|
mkdir build
|
|
|
|
|
|
|
|
# download dependencies
|
2021-11-24 06:55:22 +00:00
|
|
|
go mod download
|
2021-06-06 00:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$_pkgname-$pkgver"
|
|
|
|
go build -v \
|
|
|
|
-buildmode=pie \
|
|
|
|
-trimpath \
|
2021-11-24 06:55:22 +00:00
|
|
|
-mod=readonly \
|
2021-06-06 00:26:48 +00:00
|
|
|
-modcacherw \
|
|
|
|
-ldflags "-linkmode external -extldflags ${LDFLAGS} \
|
|
|
|
-X github.com/prometheus/common/version.Version=$pkgver \
|
|
|
|
-X github.com/prometheus/common/version.Revision=$pkgver \
|
|
|
|
-X github.com/prometheus/common/version.Branch=tarball \
|
|
|
|
-X github.com/prometheus/common/version.BuildUser=someone@builder \
|
|
|
|
-X github.com/prometheus/common/version.BuildDate=$(date -d@"$SOURCE_DATE_EPOCH" +%Y%m%d-%H:%M:%S)" \
|
|
|
|
-o build .
|
|
|
|
}
|
|
|
|
|
2023-02-24 01:48:14 +00:00
|
|
|
#check() {
|
|
|
|
# cd "$_pkgname-$pkgver"
|
|
|
|
# go test ./...
|
|
|
|
#}
|
2021-06-06 00:26:48 +00:00
|
|
|
|
|
|
|
package() {
|
|
|
|
# systemd integration
|
|
|
|
install -Dm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
|
|
|
|
install -Dm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
|
|
|
|
|
|
|
|
# binary
|
|
|
|
install -Dm755 -t "$pkgdir/usr/bin" "$_pkgname-$pkgver/build/$_pkgname"
|
|
|
|
}
|