archrelease: copy trunk to extra-x86_64
[arch-packages.git] / nginx-prometheus-exporter / trunk / PKGBUILD
blob0b439f92c1b1193c354ccb7cd8f577b1a21b3b8f
1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
3 pkgname=nginx-prometheus-exporter
4 pkgdesc='NGINX Prometheus Exporter for NGINX and NGINX Plus'
5 pkgver=0.11.0
6 pkgrel=1
7 arch=(x86_64)
8 license=('Apache')
9 url="https://github.com/nginxinc/nginx-prometheus-exporter"
10 depends=(glibc)
11 makedepends=(go)
12 source=(${pkgname}-${pkgver}.tar.gz::https://github.com/nginxinc/nginx-prometheus-exporter/archive/v${pkgver}.tar.gz
13         nginx-prometheus-exporter.service
14         nginx-prometheus-exporter.conf)
15 sha512sums=('2b6395179b901a7fc018cb2793c16fdb2c966f633aa8025dd546b1f0264c777b340c320589dd4d0e7469fcb45a6addd7bdb63b9ccbc373650bcaf690417f3a74'
16             'd29541b1afe15bfe90ac9d54f0771ade4c8cd9d4291d0a9b1e9ffb4f38f1ae3739bef79a0120ca7c79ea5b580d224b09e9ca7645c92d8c4bc991532759249bb5'
17             '843d6903c8da8356cef0c53722c176f5ed12d140a2888f3f3cf5dedaf6437fdc3c0a527ba6635bd949b28a64af98221aeb5caa13edb12b05a712c6e2aadddf77')
19 build() {
20   cd "$pkgname-$pkgver"
21   go build \
22     -trimpath \
23     -buildmode=pie \
24     -mod=readonly \
25     -modcacherw \
26     -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"  -X main.version=${pkgver} -X main.gitCommit=${pkgver}" \
27     .
30 check() {
31   cd "$pkgname-$pkgver"
32   go test ./... 
35 package() {
36   install -Dm644 nginx-prometheus-exporter.service "$pkgdir"/usr/lib/systemd/system/nginx-prometheus-exporter.service
37   install -Dm644 nginx-prometheus-exporter.conf "${pkgdir}"/etc/conf.d/nginx-prometheus-exporter
39   cd "$pkgname-$pkgver"
40   install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname