Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | SUMMARY = "Real-time performance monitoring" |
| 2 | DESCRIPTION = "Netdata is high-fidelity infrastructure monitoring and troubleshooting. \ |
| 3 | Open-source, free, preconfigured, opinionated, and always real-time." |
| 4 | HOMEPAGE = "https://github.com/netdata/netdata/" |
| 5 | LICENSE = "GPL-3.0-only" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=fc9b848046ef54b5eaee6071947abd24" |
| 7 | |
| 8 | DEPENDS += "libuv util-linux zlib" |
| 9 | |
| 10 | SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BPN}-v${PV}.tar.gz \ |
| 11 | " |
| 12 | SRC_URI[sha256sum] = "f4a1233112b55e07e2862ffda0416255f0aa4c8e2b16929b76fa7ad6b69fd931" |
| 13 | |
| 14 | # default netdata.conf for netdata configuration |
| 15 | SRC_URI += "file://netdata.conf" |
| 16 | |
| 17 | # file for providing systemd service support |
| 18 | SRC_URI += "file://netdata.service" |
| 19 | |
| 20 | UPSTREAM_CHECK_URI = "https://github.com/netdata/netdata/releases" |
| 21 | |
| 22 | S = "${WORKDIR}/${BPN}-v${PV}" |
| 23 | |
| 24 | # Stop sending anonymous statistics to Google Analytics |
| 25 | NETDATA_ANONYMOUS ??= "enabled" |
| 26 | |
| 27 | inherit pkgconfig autotools-brokensep useradd systemd |
| 28 | |
| 29 | LIBS:toolchain-clang:x86 = "-latomic" |
| 30 | LIBS:riscv64 = "-latomic" |
| 31 | LIBS:riscv32 = "-latomic" |
| 32 | LIBS:mips = "-latomic" |
| 33 | export LIBS |
| 34 | |
| 35 | #systemd |
| 36 | SYSTEMD_PACKAGES = "${PN}" |
| 37 | SYSTEMD_SERVICE:${PN} = "netdata.service" |
| 38 | SYSTEMD_AUTO_ENABLE:${PN} = "enable" |
| 39 | |
| 40 | #User specific |
| 41 | USERADD_PACKAGES = "${PN}" |
| 42 | USERADD_PARAM:${PN} = "--system --no-create-home --home-dir ${localstatedir}/run/netdata --user-group netdata" |
| 43 | |
| 44 | PACKAGECONFIG ??= "https" |
| 45 | PACKAGECONFIG[cloud] = "--enable-cloud, --disable-cloud, json-c" |
| 46 | PACKAGECONFIG[compression] = "--enable-compression, --disable-compression, lz4" |
| 47 | PACKAGECONFIG[https] = "--enable-https, --disable-https, openssl" |
| 48 | |
| 49 | # ebpf doesn't compile (or detect) the cross compilation well |
| 50 | EXTRA_OECONF += "--disable-ebpf" |
| 51 | |
| 52 | do_install:append() { |
| 53 | #set S UID for plugins |
| 54 | chmod 4755 ${D}${libexecdir}/netdata/plugins.d/apps.plugin |
| 55 | |
| 56 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 57 | # Install systemd unit files |
| 58 | install -d ${D}${systemd_unitdir}/system |
| 59 | install -m 0644 ${WORKDIR}/netdata.service ${D}${systemd_unitdir}/system |
| 60 | sed -i -e 's,@@datadir,${datadir_native},g' ${D}${systemd_unitdir}/system/netdata.service |
| 61 | fi |
| 62 | |
| 63 | # Install default netdata.conf |
| 64 | install -d ${D}${sysconfdir}/netdata |
| 65 | install -m 0644 ${WORKDIR}/netdata.conf ${D}${sysconfdir}/netdata/ |
| 66 | sed -i -e 's,@@sysconfdir,${sysconfdir},g' ${D}${sysconfdir}/netdata/netdata.conf |
| 67 | sed -i -e 's,@@libdir,${libexecdir},g' ${D}${sysconfdir}/netdata/netdata.conf |
| 68 | sed -i -e 's,@@datadir,${datadir},g' ${D}${sysconfdir}/netdata/netdata.conf |
| 69 | |
| 70 | if [ "${NETDATA_ANONYMOUS}" = "enabled" ]; then |
| 71 | touch ${D}${sysconfdir}/netdata/.opt-out-from-anonymous-statistics |
| 72 | fi |
| 73 | |
| 74 | install --group netdata --owner netdata --directory ${D}${localstatedir}/cache/netdata |
| 75 | install --group netdata --owner netdata --directory ${D}${localstatedir}/lib/netdata |
| 76 | |
| 77 | chown -R netdata:netdata ${D}${datadir}/netdata/web |
| 78 | } |
| 79 | |
| 80 | FILES:${PN} += "${localstatedir}/cache/netdata/ ${localstatedir}/lib/netdata/" |
| 81 | |
| 82 | RDEPENDS:${PN} = "bash zlib" |