db-move: moved webkit2gtk from [testing] to [extra] (x86_64)
[arch-packages.git] / prometheus-postgres-exporter / trunk / PKGBUILD
blob1312e5f5d3dc91cb9b93ffcd766090c058ceffdb
1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
2 # Contributor: Nils Czernia <nils@czserver.de>
4 pkgname=prometheus-postgres-exporter
5 pkgver=0.8.0
6 pkgrel=2
7 pkgdesc="Prometheus exporter for PostrgreSQL"
8 arch=('x86_64')
9 url="https://github.com/wrouesnel/postgres_exporter"
10 license=('Apache')
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')
19 prepare() {
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"
27 build() {
28   export GOPATH="${srcdir}/gopath"
29   cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
30   go build \
31     -trimpath \
32     -buildmode=pie \
33     -ldflags "-extldflags \"${LDFLAGS}\"" \
34   ./cmd/postgres_exporter
37 check() {
38   export GOPATH="${srcdir}/gopath"
39   cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
40   go test ./...
43 package() {
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"