aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegraf/APKBUILD
blob: f0e151b4a2297c7ecbf922bbf83fbe6887374734 (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
52
53
54
55
56
57
58
59
60
# Contributor: Katie Holly <holly@fuslvz.ws>
# Maintainer: Katie Holly <holly@fuslvz.ws>
pkgname=telegraf
pkgver=1.7.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"
license="MIT"
makedepends="go glide"
pkgusers="telegraf"
pkggroups="telegraf"
install="$pkgname.pre-install"
options="!net"
source="$pkgname-$pkgver.tar.gz::https://github.com/influxdata/$pkgname/archive/$pkgver.tar.gz
	telegraf-makefile-ldflags.patch
	telegraf.initd
	telegraf.logrotate
	glide.yaml
	glide.lock
	"
builddir="$srcdir"/$pkgname-$pkgver
_godir="$srcdir"/go
_vendor=influxdata

unpack() {
	default_unpack
	mkdir -p "$_godir"/bin "$_godir"/src/github.com/"$_vendor" "$builddir/.glide" "$builddir/.glidetmp"
	ln -sf "$builddir" "$_godir"/src/github.com/$_vendor/$pkgname
	cp "$srcdir"/glide.yaml "$srcdir"/glide.lock "$_godir"/src/github.com/$_vendor/$pkgname
}

build() {
	cd "$_godir"/src/github.com/$_vendor/$pkgname
	export GOPATH="$_godir"
	export PATH="$PATH:$_godir"
	GLIDE_HOME="$builddir/.glide" GLIDE_TMP="$builddir/.glidetmp" glide install
	make PREFIX=/usr VERSION=$pkgver BRANCH= COMMIT= telegraf
}

check() {
	cd "$_godir"/src/github.com/$_vendor/$pkgname
	make test
}

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 "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.d/$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="180bc7b2077e4fc10f0d13fe08b7293d5632be8e717a63f2463775a95258fedfde106863e56f9dda3f6844d879e2b0e5b06397a62545045874215d9078e391b9  telegraf-1.7.4.tar.gz
abc5879cc7a465c1e59d1c421b0ebc3690ea31f946145bc8ed65ecc7fa6392ec7f9536161610c0bdb1fb6f7974692c85bb6408eb1e3ce4af4568926dc2c8bee0  telegraf-makefile-ldflags.patch
0682835506f8bd2f417fa7edcc8c394445d99545fb7599812a15e63bdcb64e3687b4f20e7adf1d8e640fd8b0e7f2d9144eb23ae6da29025cf2da07bfaa236e71  telegraf.initd
bf6ead6e3f69be7c82b01ad8e9ec52158d4b543676a4d6aea077cdad91ae477f18b98c6e2cbfa795483055d9604aaf93dcfb2a9af6ddc50f29c5b75a18a7a678  telegraf.logrotate
a2b00f1ce3d7fcaa25270aae59b537af3929a7abe70e9621d809d63c7582cd655b1e3d53cabd52e7b489ae42e49f7ff3c7a89a1781db6d017ccff9e1db97c47e  glide.yaml
b41f55525a3446db67a5677025d0a9f4b7c24727b80432d372ad9ca7aede57951276f7cd3d95c02ea0031fe63a6459e1d4bd0ddc7ccdf8049af3f5e72f500e3a  glide.lock"