2022-10-01 23:25:33 +02:00
|
|
|
# Description: Exporter for machine metrics
|
|
|
|
# URL: https://github.com/prometheus/node_exporter
|
|
|
|
# Maintainer: Tim Biermann, tbier at posteo dot de
|
|
|
|
# Depends on: go
|
|
|
|
# Optional: python3-bcrypt
|
|
|
|
|
|
|
|
name=prometheus-node-exporter
|
2024-04-24 16:44:10 +02:00
|
|
|
version=1.8.0
|
|
|
|
release=1
|
2023-11-18 13:21:04 +01:00
|
|
|
source=(https://github.com/prometheus/node_exporter/archive/v$version/$name-$version-$release.tar.gz
|
2022-10-01 23:25:33 +02:00
|
|
|
prometheus-node-exporter.service config.yml
|
|
|
|
gen-pass.py)
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd node_exporter-$version
|
|
|
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
export CGO_CFLAGS="${CFLAGS}"
|
|
|
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
|
|
|
export CGO_LDFLAGS="${LDFLAGS}"
|
|
|
|
|
|
|
|
mkdir "$PKGMK_SOURCE_DIR/gopath" || true
|
|
|
|
export GOPATH="$PKGMK_SOURCE_DIR/gopath"
|
|
|
|
|
|
|
|
go build \
|
|
|
|
-trimpath \
|
|
|
|
-buildmode=pie \
|
|
|
|
-mod=readonly \
|
|
|
|
-modcacherw \
|
|
|
|
-o node_exporter .
|
|
|
|
|
|
|
|
install -Dm755 node_exporter $PKG/usr/bin/node_exporter
|
|
|
|
|
|
|
|
install -Dm755 $SRC/prometheus-node-exporter.service $PKG/etc/rc.d/$name
|
2022-11-29 22:41:29 +01:00
|
|
|
prt-get isinst python3-bcrypt && install -Dm644 $SRC/gen-pass.py $PKG/usr/lib/$name/gen-pass.py
|
2022-10-01 23:25:33 +02:00
|
|
|
install -Dm644 $SRC/config.yml $PKG/etc/node-exporter/config.yml
|
|
|
|
}
|