aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegraf/APKBUILD
blob: ef8b4f8774699ff3cadd8f6ac897fab71b87a839 (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
# Contributor: Katie Holly <holly@fuslvz.ws>
# Maintainer: Katie Holly <holly@fuslvz.ws>
pkgname=telegraf
pkgver=1.5.1
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 x86"
license="MIT"
makedepends="go"
options="!strip"
install=""
source="$pkgname-$pkgver.tar.gz::https://github.com/influxdata/$pkgname/archive/$pkgver.tar.gz
	telegraf-makefile-ldflags.patch
	telegraf.initd
	"
builddir="$srcdir"/$pkgname-$pkgver
_godir="$srcdir"/go
_vendor=influxdata

build() {
	mkdir -p "$_godir"/bin "$_godir"/src/github.com/"$_vendor"
	ln -sf "$builddir" "$_godir"/src/github.com/$_vendor/$pkgname
	export GOPATH="$_godir"
	export PATH="$PATH:$_godir"
	cd "$_godir"/src/github.com/$_vendor/$pkgname
	go get -d -v .
	make PREFIX=/usr
}

package() {
	mkdir -p "$pkgdir"/usr/bin "$pkgdir"/etc/$pkgname "$pkgdir"/etc/logrotate.d/$pkgname
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm755 "$builddir"/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 "$builddir"/etc/$pkgname.conf "$pkgdir"/etc/$pkgname/$pkgname.conf
	install -Dm644 "$builddir"/etc/logrotate.d/$pkgname "$pkgdir"/etc/logrotate.d/$pkgname
}

sha512sums="e5b723d4b2d1fa40aa08c3f4def220d9a9a6eb8ab57ca8cb03116ad86b7e43e589592e6e4dfab03f03a3c884b8cc2ccdeab19de4fcf737e32278ab1d9336055a  telegraf-1.5.1.tar.gz
f565077f3bea51937b720dab2224bc991cf39a54ec1b5089c708136aa3535ef9fd43df4d2cb138d65634d8430b9b91a0710c30321310974c3d427b99ea374c04  telegraf-makefile-ldflags.patch
5ab5dbc5d0ab735f0909c44dc5bc9748ea724d148e1f69c9beb59a6504944a2b092597cf071d478cb06f78f52321fba68106e8cee52b104d05b031500cdec1e3  telegraf.initd"