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