db-move: moved polari from [testing] to [extra] (x86_64)
[arch-packages.git] / prometheus-blackbox-exporter / trunk / PKGBUILD
blob8d0267b95800691cf0c366b2b40806b06d8c3cf1
1 # Maintainer: Jelle van der Waa <jelle@dwaa.nl>
3 pkgname=prometheus-blackbox-exporter
4 pkgver=0.23.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=('64b9617ef7b041e830d88ca58cab8774dc3e6aceb58fbc11bd4a07c2defbe3d7117523347d61a50269d2b189ec156dadb05cedc6d7a510aceec7ff3c79715b4f'
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