OCaml 4.14.0 rebuild
[arch-packages.git] / prometheus-blackbox-exporter / trunk / PKGBUILD
blobfa8811b0adee4f34531e851b7a03620e41e053cc
1 # Maintainer: Jelle van der Waa <jelle@dwaa.nl>
3 pkgname=prometheus-blackbox-exporter
4 pkgver=0.22.0
5 pkgrel=1
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 git)
12 options=(!lto)
13 backup=('etc/conf.d/prometheus-blackbox-exporter')
14 source=($pkgname-$pkgver.tar.gz::https://github.com/prometheus/blackbox_exporter/archive/v${pkgver}.tar.gz
15         prometheus-blackbox-exporter.service
16         prometheus-blackbox-exporter.conf)
17 sha512sums=('327ed9807950b72cba45ccfb06f7af869a9c083b2a5fca43b6988876e4f7f54ddc34f299dab2e22c93056f8ca8bc79083670805f65e18d2a4322fce489ef2966'
18             '72747736e4783e313acb4cb917c3311ed736d69e9b22799132b4aad46b50072f3664c6377c271e720c3e620ab2a6db48110f8d92cc62cf7674cafc32fd1fb2e4'
19             '4cf607e698801396cd7cbde9371b6bc504c7e2ad62e127bccca098222be052e2a312490d93c7ba63304defbb40bc156fc76c79097c6b71bde243d834c02ed2cd')
21 check() {
22   cd blackbox_exporter-$pkgver
23   go test ./...
26 build() {
27   cd blackbox_exporter-$pkgver
28   go build \
29     -trimpath \
30     -buildmode=pie \
31     -mod=readonly \
32     -modcacherw \
33     -ldflags "-linkmode external -extldflags ${LDFLAGS} \
34       -X github.com/prometheus/common/version.Version=$pkgver \
35       -X github.com/prometheus/common/version.Revision=$pkgver \
36       -X github.com/prometheus/common/version.Branch=tarball \
37       -X github.com/prometheus/common/version.BuildUser=someone@builder \
38       -X github.com/prometheus/common/version.BuildDate=$(date --date=@"$SOURCE_DATE_EPOCH" +%Y%m%d-%H:%M:%S)" \
39     .
42 package() {
43   install -Dm644 prometheus-blackbox-exporter.conf "$pkgdir"/etc/conf.d/prometheus-blackbox-exporter
44   install -Dm644 prometheus-blackbox-exporter.service "$pkgdir"/usr/lib/systemd/system/prometheus-blackbox-exporter.service
45   cd blackbox_exporter-$pkgver
46   install -Dm755 blackbox_exporter "$pkgdir"/usr/bin/prometheus-blackbox-exporter