upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / prometheus-bird-exporter / trunk / PKGBUILD
bloba8602cb2c78cf11a4541f6b96b8c9461b3b4eedb
1 # Maintainer: Tim Meusel <tim@bastelfreak.de>
3 pkgname=prometheus-bird-exporter
4 pkgver=1.4.1
5 pkgrel=1
6 pkgdesc='Exporter for bird metrics'
7 url='https://github.com/czerwonk/bird_exporter'
8 arch=('x86_64')
9 license=('Apache')
11 depends=('glibc')
12 makedepends=('go' 'git')
13 options=('!lto')
15 backup=('etc/conf.d/prometheus-bird-exporter')
17 source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz"
18         prometheus-bird-exporter.conf
19         prometheus-bird-exporter.service
20         prometheus-bird-exporter.sysusers)
22 sha512sums=('54a59acb163962d9adefe96b8e64ee20871caaea2e5bfa755da473a5c1c58bd245c27fa13c4f039c6f0aa52eaba056c6705c493d5b614a6c7905241c58aec552'
23             'b00b3db72e3389b7da3f68927951a87d76d937e81c6d35d0ccb7f091fb57bbe11feceb8626301b86f2e0c7be353282c3abfa4c5f2379c9e1e12a963074945411'
24             'c3cba590d4a69372fbecda3e383f15c8492f8f2d8dc47f676513ffcabda4520f2b13a8dd368e2c271249d552a30ff79d28df6e173af729816751d9204feae211'
25             '1a57390a23ce7021f2f40992f0a3c63c044e150621da8d34576eb81c0ecbe4411bb80a6e5e792a8aefffaf67d59b3df585304d2dc328046b9bc7fe033c82fe23')
27 build() {
28   cd "bird_exporter-${pkgver}"
30   go build \
31     -trimpath \
32     -buildmode=pie \
33     -mod=readonly \
34     -modcacherw \
35     -ldflags "-linkmode external -extldflags ${LDFLAGS} \
36       -X github.com/prometheus/common/version.Version=${pkgver} \
37       -X github.com/prometheus/common/version.Revision=${pkgver} \
38       -X github.com/prometheus/common/version.Branch=tarball \
39       -X github.com/prometheus/common/version.BuildUser=someone@builder \
40       -X github.com/prometheus/common/version.BuildDate=$(date -d=@"$SOURCE_DATE_EPOCH" +%Y%m%d-%H:%M:%S)" \
41     .
44 check() {
45   cd "bird_exporter-${pkgver}"
47   #make collector/fixtures/sys/.unpacked
48   #go test ./...
49   go test ./... -v -covermode=count
50   #./end-to-end-test.sh
53 package () {
54   install -Dm644 prometheus-bird-exporter.conf "$pkgdir"/etc/conf.d/prometheus-bird-exporter
55   install -Dm644 prometheus-bird-exporter.service "$pkgdir"/usr/lib/systemd/system/prometheus-bird-exporter.service
56   install -Dm644 prometheus-bird-exporter.sysusers "$pkgdir"/usr/lib/sysusers.d/prometheus-bird-exporter.conf
58   cd bird_exporter-$pkgver
60   install -Dm755 bird_exporter "$pkgdir"/usr/bin/prometheus-bird-exporter
62   install -Dm 644 README.md Dockerfile examples/kubernetes/daemonset.yaml -t "${pkgdir}/usr/share/doc/${pkgname}"
63   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"