summaryrefslogtreecommitdiffstats
path: root/contrib/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/debian/rules')
-rwxr-xr-xcontrib/debian/rules57
1 files changed, 38 insertions, 19 deletions
diff --git a/contrib/debian/rules b/contrib/debian/rules
index 56d346aeb..9bfd057f1 100755
--- a/contrib/debian/rules
+++ b/contrib/debian/rules
@@ -2,10 +2,19 @@
# Find the arch we are building for, as this determines
# the location of plugins in /usr/lib
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
TOP = $(CURDIR)/debian/netdata
TEMPTOP = $(CURDIR)/debian/tmp
+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/netdata.service.v235
+else
+SYSTEMD_UNIT = system/netdata.service
+endif
+
%:
# For jessie and beyond
#
@@ -17,15 +26,25 @@ TEMPTOP = $(CURDIR)/debian/tmp
#
#dh $@ --with autoreconf
+override_dh_installinit:
+ echo "SystemD Version: $(SYSTEMD_VERSION)"
+ echo "Using SystemD Unit: $(SYSTEMD_UNIT)"
+ cp -v $(SYSTEMD_UNIT) debian/netdata.service
+
+ dh_installinit
+
override_dh_auto_configure:
+ packaging/bundle-mosquitto.sh .
+ packaging/bundle-lws.sh .
+ packaging/bundle-libbpf.sh .
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
+ --libexecdir=/usr/libexec --with-user=netdata --with-math --with-zlib --with-webdir=/var/lib/netdata/www \
+ --with-bundled-lws=externaldeps/libwebsockets
-debian/%.postinst: debian/%.postinst.in
- sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
+override_dh_install:
+ cp -v $(BASE_CONFIG) debian/netdata.conf
-override_dh_install: debian/netdata.postinst
dh_install
# Set the CUPS plugin install rule
@@ -34,14 +53,24 @@ override_dh_install: debian/netdata.postinst
mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/cups.plugin \
$(TOP)-plugin-cups/usr/libexec/netdata/plugins.d/cups.plugin
+ # Add free IPMI plugin install rules
+ #
+ mkdir -p $(TOP)-plugin-freeipmi/usr/libexec/netdata/plugins.d
+ mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/freeipmi.plugin \
+ $(TOP)-plugin-freeipmi/usr/libexec/netdata/plugins.d/freeipmi.plugin
+
# Set the rest of the software in the main package
#
cp -rp $(TEMPTOP)/usr $(TOP)
cp -rp $(TEMPTOP)/var $(TOP)
cp -rp $(TEMPTOP)/etc $(TOP)
+ mkdir -p "$(TOP)/var/log/netdata"
+ mkdir -p "$(TOP)/var/cache/netdata"
+ mkdir -p "$(TOP)/var/run/netdata"
# Move files that local user shouldn't be editing to /usr/share/netdata
#
+ packaging/bundle-dashboard.sh . ${TOP}/var/lib/netdata/www
mkdir -p "$(TOP)/usr/share/netdata/www"
for D in $$(find "$(TOP)/var/lib/netdata/www/" -maxdepth 1 -type d -printf '%f '); do \
echo Relocating $$D; \
@@ -49,18 +78,7 @@ override_dh_install: debian/netdata.postinst
ln -s "/usr/share/netdata/www/$$D" "$(TOP)/var/lib/netdata/www/$$D"; \
done
- # Update postinst to set correct group for www files on installation.
- # Should probably be dpkg-statoverride really, but that gets *really*
- # messy. We also set all web files in /var as conffiles so an upgrade
- # doesn't splat them.
- #
- for D in $$(find "$(TOP)/var/lib/netdata/www/" -maxdepth 1 -type f -printf '%f '); do \
- echo Updating postinst for $$D; \
- sed -i "s/^#PERMS#/chgrp netdata \/var\/lib\/netdata\/www\/$$D\n#PERMS#/g" \
- $(CURDIR)/debian/netdata.postinst; \
- echo "/var/lib/netdata/www/$$D" >> $(CURDIR)/debian/netdata.conffiles; \
- done
- sed -i "/^#PERMS#/d" $(CURDIR)/debian/netdata.postinst
+ packaging/bundle-ebpf.sh . ${TOP}/usr/libexec/netdata/plugins.d
# Install go
#
@@ -86,7 +104,6 @@ override_dh_fixperms:
# given extra capabilities in the postinst script.
#
chmod 0754 $(TOP)/usr/libexec/netdata/plugins.d/apps.plugin
- chmod 0754 $(TOP)/usr/libexec/netdata/plugins.d/freeipmi.plugin
chmod 0754 $(TOP)/usr/libexec/netdata/plugins.d/perf.plugin
chmod 0754 $(TOP)/usr/libexec/netdata/plugins.d/slabinfo.plugin
chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/go.d.plugin
@@ -94,6 +111,9 @@ override_dh_fixperms:
# CUPS plugin package
chmod 0750 $(TOP)-plugin-cups/usr/libexec/netdata/plugins.d/cups.plugin
+ # freeIPMI plugin package
+ chmod 4750 $(TOP)-plugin-freeipmi/usr/libexec/netdata/plugins.d/freeipmi.plugin
+
override_dh_installlogrotate:
cp system/netdata.logrotate debian/netdata.logrotate
dh_installlogrotate
@@ -104,5 +124,4 @@ override_dh_clean:
# Tidy up copied/generated files
#
-[ -r $(CURDIR)/debian/netdata.logrotate ] && rm $(CURDIR)/debian/netdata.logrotate
- -[ -r $(CURDIR)/debian/netdata.postinst ] && rm $(CURDIR)/debian/netdata.postinst
-[ -r $(CURDIR)/debian/netdata.conffiles ] && rm $(CURDIR)/debian/netdata.conffiles