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