blob: 6a3476f5402d10b04d6e05200053d0c4ca11e541 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "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://no-gcrypt-badpath.patch \
10 file://collectd-version.patch \
11 file://0001-redefine-the-dependence.patch \
12 file://collectd.init \
13 file://collectd.service \
14 file://0001-conditionally-check-libvirt.patch \
15"
16SRC_URI[md5sum] = "c39305ef5514b44238b0d31f77e29e6a"
17SRC_URI[sha256sum] = "847684cf5c10de1dc34145078af3fcf6e0d168ba98c14f1343b1062a4b569e88"
18
19inherit autotools pythonnative update-rc.d pkgconfig systemd
20
21SYSTEMD_SERVICE_${PN} = "collectd.service"
22
23# Floatingpoint layout, architecture dependent
24# 'nothing', 'endianflip' or 'intswap'
25FPLAYOUT ?= "--with-fp-layout=nothing"
26
27PACKAGECONFIG ??= ""
28PACKAGECONFIG[openjdk] = "--with-java=${STAGING_DIR_TARGET}${libdir}/jvm,--without-java,openjdk-7"
29PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp"
30PACKAGECONFIG[libmemcached] = "--with-libmemcached,--without-libmemcached,libmemcached"
31PACKAGECONFIG[iptables] = "--enable-iptables,--disable-iptables,iptables"
32PACKAGECONFIG[postgresql] = "--enable-postgresql --with-libpq=yes, \
33 --disable-postgresql --with-libpq=no,postgresql"
34PACKAGECONFIG[mysql] = "--enable-mysql --with-libmysql=yes, \
35 --disable-mysql --with-libmysql=no,mysql5"
36PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi"
37PACKAGECONFIG[modbus] = "--enable-modbus,--disable-modbus,libmodbus"
38PACKAGECONFIG[libowcapi] = "--with-libowcapi,--without-libowcapi,owfs"
39PACKAGECONFIG[sensors] = "--enable-sensors --with-libsensors=yes, \
40 --disable-sensors --with-libsensors=no,lmsensors"
41PACKAGECONFIG[amqp] = "--enable-amqp --with-librabbitmq=yes, \
42 --disable-amqp --with-librabbitmq=no,rabbitmq-c"
43# protobuf-c, libvirt that are currently only available in meta-virtualization layer
44PACKAGECONFIG[pinba] = "--enable-pinba,--disable-pinba,protobuf-c-native protobuf-c"
45PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
46PACKAGECONFIG[libesmtp] = "--with-libesmtp,--without-libesmtp,libesmtp"
47PACKAGECONFIG[libmnl] = "--with-libmnl,--without-libmnl,libmnl"
48PACKAGECONFIG[libatasmart] = "--with-libatasmart,--without-libatasmart,libatasmart"
49PACKAGECONFIG[ldap] = "--enable-openldap --with-libldap,--disable-openldap --without-libldap, openldap"
50
51EXTRA_OECONF = " \
52 ${FPLAYOUT} \
53 --disable-perl --with-libperl=no --with-perl-bindings=no \
54 --with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \
55 --disable-notify_desktop \
56"
57
58do_install_append() {
59 install -d ${D}${sysconfdir}/init.d
60 install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd
61 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd
62 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd
63 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd
64 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd
65
66 # Fix configuration file to allow collectd to start up
67 sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup false!g' ${D}${sysconfdir}/collectd.conf
68
69 rmdir "${D}${localstatedir}/run"
70 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
71
72 # Install systemd unit files
73 install -d ${D}${systemd_unitdir}/system
74 install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system
75 sed -i -e 's,@SBINDIR@,${sbindir},g' \
76 ${D}${systemd_unitdir}/system/collectd.service
77}
78
79INITSCRIPT_NAME = "collectd"
80INITSCRIPT_PARAMS = "defaults"
81
82# threshold.so load.so are also provided by gegl
83# disk.so is also provided by libgphoto2-camlibs
84PRIVATE_LIBS = "threshold.so load.so disk.so"