34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
# Description: exporter for machine metrics
|
|
# URL: https://github.com/prometheus/node_exporter
|
|
# Maintainer: Tim Biermann, tbier at posteo dot de
|
|
# Depends on: go
|
|
|
|
name=prometheus-node_exporter
|
|
version=1.3.1
|
|
release=1
|
|
source=(https://github.com/prometheus/node_exporter/archive/v$version/$name-$version.tar.gz
|
|
prometheus-node_exporter.service)
|
|
|
|
build() {
|
|
cd node_exporter-$version
|
|
|
|
GOLDFLAGS="-X github.com/prometheus/common/version.Version=$version
|
|
-X github.com/prometheus/common/version.Revision=CRUX
|
|
-X github.com/prometheus/common/version.Branch=master
|
|
-X github.com/prometheus/common/version.BuildUser=$USER@$HOSTNAME
|
|
-X github.com/prometheus/common/version.BuildDate=$(date -u "+%Y%m%d-%H:%M:%S" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH})"
|
|
|
|
go build \
|
|
-trimpath \
|
|
-buildmode=pie \
|
|
-mod=readonly \
|
|
-modcacherw \
|
|
-ldflags "$GOLDFLAGS" \
|
|
.
|
|
|
|
install -Dm755 node_exporter $PKG/usr/bin/prometheus-node-exporter
|
|
|
|
## install rc file
|
|
install -Dm 755 $SRC/prometheus-node_exporter.service $PKG/etc/rc.d/prometheus-node_exporter
|
|
}
|