Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "Collects and summarises system performance statistics" |
| 2 | DESCRIPTION = "collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files." |
| 3 | LICENSE = "GPLv2 & MIT" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=1bd21f19f7f0c61a7be8ecacb0e28854" |
| 5 | |
| 6 | DEPENDS = "rrdtool curl libpcap libxml2 yajl libgcrypt libtool lvm2" |
| 7 | |
| 8 | SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \ |
| 9 | file://collectd.init \ |
| 10 | file://collectd.service \ |
| 11 | file://no-gcrypt-badpath.patch \ |
| 12 | file://0001-fix-to-build-with-glibc-2.25.patch \ |
| 13 | file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \ |
| 14 | file://0005-Disable-new-gcc8-warnings.patch \ |
| 15 | file://0006-libcollectdclient-Fix-string-overflow-errors.patch \ |
| 16 | file://0001-Remove-including-sys-sysctl.h-on-glibc-based-systems.patch \ |
| 17 | " |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 18 | SRC_URI[md5sum] = "2b23a65960bc323d065234776a542e04" |
| 19 | SRC_URI[sha256sum] = "5bae043042c19c31f77eb8464e56a01a5454e0b39fa07cf7ad0f1bfc9c3a09d6" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | |
| 21 | inherit autotools python3native update-rc.d pkgconfig systemd |
| 22 | |
| 23 | SYSTEMD_SERVICE_${PN} = "collectd.service" |
| 24 | |
| 25 | # Floatingpoint layout, architecture dependent |
| 26 | # 'nothing', 'endianflip' or 'intswap' |
| 27 | FPLAYOUT ?= "--with-fp-layout=nothing" |
| 28 | |
| 29 | PACKAGECONFIG ??= "" |
| 30 | PACKAGECONFIG[openjdk] = "--with-java=${STAGING_DIR_TARGET}${libdir}/jvm,--without-java,openjdk-7" |
| 31 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp" |
| 32 | PACKAGECONFIG[libmemcached] = "--with-libmemcached,--without-libmemcached,libmemcached" |
| 33 | PACKAGECONFIG[iptables] = "--enable-iptables,--disable-iptables,iptables" |
| 34 | PACKAGECONFIG[postgresql] = "--enable-postgresql --with-libpq=yes, \ |
| 35 | --disable-postgresql --with-libpq=no,postgresql" |
| 36 | PACKAGECONFIG[mysql] = "--enable-mysql --with-libmysql=yes, \ |
| 37 | --disable-mysql --with-libmysql=no,mysql5" |
| 38 | PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi" |
| 39 | PACKAGECONFIG[modbus] = "--enable-modbus,--disable-modbus,libmodbus" |
| 40 | PACKAGECONFIG[libowcapi] = "--with-libowcapi,--without-libowcapi,owfs" |
| 41 | PACKAGECONFIG[sensors] = "--enable-sensors --with-libsensors=yes, \ |
| 42 | --disable-sensors --with-libsensors=no,lmsensors" |
| 43 | PACKAGECONFIG[amqp] = "--enable-amqp --with-librabbitmq=yes, \ |
| 44 | --disable-amqp --with-librabbitmq=no,rabbitmq-c" |
| 45 | # protobuf-c, libvirt that are currently only available in meta-virtualization layer |
| 46 | PACKAGECONFIG[pinba] = "--enable-pinba,--disable-pinba,protobuf-c-native protobuf-c" |
| 47 | PACKAGECONFIG[libvirt] = "--enable-virt,--disable-virt,libvirt" |
| 48 | PACKAGECONFIG[libesmtp] = "--with-libesmtp,--without-libesmtp,libesmtp" |
| 49 | PACKAGECONFIG[libmnl] = "--with-libmnl,--without-libmnl,libmnl" |
| 50 | PACKAGECONFIG[libatasmart] = "--with-libatasmart,--without-libatasmart,libatasmart" |
| 51 | PACKAGECONFIG[ldap] = "--enable-openldap --with-libldap,--disable-openldap --without-libldap, openldap" |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 52 | PACKAGECONFIG[rrdtool] = "--enable-rrdtool,--disable-rrdtool,rrdtool" |
| 53 | PACKAGECONFIG[rrdcached] = "--enable-rrdcached,--disable-rrdcached,rrdcached" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 54 | |
| 55 | EXTRA_OECONF = " \ |
| 56 | ${FPLAYOUT} \ |
| 57 | --disable-perl --with-libperl=no --with-perl-bindings=no \ |
| 58 | --with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \ |
| 59 | --disable-notify_desktop \ |
| 60 | " |
| 61 | |
| 62 | do_install_append() { |
| 63 | install -d ${D}${sysconfdir}/init.d |
| 64 | install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd |
| 65 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd |
| 66 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd |
| 67 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd |
| 68 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd |
| 69 | install -Dm 0640 ${B}/src/collectd.conf ${D}${sysconfdir}/collectd.conf |
| 70 | # Fix configuration file to allow collectd to start up |
| 71 | sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup false!g' ${D}${sysconfdir}/collectd.conf |
| 72 | |
| 73 | rmdir "${D}${localstatedir}/run" |
| 74 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" |
| 75 | |
| 76 | # Install systemd unit files |
| 77 | install -d ${D}${systemd_unitdir}/system |
| 78 | install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system |
| 79 | sed -i -e 's,@SBINDIR@,${sbindir},g' \ |
| 80 | ${D}${systemd_unitdir}/system/collectd.service |
| 81 | } |
| 82 | |
| 83 | CONFFILES_${PN} = "${sysconfdir}/collectd.conf" |
| 84 | |
| 85 | INITSCRIPT_NAME = "collectd" |
| 86 | INITSCRIPT_PARAMS = "defaults" |
| 87 | |
| 88 | # threshold.so load.so are also provided by gegl |
| 89 | # disk.so is also provided by libgphoto2-camlibs |
| 90 | PRIVATE_LIBS = "threshold.so load.so disk.so" |