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
|
2021-04-02 15:07:13 +02:00
|
|
|
pkgver=0.9.0
|
|
|
|
pkgrel=1
|
|
|
|
pkgdesc="Prometheus exporter for PostgreSQL"
|
2021-01-24 20:55:39 +01:00
|
|
|
arch=('x86_64')
|
2021-04-02 15:07:13 +02:00
|
|
|
url="https://github.com/prometheus-community/postgres_exporter"
|
2017-10-18 12:34:20 +02:00
|
|
|
license=('Apache')
|
2021-04-02 15:07:13 +02:00
|
|
|
makedepends=('git' 'go' 'make')
|
2021-01-24 20:55:39 +01:00
|
|
|
backup=('etc/conf.d/prometheus-postgresql-exporter')
|
2021-04-02 15:07:13 +02:00
|
|
|
source=("https://github.com/prometheus-community/postgres_exporter/archive/v${pkgver}.tar.gz"
|
2021-01-24 20:55:39 +01:00
|
|
|
"prometheus-postgresql-exporter.service"
|
|
|
|
"prometheus-postgresql-exporter.conf")
|
2021-04-02 15:07:13 +02:00
|
|
|
sha256sums=('a92d30e9952dfb3387ef2a636d19891e226c396f769729431dac0bddc3f0b29e'
|
2021-01-24 21:56:58 +01:00
|
|
|
'0d86e650d88c8d4a8bc5b26faecb75023e069eaf29582135bcb0202e4a69a9b9'
|
2021-01-24 20:55:39 +01:00
|
|
|
'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"
|
2021-04-02 15:07:13 +02:00
|
|
|
mkdir -p "${GOPATH}/src/github.com/prometheus-community"
|
|
|
|
ln -snf "${srcdir}/postgres_exporter-${pkgver}" "${GOPATH}/src/github.com/prometheus-community/postgres_exporter"
|
2017-10-18 12:34:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2021-01-24 20:55:39 +01:00
|
|
|
export GOPATH="${srcdir}/gopath"
|
2021-04-02 15:07:13 +02:00
|
|
|
cd "${GOPATH}/src/github.com/prometheus-community/postgres_exporter"
|
|
|
|
make build
|
2017-10-18 12:34:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2021-01-24 20:55:39 +01:00
|
|
|
export GOPATH="${srcdir}/gopath"
|
2021-04-02 15:07:13 +02:00
|
|
|
cd "${GOPATH}/src/github.com/prometheus-community/postgres_exporter"
|
|
|
|
make 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
|
|
|
}
|