summaryrefslogtreecommitdiffstats
path: root/contrib/debian/rules
diff options
context:
space:
mode:
authorJames Mills <prologic@shortcircuit.net.au>2020-03-30 14:05:46 +1000
committerGitHub <noreply@github.com>2020-03-30 14:05:46 +1000
commitd5d1865469b63385d70645f710728482aed0f23d (patch)
tree8f27ba9794542fad7c20db90f997f707a5a19289 /contrib/debian/rules
parent3568c340ada6878686bfe5b6f39a8c75c7c64ca7 (diff)
Fix our Debian/Ubuntu packages to actually package the SystemD Unit files we expect. (#8468)
* update netdata.conf for debian build * Fix Debian Ubuntu SystemD Unit packaging * avoid duplicate netdata.conf files violates single source of truth principle, use schema from #8468 instead * Fixed *DirectoryMode octets and bad ExecStart * Fix dpkg-statoverride warnings * Move the copy of debian/netdata.conf into the correct target (override_dh_install) Co-authored-by: and0x000 <justanpc@gmail.com>
Diffstat (limited to 'contrib/debian/rules')
-rwxr-xr-xcontrib/debian/rules19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/debian/rules b/contrib/debian/rules
index 09883140d3..bd545b698e 100755
--- a/contrib/debian/rules
+++ b/contrib/debian/rules
@@ -6,6 +6,16 @@ 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,6 +27,13 @@ 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 .
@@ -28,6 +45,8 @@ debian/%.postinst: debian/%.postinst.in
sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
override_dh_install: debian/netdata.postinst
+ cp -v $(BASE_CONFIG) debian/netdata.conf
+
dh_install
# Set the CUPS plugin install rule