# Contributor: Tiago Ilieve # Maintainer: Tiago Ilieve pkgname=prometheus-node-exporter _pkgname=node_exporter pkgver=1.6.0 pkgrel=2 pkgdesc="Prometheus exporter for machine metrics" url="https://github.com/prometheus/node_exporter" license="Apache-2.0" arch="all" makedepends="go>=1.14 bash sed" install="$pkgname.pre-install $pkgname.pre-upgrade" subpackages="$pkgname-openrc" source="$_pkgname-$pkgver.tar.gz::https://github.com/prometheus/node_exporter/archive/v$pkgver.tar.gz node-exporter.initd node-exporter.confd disable-go-race-detector.patch " builddir="$srcdir/$_pkgname-$pkgver" # secfixes: # 1.5.0-r0: # - CVE-2022-46146 export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { go build \ -ldflags "-X github.com/prometheus/common/version.Version=$pkgver" \ -v -o node_exporter } check() { make test } package() { install -Dm755 node_exporter "$pkgdir"/usr/bin/node_exporter install -Dm755 "$srcdir"/node-exporter.initd "$pkgdir"/etc/init.d/node-exporter install -Dm644 "$srcdir"/node-exporter.confd "$pkgdir"/etc/conf.d/node-exporter } cleanup_srcdir() { go clean -modcache default_cleanup_srcdir } sha512sums=" 50082d4132a25d6a3b70b9b3f4633bf3ea99b6cad6b1d536fa5fc072f9b9e1888387d700a59ce6e6d5c37ff6697e7ee0484e552e13b7fea26333c6cd796ed9ce node_exporter-1.6.0.tar.gz 67b16a002daf45893e7d814e6d921f92dfc26d31ea802a4c511dc3affd8143d3827b7d895bb3efc13337894a893f4feac01d2a0f0e381ef53d00dffe9ff0577a node-exporter.initd 592d3f17a3cf487d97a14c803dded07d2dfb112b159ab1a3575310fc0176fc3255ddad6657f16a8d6d3c161bfb03c203a6271ec6e6395b75716a14b0de8baced node-exporter.confd 36952039e5db39aa06a2ca16fa5d318f22eb967e3e9b1363508b2f3d3d0b14e5df111c77ce951bea2f65dd2be0a0a1582be245acfe4641623381a940204e53d9 disable-go-race-detector.patch "