xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-extended/collectd/collectd_5.12.0.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Collects and summarises system performance statistics"
2*4882a593SmuzhiyunDESCRIPTION = "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*4882a593SmuzhiyunLICENSE = "GPL-2.0-only & MIT"
4*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=1bd21f19f7f0c61a7be8ecacb0e28854"
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunDEPENDS = "rrdtool curl libpcap libxml2 yajl libgcrypt libtool lvm2"
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunSRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \
9*4882a593Smuzhiyun           file://collectd.init \
10*4882a593Smuzhiyun           file://collectd.service \
11*4882a593Smuzhiyun           file://no-gcrypt-badpath.patch \
12*4882a593Smuzhiyun           file://0001-fix-to-build-with-glibc-2.25.patch \
13*4882a593Smuzhiyun           file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \
14*4882a593Smuzhiyun           file://0005-Disable-new-gcc8-warnings.patch \
15*4882a593Smuzhiyun           file://0006-libcollectdclient-Fix-string-overflow-errors.patch \
16*4882a593Smuzhiyun           file://0001-Remove-including-sys-sysctl.h-on-glibc-based-systems.patch \
17*4882a593Smuzhiyun           "
18*4882a593SmuzhiyunSRC_URI[md5sum] = "2b23a65960bc323d065234776a542e04"
19*4882a593SmuzhiyunSRC_URI[sha256sum] = "5bae043042c19c31f77eb8464e56a01a5454e0b39fa07cf7ad0f1bfc9c3a09d6"
20*4882a593Smuzhiyun
21*4882a593Smuzhiyuninherit autotools python3native update-rc.d pkgconfig systemd
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "collectd.service"
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun# Floatingpoint layout, architecture dependent
26*4882a593Smuzhiyun# 'nothing', 'endianflip' or 'intswap'
27*4882a593SmuzhiyunFPLAYOUT ?= "--with-fp-layout=nothing"
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunPACKAGECONFIG ??= ""
30*4882a593SmuzhiyunPACKAGECONFIG[openjdk] = "--with-java=${STAGING_DIR_TARGET}${libdir}/jvm,--without-java,openjdk-7"
31*4882a593SmuzhiyunPACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp"
32*4882a593SmuzhiyunPACKAGECONFIG[libmemcached] = "--with-libmemcached,--without-libmemcached,libmemcached"
33*4882a593SmuzhiyunPACKAGECONFIG[iptables] = "--enable-iptables,--disable-iptables,iptables"
34*4882a593SmuzhiyunPACKAGECONFIG[postgresql] = "--enable-postgresql --with-libpq=yes, \
35*4882a593Smuzhiyun        --disable-postgresql --with-libpq=no,postgresql"
36*4882a593SmuzhiyunPACKAGECONFIG[mysql] = "--enable-mysql --with-libmysql=yes, \
37*4882a593Smuzhiyun        --disable-mysql --with-libmysql=no,mysql5"
38*4882a593SmuzhiyunPACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi"
39*4882a593SmuzhiyunPACKAGECONFIG[modbus] = "--enable-modbus,--disable-modbus,libmodbus"
40*4882a593SmuzhiyunPACKAGECONFIG[libowcapi] = "--with-libowcapi,--without-libowcapi,owfs"
41*4882a593SmuzhiyunPACKAGECONFIG[sensors] = "--enable-sensors --with-libsensors=yes, \
42*4882a593Smuzhiyun        --disable-sensors --with-libsensors=no,lmsensors"
43*4882a593SmuzhiyunPACKAGECONFIG[amqp] = "--enable-amqp --with-librabbitmq=yes, \
44*4882a593Smuzhiyun        --disable-amqp --with-librabbitmq=no,rabbitmq-c"
45*4882a593Smuzhiyun# protobuf-c, libvirt that are currently only available in meta-virtualization layer
46*4882a593SmuzhiyunPACKAGECONFIG[pinba] = "--enable-pinba,--disable-pinba,protobuf-c-native protobuf-c"
47*4882a593SmuzhiyunPACKAGECONFIG[libvirt] = "--enable-virt,--disable-virt,libvirt"
48*4882a593SmuzhiyunPACKAGECONFIG[libesmtp] = "--with-libesmtp,--without-libesmtp,libesmtp"
49*4882a593SmuzhiyunPACKAGECONFIG[libmnl] = "--with-libmnl,--without-libmnl,libmnl"
50*4882a593SmuzhiyunPACKAGECONFIG[libatasmart] = "--with-libatasmart,--without-libatasmart,libatasmart"
51*4882a593SmuzhiyunPACKAGECONFIG[ldap] = "--enable-openldap --with-libldap,--disable-openldap --without-libldap, openldap"
52*4882a593SmuzhiyunPACKAGECONFIG[rrdtool] = "--enable-rrdtool,--disable-rrdtool,rrdtool"
53*4882a593SmuzhiyunPACKAGECONFIG[rrdcached] = "--enable-rrdcached,--disable-rrdcached,rrdcached"
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunEXTRA_OECONF = " \
56*4882a593Smuzhiyun                ${FPLAYOUT} \
57*4882a593Smuzhiyun                --disable-perl --with-libperl=no --with-perl-bindings=no \
58*4882a593Smuzhiyun                --with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \
59*4882a593Smuzhiyun                --disable-notify_desktop --disable-werror \
60*4882a593Smuzhiyun"
61*4882a593Smuzhiyun
62*4882a593Smuzhiyundo_install:append() {
63*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/init.d
64*4882a593Smuzhiyun    install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd
65*4882a593Smuzhiyun    sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd
66*4882a593Smuzhiyun    sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd
67*4882a593Smuzhiyun    sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd
68*4882a593Smuzhiyun    sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd
69*4882a593Smuzhiyun    install -Dm 0640 ${B}/src/collectd.conf ${D}${sysconfdir}/collectd.conf
70*4882a593Smuzhiyun    # Fix configuration file to allow collectd to start up
71*4882a593Smuzhiyun    sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup   false!g' ${D}${sysconfdir}/collectd.conf
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun    rmdir ${D}${localstatedir}/run ${D}${localstatedir}/log
74*4882a593Smuzhiyun    rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun    # Install systemd unit files
77*4882a593Smuzhiyun    install -d ${D}${systemd_unitdir}/system
78*4882a593Smuzhiyun    install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system
79*4882a593Smuzhiyun    sed -i -e 's,@SBINDIR@,${sbindir},g' \
80*4882a593Smuzhiyun        ${D}${systemd_unitdir}/system/collectd.service
81*4882a593Smuzhiyun}
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunCONFFILES:${PN} = "${sysconfdir}/collectd.conf"
84*4882a593Smuzhiyun
85*4882a593SmuzhiyunINITSCRIPT_NAME = "collectd"
86*4882a593SmuzhiyunINITSCRIPT_PARAMS = "defaults"
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun# threshold.so load.so are also provided by gegl
89*4882a593Smuzhiyun# disk.so is also provided by libgphoto2-camlibs
90*4882a593SmuzhiyunPRIVATE_LIBS = "threshold.so load.so disk.so"
91