32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
# Description: a server-based agent for collecting and sending all metrics
|
|
# URL: https://www.influxdata.com/time-series-platform/telegraf/
|
|
# Maintainer: Tim Biermann, tbier at posteo dot de
|
|
# Depends on: go
|
|
|
|
name=telegraf
|
|
version=1.30.3
|
|
release=1
|
|
source=(https://github.com/influxdata/telegraf/archive/refs/tags/v$version.tar.gz
|
|
telegraf.service)
|
|
renames=($name-$version.tar.gz SKIP)
|
|
|
|
build() {
|
|
cd $name-$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"
|
|
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
|
|
_LDFLAGS="-X main.goos=$(go env GOOS) -X main.goarch=$(go env GOARCH) -X main.version=${version} -X main.branch=tag-${version} -X main.commit=tag-${version} -extldflags ${LDFLAGS}"
|
|
go build -o build -ldflags="${_LDFLAGS}" "./cmd/telegraf"
|
|
|
|
install -Dm755 build $PKG/usr/bin/$name
|
|
install -d -m 755 $PKG/etc/telegraf
|
|
$PKG/usr/bin/$name -sample-config > $PKG/etc/telegraf/telegraf.conf
|
|
install -Dm755 $SRC/telegraf.service $PKG/etc/rc.d/telegraf
|
|
}
|