archrelease: copy trunk to extra-x86_64
[arch-packages.git] / prometheus-blackbox-exporter / repos / community-x86_64 / PKGBUILD
blobaf226f973447e23180b0d3056012c9bebc5d3eaa
1 # Maintainer: Jelle van der Waa <jelle@dwaa.nl>
3 pkgname=prometheus-blackbox-exporter
4 pkgver=0.15.1
5 pkgrel=2
6 pkgdesc="Allows blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP"
7 arch=('x86_64')
8 url="https://github.com/prometheus/blackbox_exporter"
9 license=('Apache')
10 depends=(glibc)
11 makedepends=(go-pie git)
12 source=(https://github.com/prometheus/blackbox_exporter/archive/v${pkgver}.tar.gz prometheus-blackbox-exporter.service)
13 sha512sums=('2c7d0989bc70982a0fd528c7c6ed5ec6686f5e93db0a90db2b06e4e578503443da0750aaa2d6a01ae4fcd4c722eef522c0e06b019aa59a2eb837f233e317d4e2'
14             'd50d40d3b8de03967a467db5d0ead3f8a9c770464c6028580022b60651384075d9437a3efb98b6f8d5e6df967ade09f839552e8d67c254d590016fc51b11def9')
16 check() {
17   cd blackbox_exporter-$pkgver
18   go test ./...
21 build() {
22   cd blackbox_exporter-$pkgver
23   go build \
24     -gcflags "all=-trimpath=${PWD}" \
25     -asmflags "all=-trimpath=${PWD}" \
26     -ldflags "-extldflags ${LDFLAGS} \
27       -X github.com/prometheus/common/version.Version=$pkgver \
28       -X github.com/prometheus/common/version.Revision=$pkgver \
29       -X github.com/prometheus/common/version.Branch=tarball \
30       -X github.com/prometheus/common/version.BuildUser=someone@builder \
31       -X github.com/prometheus/common/version.BuildDate=$(date -d@"$SOURCE_DATE_EPOCH" +%Y%m%d-%H:%M:%S)" \
32     .
35 package() {
36   install -Dm644 prometheus-blackbox-exporter.service "$pkgdir"/usr/lib/systemd/system/prometheus-blackbox-exporter.service
37   cd blackbox_exporter-$pkgver
38   install -Dm755 blackbox_exporter "$pkgdir"/usr/bin/prometheus-blackbox-exporter