aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegraf/APKBUILD
blob: 53654e0bfc24ed432af9e174ba163d0822b06ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Contributor: Katie Holly <holly@fuslvz.ws>
# Maintainer: Katie Holly <holly@fuslvz.ws>
# Maintainer: Konstantin Kulikov <k.kulikov2@gmail.com>
pkgname=telegraf
pkgver=1.11.4
pkgrel=1
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="0ef6adb4c940a8d39f0c44f34cb7b0ab59823d3ec1ec850cc35f1686cf556d416d878abe8ba04625380b2c0f8a906ec66afa5b42b31dd6e6a76948b0a7b9b861  telegraf-1.11.4.tar.gz
abe483deb8e12fe140de2c36d17bbfbc97ed7a5de8c3d76162357f7ba6575b8236b7197b92a26ed6d54f95c1ccbfc12ca62d6cc0371bf49d10a1ea5622a51ed1  telegraf.initd
90188e1ba88d3a0714e1590f78a2abf3719cbe2f3d734f9c72ded13cf9c8495c1bf6696f2780289775bf53da347eee72aea8fe5555a4754360d1fbaa9d3c362b  telegraf.confd"