# Contributor: Katie Holly # Maintainer: Katie Holly # Maintainer: Konstantin Kulikov pkgname=telegraf pkgver=1.12.4 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 binutils-gold" install="$pkgname.pre-install" subpackages="$pkgname-openrc" source="telegraf-$pkgver.tar.gz::https://github.com/influxdata/telegraf/archive/$pkgver.tar.gz telegraf.initd telegraf.confd " builddir="$srcdir/src/github.com/influxdata/$pkgname" export GOPATH="$srcdir" export GOCACHE=${GOCACHE:-$srcdir/go-build} export GOTMPDIR=${GOTMPDIR:-$srcdir} prepare() { mkdir -p ${builddir%/*} mv "$srcdir"/$pkgname-$pkgver "$builddir"/ 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. # http_response querying nonexistent.nonexistent on aarch64 drone ci # fails with timeout, but works on all other archs. # Prometheus tls test depends on specific bytes returned by http server, # disabling tls13 workarounds test failure for now. GODEBUG=tls13=0 go test -short $(go list ./... | egrep -v '(plugins/inputs/filecount)|(plugins/inputs/http_response)') } 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="0e0a23777e938efbcab4d0bdf317218e7a4a24fcb787fbca3acf7b99eb40e03bd47f1cb9d9ae27acd6b4038e21d8df51ffbac5694664e8bd8a490810381bc6e2 telegraf-1.12.4.tar.gz abe483deb8e12fe140de2c36d17bbfbc97ed7a5de8c3d76162357f7ba6575b8236b7197b92a26ed6d54f95c1ccbfc12ca62d6cc0371bf49d10a1ea5622a51ed1 telegraf.initd 90188e1ba88d3a0714e1590f78a2abf3719cbe2f3d734f9c72ded13cf9c8495c1bf6696f2780289775bf53da347eee72aea8fe5555a4754360d1fbaa9d3c362b telegraf.confd"