arch-packages/PKGBUILD

49 lines
1.6 KiB
Text
Raw Normal View History

# Maintainer: Manuel Hüsers <aur@huesers.de>
# Contributor: Nils Czernia <nils@czserver.de>
2017-10-18 12:34:20 +02:00
pkgname=prometheus-postgresql-exporter
2020-05-20 08:35:52 +02:00
pkgver=0.8.0
2021-01-24 21:51:38 +01:00
pkgrel=3
2017-10-18 12:34:20 +02:00
pkgdesc="Prometheus exporter for PostrgreSQL"
arch=('x86_64')
2017-10-18 12:34:20 +02:00
url="https://github.com/wrouesnel/postgres_exporter"
license=('Apache')
makedepends=('git' 'go')
backup=('etc/conf.d/prometheus-postgresql-exporter')
2017-10-18 12:34:20 +02:00
source=("https://github.com/wrouesnel/postgres_exporter/archive/v${pkgver}.tar.gz"
"prometheus-postgresql-exporter.service"
"prometheus-postgresql-exporter.conf")
2020-05-20 08:35:52 +02:00
sha256sums=('27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02'
'5eac41333fb12db676fed18c02156cfdefee957154241b4c724718fd40d23212'
'5436ad34fbcd6faab69da8675631f3eb5b89d964682eb23164bf4bb816ad1897')
2017-10-18 12:34:20 +02:00
prepare() {
cd "postgres_exporter-${pkgver}"
2017-10-18 12:34:20 +02:00
export GOPATH="${srcdir}/gopath"
mkdir -p "${GOPATH}/src/github.com/wrouesnel"
ln -snf "${srcdir}/postgres_exporter-${pkgver}" "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
2017-10-18 12:34:20 +02:00
}
build() {
export GOPATH="${srcdir}/gopath"
cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
go run mage.go binary
2017-10-18 12:34:20 +02:00
}
check() {
export GOPATH="${srcdir}/gopath"
cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
go run mage.go test
2017-10-18 12:34:20 +02:00
}
package() {
install -Dm644 "prometheus-postgresql-exporter.service" \
"${pkgdir}/usr/lib/systemd/system/prometheus-postgresql-exporter.service"
install -Dm644 "prometheus-postgresql-exporter.conf" \
"${pkgdir}/etc/conf.d/prometheus-postgresql-exporter"
2017-10-18 12:34:20 +02:00
cd "postgres_exporter-${pkgver}"
install -Dm755 "postgres_exporter" "${pkgdir}/usr/bin/prometheus_postgresql_exporter"
2017-10-18 12:34:20 +02:00
}