# Contributor: Ɓukasz Jendrysik # Contributor: Jakub Jirutka # Maintainer: Natanael Copa pkgname=collectd pkgver=5.12.0 pkgrel=17 pkgdesc="The system statistics collection daemon" url="https://collectd.org/" arch="all" license="GPL-2.0-or-later" pkgusers="collectd" pkggroups="collectd" makedepends=" autoconf automake curl-dev eudev-dev gpsd-dev hiredis-dev i2c-tools-dev iptables-dev jansson-dev libatasmart-dev libdbi-dev libgcrypt-dev libmemcached-dev libmicrohttpd-dev libmnl-dev libmodbus-dev libnotify-dev liboping-dev libpcap-dev libpq-dev librdkafka-dev libtool libxml2-dev lm-sensors-dev lua-dev mariadb-connector-c-dev mosquitto-dev net-snmp-dev openipmi-dev openldap-dev openssl-dev>3 owfs-dev patchelf perl-dev python3-dev rabbitmq-c-dev riemann-c-client-dev rrdtool-dev varnish-dev yajl-dev zlib-dev " 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 $pkgname-3f57541-fix-broken-t-option.patch::https://github.com/collectd/collectd/commit/3f575419e7ccb37a3b10ecc82adb2e83ff2826e1.patch $pkgname-dd7e4fd-2-nginx-add-support-for-unix-socket.patch::https://github.com/collectd/collectd/commit/dd7e4fd34042483cc90ee2762f4b507fd6637d37.patch $pkgname-cc565f5-2-nginx-add-support-for-unix-socket.patch::https://github.com/collectd/collectd/commit/cc565f5f94b117e2c64b2060627dc3fc49a8abb3.patch $pkgname-24bb9e2-2-oauth-increase-buf-size.patch::https://github.com/collectd/collectd/commit/24bb9e251969d5cf0e6eee14aad7a7e3bcc59dd8.patch $pkgname-91a6423-2-ovs_stats-fix-port-deletion.patch::https://github.com/collectd/collectd/commit/91a642385e2d068d106aa5c307de968f8b33add5.patch $pkgname-1483ef8-snmp-remove-des-support.patch::https://github.com/collectd/collectd/commit/1483ef8e03603bb8e1f89745325a17ba50fbbedf.patch gnu_source.patch pyinclude.patch collectd.initd " options="!check" # test_common fails # TODO: Move /etc/collectd/collectd.conf to /etc/collectd.conf. # TODO: Clean up defualt collectd.conf. # secfixes: # 5.5.2-r0: # - CVE-2016-6254 # [:...] _plugins=" amqp apache apcups ascent barometer battery bind capabilities ceph chrony connectivity curl:curl* dbi disk dns email exec gps hddtemp infiniband ipmi iptables log_logstash lua madwifi mbmon mcelog memcachec memcached modbus mqtt multimeter mysql network nginx notify_desktop olsrd onewire openldap openvpn ovs:ovs_* pcie_errors pinba ping postgresql powerdns python redis rrdtool:rrd* sensors serial smart snmp:snmp* statsd sysevent teamspeak2 ted varnish vserver wireless write_http write_kafka write_redis write_riemann write_stackdriver zookeeper " _flags= case "$CARCH" in x86 | x86_64) _plugins="$_plugins turbostat";; *) _flags="--disable-turbostat";; esac case "$CARCH" in x86 | armhf | armv7 | riscv64) _flags="$_flags --disable-java";; *) _plugins="$_plugins java"; makedepends="$makedepends java-jdk";; esac case "$CARCH" in s390x | riscv64) _flags="$_flags --disable-virt";; *) _plugins="$_plugins virt"; makedepends="$makedepends libvirt-dev";; esac for _i in $_plugins; do subpackages="$subpackages $pkgname-${_i%%:*}:_plugin" done prepare() { default_prepare autoreconf -vif cat >> src/collectd.conf.in <<-EOF Filter "*.conf" EOF } build() { ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc/collectd \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstate=/var \ --with-libiptc \ --disable-werror \ --with-perl-bindings=INSTALLDIRS=vendor \ --with-java=/usr/lib/jvm/default-jvm \ \ --enable-all-plugins \ --disable-amqp1 \ --disable-apple_sensors \ --disable-aquaero \ --disable-dcpmm \ --disable-dpdkevents \ --disable-dpdkstat \ --disable-dpdk_telemetry \ --disable-gmond \ --disable-gpu_nvidia \ --disable-grpc \ --disable-intel_pmu \ --disable-intel_rdt \ --disable-ipstats \ --disable-lpar \ --disable-mic \ --disable-netapp \ --disable-netlink \ --disable-netstat_udp \ --disable-notify_email \ --disable-nut \ --disable-oracle \ --disable-pf \ --disable-redfish \ --disable-routeros \ --disable-sigrok \ --disable-slurm \ --disable-tape \ --disable-tokyotyrant \ --disable-write_mongodb \ --disable-write_prometheus \ --disable-xencpu \ --disable-xmms \ --disable-zone \ $_flags make if [ -f .libs/java.so ]; then # Fix RPATH (there's /usr/lib/jvm/default-jvm/lib/server/jre/jre/.../jre/lib/server). patchelf --set-rpath "$(readlink -f /usr/lib/jvm/default-jvm/lib/server)" .libs/java.so fi # disable plugins by default since its in a subpackage sed -i -e 's/^LoadPlugin network/#LoadPlugin network/' \ -e 's/^LoadPlugin rrdtool/#LoadPlugin rrdtool/' \ src/collectd.conf } check() { make check } package() { local header path make DESTDIR="$pkgdir" install find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete chown root:collectd "$pkgdir"/etc/collectd/collectd.conf mkdir -p "$pkgdir"/etc/collectd.d install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname # Install all header files to allow building out-of-tree plugins. # This is based on Debian. for path in $(find src -path src/libcollectdclient -prune \ -o -path src/liboconfig -prune \ -o -name '*.h' -print) do install -D -m644 "$path" "$pkgdir"/usr/include/collectd/core/${path#src/} done install -D -m644 src/liboconfig/oconfig.h -t "$pkgdir"/usr/include/collectd/liboconfig/ cd "$pkgdir"/usr/include/collectd/ # Update include path for collectd core header files. headers=$(find ./core ./liboconfig -type f -name '*.h') for path in $headers; do sed -r -i "s|(include\s+)\".*\<${path##*/}\"|\1\"collectd/${path#./}\"|" $headers done } perl() { pkgdesc="perl bindings to collectd" amove usr/lib/collectd/perl.so amove usr/lib/perl* amove usr/share/perl* } utils() { pkgdesc="$pkgname utilities" 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 name="${subpkgname#$pkgname-}" pkgdesc="$name pluin for collectd" depends="collectd" 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 case "$name" in java) amove usr/share/collectd/java;; esac } sha512sums=" 7a15e4c0ae587db4987d673a790a4f3bea1cab29ce24a506fb21fa7bd2f60bfec70867eaa1c1395cb5b0e0ae81a024fb6109b064da0ef50e7c146d2198871c70 collectd-5.12.0.tar.bz2 b8af8bb68d4da90f77cea5ed2cd751340fa2abe7e6b56e5abd52f8e79d4cd40c5a73a79cfb1e517657dd2b89169320e71f2c0061e4fbed27864fb6dc958d240e collectd-3f57541-fix-broken-t-option.patch 58389c5c8839439040ba7f1c39089c7102b36a96e07865dd5b38092560c9cb58ca3be5ba7e45d2450e658d886fdc0a9b24af024eb158c05d3a2f5f1b75745654 collectd-dd7e4fd-2-nginx-add-support-for-unix-socket.patch 57c28aaf013cf5893594abfa08a040f34a246bfcffd1cef578158be25f7e18ac579ce96a26af57e6b31f4bb87ef367f1dee6ad41f1514736519af8f32a5d1a37 collectd-cc565f5-2-nginx-add-support-for-unix-socket.patch 37c116c5e026f8cb1c3ff6772745d8e6fafcc6683e4b5ba7f1afbef6da856b7b8a7193a009bfb8b4d5d1ff3fee14e2d281035ee530471138a2f1102aa8895c11 collectd-24bb9e2-2-oauth-increase-buf-size.patch 8ba5f533550da579fc851491efc6aaeac58436d81a4e4a09224e3e8c51b6ec90d007d58b843a7d886a58624b75ad0a79b6bc5e40176552e4dff6207f7ddd4941 collectd-91a6423-2-ovs_stats-fix-port-deletion.patch e5089707e349c10a3cfb25d6a9d52db8fdd450b404c68fe82d9a321d8f6d7bd20ba6f9ef045dd76e3251e67a2cf728cc0ac58b8c791a5fb260b74cd520608cea collectd-1483ef8-snmp-remove-des-support.patch 3078e43fc1aa5e5d5f7042472f465cc3b077c59f43a9867ade038e59bb210f26f53bb9a1e1e8a198ca53939a4b2e03a1f05628aa54f826746f970faa36acff6a gnu_source.patch bf1362d1bfaff1468409de815cff20c3f1446f2362282cdb7b764b736e2d8a51ca81f706a13cd13344858fe8fc34561a59a828f7a861f9723972b26452e8c682 pyinclude.patch a286c2164af196154d017658d6e5aa3cc4f76dadf90b68c3021418979d9f0377776bb990d737ae5c916c04475725365aea8b78e3bc5e2f3679d5a99f8b9af13e collectd.initd "