# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=prometheus-node-exporter
pkgver=0.17.0
pkgrel=0
pkgdesc="prometheus exporter for machine metrics"
url="https://github.com/prometheus/node_exporter"
arch="all"
license="Apache-2.0"
makedepends="go"
source="
$pkgname-$pkgver.tar.gz::https://github.com/prometheus/node_exporter/archive/v$pkgver.tar.gz
prometheus-node-exporter.initd
"
subpackages="$pkgname-openrc"
builddir="$srcdir/node_exporter-$pkgver"
build() {
cd "$builddir"
go build
}
check() {
cd "$builddir"
go test
}
package() {
cd "$builddir"
mkdir -p "$pkgdir"/usr/bin
mkdir -p "$pkgdir"/etc/init.d
install -Dm755 node_exporter "$pkgdir"/usr/bin/prometheus_node_exporter
install -Dm755 "$srcdir"/prometheus-node-exporter.initd \
"$pkgdir"/etc/init.d/prometheus-node-exporter
}
sha512sums="8650fa24014f317b23cdbe2a6f12da0912ffc74cab815d1c94fdc0a3dc01ac1dff42a454af2ebbd4d402b7834d227bcf91ebdefa630ebe997cfd478e05ee01e5 prometheus-node-exporter-0.17.0.tar.gz
ac5dd257333b9b40923d2541f68e4caac5583aee861833c8179621e290b56b686e9b58131fd7ce6ebaadb929351b65a95af7005c074fec00546813b285071abe prometheus-node-exporter.initd"