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