1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
2 # Contributor: Nils Czernia <nils@czserver.de>
4 pkgname=prometheus-postgres-exporter
7 pkgdesc="Prometheus exporter for PostrgreSQL"
9 url="https://github.com/wrouesnel/postgres_exporter"
11 makedepends=('git' 'go')
12 source=(${pkgname}-${pkgver}.tar.gz::https://github.com/wrouesnel/postgres_exporter/archive/v${pkgver}.tar.gz
13 "prometheus-postgres-exporter.service"
14 "prometheus-postgres-exporter.conf")
15 sha256sums=('27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02'
16 '5361f16ddf02d0c43665884674e9a3049cf6da8ac3a19eb7dba154354853eda6'
17 'd132e8140c147f3a26fdff648c4e4e59b80225a7ee10195b9e460e224316e556')
20 cd "${srcdir}/postgres_exporter-${pkgver}"
22 export GOPATH="${srcdir}/gopath"
23 mkdir -p "${GOPATH}/src/github.com/wrouesnel"
24 ln -snf "${srcdir}/postgres_exporter-${pkgver}" "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
28 export GOPATH="${srcdir}/gopath"
29 cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
33 -ldflags "-extldflags \"${LDFLAGS}\"" \
34 ./cmd/postgres_exporter
38 export GOPATH="${srcdir}/gopath"
39 cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
44 install -Dm755 ${srcdir}/prometheus-postgres-exporter.service "${pkgdir}/usr/lib/systemd/system/prometheus-postgres-exporter.service"
45 install -Dm600 ${srcdir}/prometheus-postgres-exporter.conf "${pkgdir}/etc/conf.d/prometheus-postgres-exporter"
47 install -Dm755 "postgres_exporter-${pkgver}/postgres_exporter" "${pkgdir}/usr/bin/prometheus-postgres-exporter"