# Maintainer: nixfloyd pkgname=prometheus-snmp-exporter _pkgname=snmp_exporter pkgver=0.24.1 pkgrel=2 pkgdesc="SNMP Exporter for Prometheus" url="https://github.com/prometheus/snmp_exporter" # riscv64: prometheus/procfs needs updating arch="all !riscv64" license="Apache-2.0" makedepends="go net-snmp-dev" install="$pkgname.pre-install" subpackages="$pkgname-doc $pkgname-openrc" source=" $pkgname-$pkgver.tar.gz::https://github.com/prometheus/snmp_exporter/archive/v$pkgver.tar.gz snmp-exporter.initd snmp-exporter.confd " builddir="$srcdir/$_pkgname-$pkgver" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { go build -o bin/snmp_exporter go build -o bin/generator ./generator } check() { go test } package() { install -Dm755 bin/snmp_exporter \ "$pkgdir"/usr/bin/snmp_exporter install -Dm755 bin/generator \ "$pkgdir"/usr/bin/snmp_exporter-generator install -Dm644 snmp.yml \ "$pkgdir"/etc/prometheus/snmp.yml install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus-snmp-exporter/ \ README.md install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus-snmp-exporter/examples/ \ generator/generator.yml install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus-snmp-exporter/generator/ \ generator/README.md install -m755 -D "$srcdir"/snmp-exporter.initd \ "$pkgdir"/etc/init.d/snmp-exporter install -m644 -D "$srcdir"/snmp-exporter.confd \ "$pkgdir"/etc/conf.d/snmp-exporter } sha512sums=" 5268129a50bd255a9505b16d27957ab2e7a23321a25933c9a1a98cd9900aef3a882a59a43d92e021dfa6e732f84f8be1fe171271935a8eac1e023588f417822e prometheus-snmp-exporter-0.24.1.tar.gz a11085f14e192ff277107dbbb12857a3043dbce1acadbbdf94a88d2b921745f9556cad3c0a81a0113349d322e02b1705831967af3ecc0f95259e759ade9ff5ad snmp-exporter.initd 489cb298e215bd9647aa5293d456106eb26a73f5fbd9d42fab68de26d273ebb612dba01ba113ce58521b543a2f82a10ad86dc35056ef8d0438b39e77be61f67e snmp-exporter.confd "