diff options
author | vkalintiris <vasilis@netdata.cloud> | 2023-12-13 16:41:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 16:41:20 +0200 |
commit | 92842d8422a570aed4005b5069531f7f5189fe4d (patch) | |
tree | 6923d0e00551ab448f7211e865577cd7a8991aef /contrib | |
parent | 548489555bbdadc7274a2165f365b968992b98da (diff) |
CMake build system. (#15996)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud>
Co-authored-by: Tasos Katsoulas <12612986+tkatsoulas@users.noreply.github.com>
Co-authored-by: Emmanuel Vasilakis <mrzammler@mm.st>
Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Co-authored-by: netdatabot <bot@netdata.cloud>
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/debian/control | 46 | ||||
-rw-r--r-- | contrib/debian/netdata-plugin-xenstat.postinst | 14 | ||||
-rw-r--r-- | contrib/debian/netdata-plugin-xenstat.preinst | 13 | ||||
-rwxr-xr-x | contrib/debian/rules | 70 |
4 files changed, 113 insertions, 30 deletions
diff --git a/contrib/debian/control b/contrib/debian/control index 4163aa1df5..b48efdf93e 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -1,34 +1,31 @@ Source: netdata -Build-Depends: debhelper (>= 9.20160709), - dh-autoreconf, +Build-Depends: debhelper (>= 10), dpkg-dev (>= 1.13.19), - zlib1g-dev, - uuid-dev, + bison, + cmake, + curl, + flex, + libcups2-dev, libcurl4-openssl-dev, libelf-dev, - libuv1-dev, + libipmimonitoring-dev, + libjson-c-dev, liblz4-dev, - libssl-dev, libmnl-dev, - libjson-c-dev, - libyaml-dev, - libcups2-dev, - libipmimonitoring-dev, + libmongoc-dev, libnetfilter-acct-dev, - libsnappy-dev, libpcre2-dev, libprotobuf-dev, libprotoc-dev, + libsnappy-dev, + libssl-dev, libsystemd-dev, - cmake, - autogen, - autoconf, - automake, + libuv1-dev, + libyaml-dev, pkg-config, - curl, protobuf-compiler, - bison, - flex + uuid-dev, + zlib1g-dev Section: net Priority: optional Maintainer: Netdata Builder <bot@netdata.cloud> @@ -134,8 +131,7 @@ Description: Compiled eBPF legacy code for the Netdata eBPF plugin Package: netdata-plugin-pythond Architecture: all -Depends: ${shlibs:Depends}, - netdata (= ${source:Version}) +Depends: netdata (= ${source:Version}) Pre-Depends: adduser Suggests: sudo Conflicts: netdata (<< ${source:Version}) @@ -207,6 +203,16 @@ Description: The systemd-journal collector for the Netdata Agent This plugin allows the Netdata Agent to present logs from the systemd journal on Netdata Cloud or the local Agent dashboard. +Package: netdata-plugin-xenstat +Architecture: amd64 arm64 +Depends: ${shlibs:Depends}, + netdata (= ${source:Version}) +Pre-Depends: adduser +Conflicts: netdata (<< ${source:Version}) +Description: The xenstat plugin for the Netdata Agent + This plugin allows the Netdata Agent to collect metrics from the Xen + Hypervisor. + Package: netdata-plugin-logs-management Architecture: any Depends: ${shlibs:Depends}, diff --git a/contrib/debian/netdata-plugin-xenstat.postinst b/contrib/debian/netdata-plugin-xenstat.postinst new file mode 100644 index 0000000000..5da553ffca --- /dev/null +++ b/contrib/debian/netdata-plugin-xenstat.postinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +case "$1" in + configure|reconfigure) + chown root:netdata /usr/libexec/netdata/plugins.d/xenstat.plugin + chmod -f 4750 /usr/libexec/netdata/plugins.d/xenstat.plugin + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/contrib/debian/netdata-plugin-xenstat.preinst b/contrib/debian/netdata-plugin-xenstat.preinst new file mode 100644 index 0000000000..fcabb415aa --- /dev/null +++ b/contrib/debian/netdata-plugin-xenstat.preinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +case "$1" in + install) + if ! getent group netdata > /dev/null; then + addgroup --quiet --system netdata + fi + ;; +esac + +#DEBHELPER# diff --git a/contrib/debian/rules b/contrib/debian/rules index d0aa353943..6cfa9f6b09 100755 --- a/contrib/debian/rules +++ b/contrib/debian/rules @@ -4,26 +4,41 @@ # the location of plugins in /usr/lib TOP = $(CURDIR)/debian/netdata TEMPTOP = $(CURDIR)/debian/tmp +BUILDDIR = $(CURDIR)/debian/build BASE_CONFIG = system/netdata.conf SYSTEMD_VERSION = $(shell /bin/sh -c "systemd --version 2>&1 | head -n 1 | cut -f 2 -d ' '") ifeq ($(shell test $(SYSTEMD_VERSION) -ge 235 && echo "1"), 1) -SYSTEMD_UNIT = system/systemd/netdata.service.v235 +SYSTEMD_UNIT = $(BUILDDIR)/system/systemd/netdata.service.v235 else -SYSTEMD_UNIT = system/systemd/netdata.service +SYSTEMD_UNIT = $(BUILDDIR)/system/systemd/netdata.service endif ifeq ($(shell test ${DEB_TARGET_ARCH} != "amd64" && echo "1"), 1) HAVE_EBPF = 0 -EBPF_CONFIG = --disable-ebpf +EBPF_CONFIG = -DENABLE_PLUGIN_EBPF=Off else HAVE_EBPF = 1 +EBPF_CONFIG = -DENABLE_PLUGIN_EBPF=On +endif + +ifeq ($(shell test ${DEB_TARGET_ARCH} != "amd64" && echo "1"), 1) +ifeq ($(shell test ${DEB_TARGET_ARCH} != "arm64" && echo "1"), 1) +HAVE_XENSTAT = 0 +XENSTAT_CONFIG = -DENABLE_PLUGIN_XENSTAT=Off +else +HAVE_XENSTAT = 1 +XENSTAT_CONFIG = -DENABLE_PLUGIN_XENSTAT=On +endif +else +HAVE_XENSTAT = 1 +XENSTAT_CONFIG = -DENABLE_PLUGIN_XENSTAT=On endif %: - dh $@ + dh $@ --builddirectory=$(BUILDDIR) override_dh_installinit: echo "SystemD Version: $(SYSTEMD_VERSION)" @@ -38,10 +53,33 @@ override_dh_auto_configure: packaging/bundle-libbpf.sh . ${TOP}/usr/libexec/netdata/plugins.d; \ packaging/bundle-ebpf-co-re.sh . ${TOP}/usr/libexec/netdata/plugins.d; \ fi - autoreconf -ivf - dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib \ - --libexecdir=/usr/libexec --with-user=netdata --with-math --with-zlib --with-webdir=/var/lib/netdata/www \ - --disable-dependency-tracking $(EBPF_CONFIG) + dh_auto_configure -- -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/ \ + -DENABLE_ACLK=On \ + -DENABLE_CLOUD=On \ + -DENABLE_DBENGINE=On \ + -DENABLE_H2O=On \ + -DENABLE_ML=On \ + -DENABLE_PLUGIN_APPS=On \ + -DENABLE_PLUGIN_CGROUP_NETWORK=On \ + -DENABLE_PLUGIN_DEBUGFS=On \ + $(EBPF_CONFIG) \ + -DENABLE_PLUGIN_FREEIPMI=On \ + -DENABLE_PLUGIN_LOCAL_LISTENERS=On \ + -DENABLE_PLUGIN_NFACCT=On \ + -DENABLE_PLUGIN_PERF=On \ + -DENABLE_PLUGIN_SLABINFO=On \ + -DENABLE_PLUGIN_SYSTEMD_JOURNAL=On \ + -DENABLE_PLUGIN_LOGS_MANAGEMENT=On \ + $(XENSTAT_CONFIG) \ + -DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=On \ + -DENABLE_EXPORTER_MONGODB=On \ + -DENABLE_BUNDLED_PROTOBUF=Off \ + -DENABLE_BUNDLED_JSONC=Off \ + -DENABLE_BUNDLED_YAML=Off + +override_dh_auto_test: + true override_dh_install: cp -v $(BASE_CONFIG) debian/netdata.conf @@ -140,6 +178,13 @@ override_dh_install: mv -f $(TEMPTOP)/usr/lib/netdata/conf.d/logsmanagement.d/ \ $(TOP)-plugin-logs-management/usr/lib/netdata/conf.d/logsmanagement.d/ + # Add xenstat plugin install rules + if [ $(HAVE_XENSTAT) -eq 1 ]; then \ + mkdir -p $(TOP)-plugin-xenstat/usr/libexec/netdata/plugins.d/ ; \ + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/xenstat.plugin \ + $(TOP)-plugin-xenstat/usr/libexec/netdata/plugins.d/xenstat.plugin; \ + fi + # Set the rest of the software in the main package # cp -rp $(TEMPTOP)/usr $(TOP) @@ -231,11 +276,16 @@ override_dh_fixperms: # systemd-journal chmod 4750 $(TOP)-plugin-systemd-journal/usr/libexec/netdata/plugins.d/systemd-journal.plugin - # systemd-journal + # xenstat + if [ $(HAVE_XENSTAT) -eq 1 ]; then \ + chmod 4750 $(TOP)-plugin-xenstat/usr/libexec/netdata/plugins.d/xenstat.plugin; \ + fi + + # logs-management chmod 4750 $(TOP)-plugin-logs-management/usr/libexec/netdata/plugins.d/logs-management.plugin override_dh_installlogrotate: - cp system/logrotate/netdata debian/netdata.logrotate + cp $(BUILDDIR)/system/logrotate/netdata debian/netdata.logrotate dh_installlogrotate override_dh_installdeb: |