blob: 52d99e770489d49c3f54610b19070cffc3ee9545 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "Real-time performance monitoring"
2DESCRIPTION = "Netdata is high-fidelity infrastructure monitoring and troubleshooting. \
3 Open-source, free, preconfigured, opinionated, and always real-time."
4HOMEPAGE = "https://github.com/netdata/netdata/"
5LICENSE = "GPL-3.0-only"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=fc9b848046ef54b5eaee6071947abd24"
7
8DEPENDS += "libuv util-linux zlib"
9
10SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BPN}-v${PV}.tar.gz \
11"
12SRC_URI[sha256sum] = "f4a1233112b55e07e2862ffda0416255f0aa4c8e2b16929b76fa7ad6b69fd931"
13
14# default netdata.conf for netdata configuration
15SRC_URI += "file://netdata.conf"
16
17# file for providing systemd service support
18SRC_URI += "file://netdata.service"
19
20UPSTREAM_CHECK_URI = "https://github.com/netdata/netdata/releases"
21
22S = "${WORKDIR}/${BPN}-v${PV}"
23
24# Stop sending anonymous statistics to Google Analytics
25NETDATA_ANONYMOUS ??= "enabled"
26
27inherit pkgconfig autotools-brokensep useradd systemd
28
29LIBS:toolchain-clang:x86 = "-latomic"
30LIBS:riscv64 = "-latomic"
31LIBS:riscv32 = "-latomic"
32LIBS:mips = "-latomic"
33export LIBS
34
35#systemd
36SYSTEMD_PACKAGES = "${PN}"
37SYSTEMD_SERVICE:${PN} = "netdata.service"
38SYSTEMD_AUTO_ENABLE:${PN} = "enable"
39
40#User specific
41USERADD_PACKAGES = "${PN}"
42USERADD_PARAM:${PN} = "--system --no-create-home --home-dir ${localstatedir}/run/netdata --user-group netdata"
43
44PACKAGECONFIG ??= "https"
45PACKAGECONFIG[cloud] = "--enable-cloud, --disable-cloud, json-c"
46PACKAGECONFIG[compression] = "--enable-compression, --disable-compression, lz4"
47PACKAGECONFIG[https] = "--enable-https, --disable-https, openssl"
48
49# ebpf doesn't compile (or detect) the cross compilation well
50EXTRA_OECONF += "--disable-ebpf"
51
52do_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
80FILES:${PN} += "${localstatedir}/cache/netdata/ ${localstatedir}/lib/netdata/"
81
82RDEPENDS:${PN} = "bash zlib"