aboutsummaryrefslogblamecommitdiffstats
path: root/testing/prometheus-node-exporter/APKBUILD
blob: c8af5fd1be2bc2986d642aa11a2b036f21e8e8dd (plain) (tree)
1
2
3
4
5
6



                                                   
             
        








                                                                                                     



















                                                                                                             
                                                                                       



                                                                                       
                                                                                                                                                                         
                                                                                                                                                                

                                                                                                                                                      
# Contributor: Tiago Ilieve <tiago.myhro@gmail.com>
# Maintainer: Tiago Ilieve <tiago.myhro@gmail.com>
pkgname=prometheus-node-exporter
_pkgname=node_exporter
pkgver=0.18.1
pkgrel=2
pkgdesc="Prometheus exporter for machine metrics"
url="https://github.com/prometheus/node_exporter"
arch="all"
license="Apache-2.0"
makedepends="go>=1.11 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
	disable-go-race-detector.patch
	node-exporter.confd
	node-exporter.initd"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"

	go build -v -ldflags "-s -w -X github.com/prometheus/common/version.Version=$pkgver" -o node_exporter
}

check() {
	cd "$builddir"

	make test
	./node_exporter --version
}

package() {
	cd "$builddir"

	install -Dm644 "$srcdir/node-exporter.confd" "$pkgdir"/etc/conf.d/node-exporter
	install -Dm755 "$srcdir/node-exporter.initd" "$pkgdir"/etc/init.d/node-exporter
	install -Dm755 ./node_exporter "$pkgdir"/usr/bin/node_exporter
}

sha512sums="cf2b854fbec1ba39b18432cdc11ab507ebc5b2828e6b34b4f49af9b949fcd365cb3e5eb1e265d0825783810c6b1572a8b3512ec27a46e5c83f89a505590159c0  node_exporter-0.18.1.tar.gz
36952039e5db39aa06a2ca16fa5d318f22eb967e3e9b1363508b2f3d3d0b14e5df111c77ce951bea2f65dd2be0a0a1582be245acfe4641623381a940204e53d9  disable-go-race-detector.patch
592d3f17a3cf487d97a14c803dded07d2dfb112b159ab1a3575310fc0176fc3255ddad6657f16a8d6d3c161bfb03c203a6271ec6e6395b75716a14b0de8baced  node-exporter.confd
df006b184c3b2d5e773044838db7143dc3a64e621f4da6b106f41915a07d5cef32933ab9bb44464f10c132f86997ae7753ae19627afd4ba6cfb125161786dfe0  node-exporter.initd"