# Contributor: Katie Holly # Maintainer: Katie Holly # Maintainer: Konstantin Kulikov pkgname=telegraf pkgver=1.11.5 pkgrel=0 pkgdesc="A plugin-driven server agent for collecting & reporting metrics, part of the InfluxDB project" url="https://www.influxdata.com/time-series-platform/telegraf/" arch="x86_64 aarch64 armhf" license="MIT" makedepends="go dep" install="$pkgname.pre-install" subpackages="$pkgname-openrc" source="$pkgname-$pkgver.tar.gz::https://github.com/influxdata/$pkgname/archive/$pkgver.tar.gz telegraf.initd telegraf.confd " builddir="$srcdir/src/github.com/influxdata/$pkgname" export GOPATH="$srcdir" export GOCACHE="$srcdir/gocache" prepare() { mkdir -p ${builddir%/*} mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1 cd "$builddir" dep ensure -v default_prepare } build() { go build -ldflags "-X main.version=$pkgver" ./cmd/telegraf } check() { # filecount tests are excluded because they depend on exact file sizes # which depend on filesystem used. go test -short $(go list ./... | grep -v plugins/inputs/filecount) } package() { install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname" install -Dm644 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname" install -Dm755 "$builddir/$pkgname" "$pkgdir/usr/bin/$pkgname" install -Dm644 "$builddir/etc/$pkgname.conf" "$pkgdir/etc/$pkgname.conf" install -dm755 "$pkgdir/etc/$pkgname.conf.d" } sha512sums="1e6001981693e4612ba34a680f1c3349c2f203d8ba2983f3841fad08b68251a942beef6cc462cb64b95eba1412ea6a35a863ff9426270896c50c83e6f177ca5d telegraf-1.11.5.tar.gz abe483deb8e12fe140de2c36d17bbfbc97ed7a5de8c3d76162357f7ba6575b8236b7197b92a26ed6d54f95c1ccbfc12ca62d6cc0371bf49d10a1ea5622a51ed1 telegraf.initd 90188e1ba88d3a0714e1590f78a2abf3719cbe2f3d734f9c72ded13cf9c8495c1bf6696f2780289775bf53da347eee72aea8fe5555a4754360d1fbaa9d3c362b telegraf.confd"