2021-01-24 20:55:39 +01:00
|
|
|
# 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 20:55:39 +01:00
|
|
|
pkgrel=2
|
2017-10-18 12:34:20 +02:00
|
|
|
pkgdesc="Prometheus exporter for PostrgreSQL"
|
2021-01-24 20:55:39 +01:00
|
|
|
arch=('x86_64')
|
2017-10-18 12:34:20 +02:00
|
|
|
url="https://github.com/wrouesnel/postgres_exporter"
|
|
|
|
license=('Apache')
|
|
|
|
makedepends=('git' 'go')
|
2021-01-24 20:55:39 +01:00
|
|
|
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"
|
2021-01-24 20:55:39 +01:00
|
|
|
"prometheus-postgresql-exporter.service"
|
|
|
|
"prometheus-postgresql-exporter.conf")
|
2020-05-20 08:35:52 +02:00
|
|
|
sha256sums=('27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02'
|
2021-01-24 20:55:39 +01:00
|
|
|
'5eac41333fb12db676fed18c02156cfdefee957154241b4c724718fd40d23212'
|
|
|
|
'5436ad34fbcd6faab69da8675631f3eb5b89d964682eb23164bf4bb816ad1897')
|
2017-10-18 12:34:20 +02:00
|
|
|
|
|
|
|
prepare() {
|
2021-01-24 20:55:39 +01:00
|
|
|
cd "postgres_exporter-${pkgver}"
|
2017-10-18 12:34:20 +02:00
|
|
|
|
2021-01-24 20:55:39 +01: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() {
|
2021-01-24 20:55:39 +01:00
|
|
|
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() {
|
2021-01-24 20:55:39 +01:00
|
|
|
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() {
|
2021-01-24 20:55:39 +01:00
|
|
|
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
|
|
|
|
2021-01-24 20:55:39 +01:00
|
|
|
cd "postgres_exporter-${pkgver}"
|
|
|
|
install -Dm755 "postgres_exporter" "${pkgdir}/usr/bin/prometheus_postgresql_exporter"
|
2017-10-18 12:34:20 +02:00
|
|
|
}
|