aboutsummaryrefslogtreecommitdiffstats
path: root/community/collectd/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/collectd/APKBUILD')
-rw-r--r--community/collectd/APKBUILD201
1 files changed, 139 insertions, 62 deletions
diff --git a/community/collectd/APKBUILD b/community/collectd/APKBUILD
index ceb4d99d1e..8cb5fe3bdd 100644
--- a/community/collectd/APKBUILD
+++ b/community/collectd/APKBUILD
@@ -1,41 +1,131 @@
# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=collectd
pkgver=5.12.0
-pkgrel=0
+pkgrel=3
pkgdesc="The system statistics collection daemon"
-options="!check" # test_common fails
url="https://collectd.org/"
-arch="all !mips !mips64 !s390x" # libvirt
+arch="all !mips !mips64 !s390x" # limited by libvirt
license="GPL-2.0-or-later"
pkgusers="collectd"
pkggroups="collectd"
-makedepends="curl-dev net-snmp-dev postgresql-dev perl-dev python3-dev
- libgcrypt-dev mariadb-connector-c-dev zlib-dev iptables-dev
- rrdtool-dev yajl-dev libvirt-dev lm-sensors-dev libxml2-dev
- hiredis-dev eudev-dev mosquitto-dev lua-dev openipmi-dev
- libpcap-dev liboping-dev
- autoconf automake libtool"
-subpackages="$pkgname-dev $pkgname-doc $pkgname-libs
- $pkgname-perl $pkgname-snmp $pkgname-curl:_curl $pkgname-utils
- $pkgname-write_http $pkgname-nginx $pkgname-apache $pkgname-postgresql
- $pkgname-network $pkgname-mysql $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 $pkgname-disk $pkgname-lua
- $pkgname-mqtt $pkgname-ipmi $pkgname-ping $pkgname-dns $pkgname-openrc
+makedepends="
+ autoconf
+ automake
+ curl-dev
+ eudev-dev
+ hiredis-dev
+ iptables-dev
+ libatasmart-dev
+ libgcrypt-dev
+ liboping-dev
+ libpcap-dev
+ libtool
+ libvirt-dev
+ libxml2-dev
+ lm-sensors-dev
+ lua-dev
+ mariadb-connector-c-dev
+ mosquitto-dev
+ net-snmp-dev
+ openipmi-dev
+ openldap-dev
+ perl-dev
+ postgresql-dev
+ python3-dev
+ riemann-c-client-dev
+ rrdtool-dev
+ yajl-dev
+ zlib-dev
"
-install="$pkgname.pre-install"
-source="
- https://storage.googleapis.com/collectd-tarballs/collectd-$pkgver.tar.bz2
+subpackages="
+ $pkgname-dev
+ $pkgname-doc
+ $pkgname-openrc
+ $pkgname-libs
+ $pkgname-perl
+ $pkgname-utils
+ $pkgname-plugins-all:_all:noarch
+ "
+install="$pkgname.pre-install $pkgname.post-upgrade"
+source="https://storage.googleapis.com/collectd-tarballs/collectd-$pkgver.tar.bz2
collectd.initd
gnu_source.patch
"
+options="!check" # test_common fails
# secfixes:
# 5.5.2-r0:
# - CVE-2016-6254
+# <subpackage>[:<libname>...]
+_plugins="
+ apache
+ apcups
+ ascent
+ battery
+ bind
+ ceph
+ chrony
+ curl:curl*
+ disk
+ dns
+ email
+ exec
+ hddtemp
+ infiniband
+ ipmi
+ iptables
+ log_logstash
+ lua
+ madwifi
+ mbmon
+ mcelog
+ memcached
+ mqtt
+ multimeter
+ mysql
+ network
+ nginx
+ olsrd
+ openldap
+ openvpn
+ ovs:ovs_*
+ pcie_errors
+ ping
+ postgresql
+ powerdns
+ python
+ redis
+ rrdtool:rrd*
+ sensors
+ serial
+ smart
+ snmp:snmp*
+ statsd
+ sysevent
+ teamspeak2
+ ted
+ virt
+ vserver
+ wireless
+ write_http
+ write_redis
+ write_riemann
+ write_stackdriver
+ zookeeper
+ "
+case "$CARCH" in
+ x86 | x86_64) _plugins="$_plugins
+ turbostat
+ "
+ ;;
+esac
+for _i in $_plugins; do
+ subpackages="$subpackages $pkgname-${_i%%:*}:_plugin"
+done
+
prepare() {
default_prepare
@@ -56,13 +146,11 @@ build() {
--enable-bind \
--disable-werror \
--with-perl-bindings=INSTALLDIRS=vendor
-
make
# disable plugins by default since its in a subpackage
sed -i -e 's/^LoadPlugin network/#LoadPlugin network/' \
- src/collectd.conf
- sed -i -e 's/^LoadPlugin rrdtool/#LoadPlugin rrdtool/' \
+ -e 's/^LoadPlugin rrdtool/#LoadPlugin rrdtool/' \
src/collectd.conf
}
@@ -72,61 +160,50 @@ check() {
package() {
make DESTDIR="$pkgdir" install
+
chown root:collectd "$pkgdir"/etc/collectd/collectd.conf
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
- mv "$pkgdir"/usr/lib/collectd/perl.so \
- "$subpkgdir"/usr/lib/collectd/
- mv "$pkgdir"/usr/lib/perl* "$subpkgdir"/usr/lib/
- mv "$pkgdir"/usr/share/perl* "$subpkgdir"/usr/share/
+
+ amove usr/lib/collectd/perl.so
+ amove usr/lib/perl*
+ amove usr/share/perl*
}
utils() {
pkgdesc="$pkgname utilities"
- mkdir -p "$subpkgdir"/usr/bin
- mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/
+
+ amove usr/bin/*
+}
+
+_all() {
+ pkgdesc="Meta package for all collectd plugins"
+ depends=""
+
+ local plugin; for plugin in $_plugins; do
+ depends="$depends $pkgname-${plugin%%:*}"
+ done
+
+ mkdir -p "$subpkgdir"
}
_plugin() {
- local mod=$1
- local desc=${2:-$mod}
- pkgdesc="$desc pluin for collectd"
+ local name="${subpkgname#$pkgname-}"
+ pkgdesc="$name 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; }
-disk() { _plugin disk; }
-lua() { _plugin lua; }
-mqtt() { _plugin mqtt; }
-virt() { _plugin virt; provides="$pkgname-libvirt"; }
-ipmi() { _plugin ipmi; }
-ping() { _plugin ping; }
-dns() { _plugin dns; }
+ local libnames=$(printf '%s\n' $_plugins | grep "^$name:" | cut -d: -f2- | tr : ' ')
+ local libname
+
+ for libname in ${libnames:-$name}; do
+ amove usr/lib/collectd/$libname.so
+ done
+}
sha512sums="7a15e4c0ae587db4987d673a790a4f3bea1cab29ce24a506fb21fa7bd2f60bfec70867eaa1c1395cb5b0e0ae81a024fb6109b064da0ef50e7c146d2198871c70 collectd-5.12.0.tar.bz2
a286c2164af196154d017658d6e5aa3cc4f76dadf90b68c3021418979d9f0377776bb990d737ae5c916c04475725365aea8b78e3bc5e2f3679d5a99f8b9af13e collectd.initd