aboutsummaryrefslogtreecommitdiffstats
path: root/community/prometheus-node-exporter/APKBUILD
blob: da4d7ce1a8dd5f0344b39373d1bf4afa07997f7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Contributor: Tiago Ilieve <tiago.myhro@gmail.com>
# Maintainer: Tiago Ilieve <tiago.myhro@gmail.com>
pkgname=prometheus-node-exporter
_pkgname=node_exporter
pkgver=1.3.0
pkgrel=0
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"

build() {
	go build \
		-ldflags "-s -w -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="
bde669f6f57b4215e4685680cf393c688eda2f850d8725b842c19cd4daa84b028c02872088c4d4ec8604b7c68b17fef997ff0da2a3c58b1000522ae55f68ecaa  node_exporter-1.3.0.tar.gz
67b16a002daf45893e7d814e6d921f92dfc26d31ea802a4c511dc3affd8143d3827b7d895bb3efc13337894a893f4feac01d2a0f0e381ef53d00dffe9ff0577a  node-exporter.initd
592d3f17a3cf487d97a14c803dded07d2dfb112b159ab1a3575310fc0176fc3255ddad6657f16a8d6d3c161bfb03c203a6271ec6e6395b75716a14b0de8baced  node-exporter.confd
36952039e5db39aa06a2ca16fa5d318f22eb967e3e9b1363508b2f3d3d0b14e5df111c77ce951bea2f65dd2be0a0a1582be245acfe4641623381a940204e53d9  disable-go-race-detector.patch
"