aboutsummaryrefslogtreecommitdiffstats
path: root/main/collectd/APKBUILD
blob: f2ba9e093395f8fcf8132abda63be7961e2016cf (plain) (blame)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=collectd
pkgver=5.6.1
pkgrel=0
pkgdesc="The system statistics collection daemon"
url="http://collectd.org"
arch="all"
license="GPL2"
depends=""
makedepends="curl-dev net-snmp-dev postgresql-dev perl-dev python2-dev
	libgcrypt-dev mariadb-dev zlib-dev libressl-dev iptables-dev
	rrdtool-dev yajl-dev libvirt-dev lm_sensors-dev libxml2-dev
	hiredis-dev
	autoconf automake libtool"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-perl $pkgname-snmp
	$pkgname-curl:_curl
	$pkgname-write_http $pkgname-nginx $pkgname-apache $pkgname-postgresql
	$pkgname-mysql $pkgname-network $pkgname-rrdtool $pkgname-sensors
	$pkgname-python:_python $pkgname-iptables:_ipt $pkgname-bind
	$pkgname-ascent $pkgname-virt $pkgname-redis $pkgname-write_redis
	$pkgname-log_logstash $pkgname-ceph"

source="http://collectd.org/files/collectd-$pkgver.tar.bz2
	collectd.initd
	gnu_source.patch"

builddir="$srcdir"/$pkgname-$pkgver

# security fixes:
#   5.5.2-r0:
#   -  CVE-2016-6254

build() {
	cd "$builddir"
	autoreconf -vif || return 1
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/collectd \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstate=/var \
		--with-libiptc \
		--enable-rrdtool \
		--enable-libvirt \
		--enable-bind \
		--disable-werror \
		--with-perl-bindings=INSTALLDIRS=vendor \
		|| return 1
	make || return 1
	# disable network plugin by default since its in a subpackage
	sed -i -e 's/^LoadPlugin network/#LoadPlugin network/' \
		src/collectd.conf
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install || return 1

	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}

perl() {
	pkgdesc="perl bindings to collectd"
	mkdir -p "$subpkgdir"/usr/lib/collectd \
		"$subpkgdir"/usr/share || return 1
	mv "$pkgdir"/usr/lib/collectd/perl.so \
		"$subpkgdir"/usr/lib/collectd/ || return 1
	mv "$pkgdir"/usr/lib/perl* "$subpkgdir"/usr/lib/ || return 1
	mv "$pkgdir"/usr/share/perl* "$subpkgdir"/usr/share/
}

_plugin() {
	local mod=$1
	local desc=${2:-$mod}
	pkgdesc="$desc pluin for collectd"
	depends="collectd"
	install -d "$subpkgdir"/usr/lib/collectd
	mv "$pkgdir"/usr/lib/collectd/$mod.so "$subpkgdir"/usr/lib/collectd/
}

snmp()		{ _plugin snmp; }
_curl()		{ _plugin 'curl*'; }
write_http()	{ _plugin write_http; }
nginx()		{ _plugin nginx; }
apache()	{ _plugin apache; }
postgresql()	{ _plugin postgresql; }
mysql()		{ _plugin mysql; }
network()	{ _plugin network; }
rrdtool()	{ _plugin 'rrd*'; }
sensors()	{ _plugin sensors; }
_python()	{ _plugin python; }
_ipt()		{ _plugin iptables; }
bind()		{ _plugin bind; }
ascent()	{ _plugin ascent; }
redis()		{ _plugin redis; }
write_redis()	{ _plugin write_redis; }
log_logstash()	{ _plugin log_logstash; }
ceph()		{ _plugin ceph; }
virt()		{ _plugin virt; provides="$pkgname-libvirt"; }

md5sums="979f43b6439d7df93f0b40c73d779223  collectd-5.6.1.tar.bz2
8015a61e7cda7abdf60e63eeff2923d2  collectd.initd
3bba7683187b5fc736727a3b8f9c26b2  gnu_source.patch"
sha256sums="c30ff644f91407b4dc2d99787b99cc45ec00e538bd1cc269429d3c5e8a4aee2c  collectd-5.6.1.tar.bz2
7d7b20cb0c804d56d4e7ffe60b975b82c194898160674be2de49d1489589f6a3  collectd.initd
071770da2e443194574c8d7e5dc1c8170f18aa846ef7edfafa8128d96d531a8d  gnu_source.patch"
sha512sums="da25f1a9cbaf47533f5a4d2f5f78b966317d4f21865c5a714954ad9d7d02b4798a3e0471ce52199dc80e01dc2808376cb10a7e19c402aafc984bf595f09951a6  collectd-5.6.1.tar.bz2
296b9f58df7b0da5b2fbf8c6e77cbd08c6673da28e98e67a34cb52dffc26c45d54a95f0bc51a16729d1844752636419fae98a4d3fd744b736568dfc23fab4296  collectd.initd
519fa563d319928e35e0235dd2bc38e7e53dbaae93ede1c93622dab2d00e1ac3baa93200f9e3e62cb81c1c9d808171b4648db864191d57a703ac7874b9c5fb95  gnu_source.patch"