blob: 8324c1d13c0682dc3d447a5fa60d846fd6e78bfe (
plain)
1 # Description: Exporter for machine metrics
2 # URL: https://github.com/prometheus/node_exporter
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: go
5 # Optional: python3-bcrypt
6
7 name=prometheus-node-exporter
8 version=1.5.0
9 release=1
10 source=(https://github.com/prometheus/node_exporter/archive/v$version/$name-$version.tar.gz
11 prometheus-node-exporter.service config.yml
12 gen-pass.py)
13
14 build() {
15 cd node_exporter-$version
16 export CGO_CPPFLAGS="${CPPFLAGS}"
17 export CGO_CFLAGS="${CFLAGS}"
18 export CGO_CXXFLAGS="${CXXFLAGS}"
19 export CGO_LDFLAGS="${LDFLAGS}"
20
21 mkdir "$PKGMK_SOURCE_DIR/gopath" || true
22 export GOPATH="$PKGMK_SOURCE_DIR/gopath"
23
24 go build \
25 -trimpath \
26 -buildmode=pie \
27 -mod=readonly \
28 -modcacherw \
29 -o node_exporter .
30
31 install -Dm755 node_exporter $PKG/usr/bin/node_exporter
32
33 install -Dm755 $SRC/prometheus-node-exporter.service $PKG/etc/rc.d/$name
34 prt-get isinst python3-bcrypt && install -Dm644 $SRC/gen-pass.py $PKG/usr/lib/$name/gen-pass.py
35 install -Dm644 $SRC/config.yml $PKG/etc/node-exporter/config.yml
36 }
|