# Maintainer: Stefan Husmann # Contributor: Aaron Schaefer pkgname=consul-exporter pkgver=0.2.0.r18.g673081d pkgrel=1 pkgdesc="Export Consul service health to Prometheus." arch=('i686' 'x86_64') url="https://github.com/prometheus/consul_exporter" license=('custom') depends=('glibc' 'sh' 'go') source=( "$pkgname::git+https://github.com/prometheus/consul_exporter.git" "01-golang1_6.patch" "consul-exporter.service" "consul-exporter.install") install=consul-exporter.install sha512sums=('SKIP' '44c3236cc5925c89dce5af1e8620fceee8f2f0c3bcaccb3530865d25b9a67d9d2898d07f9782a6da9344e867a5f537285e8697aacfa05c19f96e705f167aeb4a') pkgver() { cd "$srcdir/$pkgname" git describe --long --tags | sed -r 's/^go//;s/([^-]*-g)/r\1/;s/-/./g' } prepare(){ cd "$srcdir/$pkgname" patch -p1 -i "$srcdir/01-golang1_6.patch" mkdir -p "${srcdir}/gopath" export GOPATH="${srcdir}/gopath" } build() { cd ${srcdir}/${pkgname} make } package() { cd ${srcdir}/${pkgname} install -D -m755 consul_exporter ${pkgdir}/usr/bin/${pkgname} mkdir -p "${pkgdir}/usr/lib/systemd/system/" install -pm 644 "${srcdir}/consul-exporter.service" "${pkgdir}/usr/lib/systemd/system/consul-exporter.service" }