1 # Maintainer: Jelle van der Waa <jelle@dwaa.nl>
3 pkgname=prometheus-memcached-exporter
6 pkgdesc="Exports metrics from memcached servers for consumption by Prometheus"
8 url="https://github.com/prometheus/memcached_exporter"
10 depends=(glibc memcached)
12 backup=('etc/conf.d/prometheus-memcached-exporter')
13 source=($pkgname-$pkgver.tar.gz::https://github.com/prometheus/memcached_exporter/archive/v${pkgver}.tar.gz prometheus-memcached-exporter.service
14 prometheus-memcached-exporter.conf)
15 sha512sums=('f504242d96c407d871e0027753ead08626031a81247086878e895fe453999573f953d5b346ebd21eb7fba4902a18d2519d565929fb53abb4f59ba30ccefd2deb'
16 '13ae8e9cc8445cffab1e51f000fbe5ca0dd2a30532f8303957dc376c8891552e719681e49ffd8a83c4cd01aca897031770c9d96ed92276ff85c2e32c4fa999ee'
17 'bc92af08207bee78a48cc764f038d6f5175b0051873f1238d90531f81d9b403085ec7ac62dfe934ee804794426c6bed4c309b374a418c9f7a4dbdbb157d58c23')
20 cd memcached_exporter-$pkgver
22 memcached -p 11211 -U 11211 >/dev/null & memcached_pids+=($!)
25 go test ./... || ret=1
27 kill ${memcached_pids[@]}
33 cd memcached_exporter-$pkgver
39 -ldflags "-linkmode external -extldflags \"${LDFLAGS}\" \
40 -X github.com/prometheus/common/version.Version=$pkgver \
41 -X github.com/prometheus/common/version.Revision=$pkgver \
42 -X github.com/prometheus/common/version.Branch=tarball \
43 -X github.com/prometheus/common/version.BuildUser=someone@builder \
44 -X github.com/prometheus/common/version.BuildDate=$(date -d=@"$SOURCE_DATE_EPOCH" +%Y%m%d-%H:%M:%S)" \
45 -o memcached_exporter cmd/memcached_exporter/main.go
49 install -Dm644 prometheus-memcached-exporter.service "$pkgdir"/usr/lib/systemd/system/prometheus-memcached-exporter.service
50 install -Dm644 prometheus-memcached-exporter.conf "${pkgdir}"/etc/conf.d/prometheus-memcached-exporter
52 cd memcached_exporter-$pkgver
53 install -Dm755 memcached_exporter "$pkgdir"/usr/bin/prometheus-memcached-exporter