@cryptotaxi247 / netdata-1 / commits / 00a828d4a

netdata/packaging: Introduce separate CUPS package for debian distributions (#6724)

* netdata/packaging: baby steps, create the new package and introduce the install file * netdata/packaging: [ci skip] change branch to be able to test * netdata/packaging: we do define usrlib path to be /usr/lib * netdata/packaging: silence sign errors for now * netdata/packaging: Add rules for plugin-cups sub package * netdata/packaging: [ci skip] That is libexec, not lib, duh * netdata/packaging: [ci skip] explicitly arrange the other plugins also * netdata/packaging: [ci skip] fix bug * netdata/packaging: copy, dont move * netdata/packaging: move all plugins around, also remove a slash * netdata/packaging: [ci skip] align travis.yml changes with the ones we used on rpm cups pkg split * netdata/packaging:[ci skip] add netdata dependency * netdata/packaging:[ci skip] Update control files * netdata/packaging: Add separate control file for buster, dependencies deviate (libprotoc17 instead of libprotoc10....) * netdata/packaging: [ci skip] whoops * netdata/packaging: [ci skip] Copy over files from temp dir, if destination non existent * netdata/packaging:[ci skip] -d, not -f * netdata/packaging: [ci skip] long shot * netdata/packaging: [ci skip] revert this - need to retest * netdata/packaging: [ci skip] remove the .install, as per an article input (https://askubuntu.com/questions/660373/dh-install-fails-with-missing-files) these files are for handling items not managed by the upstream build system, so bye bye * netdata/packaging: Ok, lets ditch dh_auto_configure * Revert "netdata/packaging: Ok, lets ditch dh_auto_configure" This reverts commit 3b497cf5f6e157ce5429ffce38452515670a934a. Well, that didn't affect anything * netdata/packaging: [ci skip] here's a crazy thought Okay, assuming that packager decided to use debian/tmp because we introduced multiple packages. If that is the case, then move the custom stuff out first and then just move all debian/tmp to debian/netdata. In theory, that should get me back on track for the rest of the package processing. Lets see if i was right * netdata/packaging: [ci skip] mv complains, forgot about that, fix forgot about that, just copy for now to verify the use case and we will consider rsync approach for faster processing afterwards * netdata/packaging: nope, that didn't work. rollback and remove also a suspicious backslash * netdata/packaging: ok, trying this * netdata/packaging: really? * netdata/packaging: [ci skip] reinstate original setup, the bug probably was too obvious to spot * netdata/packaging:[ci skip] now that you finally noted the www bug, try to copy over the rest of the stuff in * netdata/packaging: [ci skip] long shot, etc is not properly created, lets see if it was already there and we messed it up * netdata/packaging: [ci skip] fix perms, add placeholder folders in etc * netdata/packaging: [ci skip] preserve ownership details when copying over * netdata/packaging:[ci skip] reinstate branch condition * netdata/packaging: redudant * netdata/packaging: xenial - add cups subpackage * netdata/packaging: remove cups dependency from those distros, missed to update the control file * netdata/packaging: dont use personal account info

Paul Emm. Katsoulakis committed Sep 16, 2019 at 11:52 UTC 00a828d4abb500ee49f1fb3ac8b7d2f258c3b1fd
9 files changed +77 -10
.travis.yml
+2 -1
@@ -27,9 +27,10 @@ install:
27 - export LATEST_RELEASE_DATE="$(git log -1 --format=%aD "${LATEST_RELEASE_VERSION}" | cat)"
28 - if [[ "${TRAVIS_COMMIT_MESSAGE}" = *"[Build latest]"* ]]; then export BUILD_VERSION="$(cat packaging/version | cut -d'-' -f1,2 | sed -e 's/-/./g').latest"; fi;
29 - export DEPLOY_REPO="netdata" # Default production packaging repository
30 + - export PACKAGING_USER="netdata" # Standard package cloud account
31 - if [[ "${TRAVIS_COMMIT_MESSAGE}" = *"[Build latest]"* ]]; then export DEPLOY_REPO="netdata-edge"; fi;
31 - - export PACKAGING_USER="$(echo ${TRAVIS_REPO_SLUG} | cut -d'/' -f1)"
32 - export PACKAGE_CLOUD_RETENTION_DAYS=30
33 + - if [ ! "${TRAVIS_REPO_SLUG}" = "netdata/netdata" ]; then export DEPLOY_REPO="netdata-devel"; fi;
34
35
36
.travis/package_management/build.sh
+2 -2
@@ -24,9 +24,9 @@ ln -sf contrib/debian debian
24 echo "Executing dpkg-buildpackage"
25 # pre/post options are after 1.18.8, is simpler to just check help for their existence than parsing version
26 if dpkg-buildpackage --help | grep "\-\-post\-clean" 2> /dev/null > /dev/null; then
27 - dpkg-buildpackage --post-clean --pre-clean --build=binary
27 + dpkg-buildpackage --post-clean --pre-clean --build=binary -us -uc
28 else
29 - dpkg-buildpackage -b
29 + dpkg-buildpackage -b -us -uc
30 fi
31
32 echo "DEB build script completed!"
contrib/debian/control
+6 -1
@@ -43,7 +43,6 @@ Depends: adduser,
43 openssl,
44 libmnl0,
45 libjson-c3,
46 - cups,
46 freeipmi,
47 libnetfilter-acct1,
48 libprotobuf-c1,
@@ -56,3 +55,9 @@ Description: real-time charts for system monitoring
55 and presents a web site to view and analyze them. The presentation
56 is also real-time and full of interactive charts that precisely
57 render all collected values.
58 +
59 +Package: netdata-plugin-cups
60 +Architecture: any
61 +Depends: cups,
62 + netdata (>= ${source:Version})
63 +Description: The Common Unix Printing System plugin for metrics collection from cupds
contrib/debian/control.buster
+6 -1
@@ -43,7 +43,6 @@ Depends: adduser,
43 openssl,
44 libmnl0,
45 libjson-c3,
46 - cups,
46 freeipmi,
47 libnetfilter-acct1,
48 libprotobuf-c1,
@@ -56,3 +55,9 @@ Description: real-time charts for system monitoring
55 and presents a web site to view and analyze them. The presentation
56 is also real-time and full of interactive charts that precisely
57 render all collected values.
58 +
59 +Package: netdata-plugin-cups
60 +Architecture: any
61 +Depends: cups,
62 + netdata (>= ${source:Version})
63 +Description: The Common Unix Printing System plugin for metrics collection from cupds
contrib/debian/control.jessie
+6 -1
@@ -41,7 +41,6 @@ Depends: adduser,
41 openssl,
42 libmnl0,
43 libjson-c3,
44 - cups,
44 freeipmi,
45 libnetfilter-acct1,
46 libprotobuf-c1,
@@ -54,3 +53,9 @@ Description: real-time charts for system monitoring
53 and presents a web site to view and analyze them. The presentation
54 is also real-time and full of interactive charts that precisely
55 render all collected values.
56 +
57 +Package: netdata-plugin-cups
58 +Architecture: any
59 +Depends: cups,
60 + netdata (>= ${source:Version})
61 +Description: The Common Unix Printing System plugin for metrics collection from cupds
contrib/debian/control.trusty
+6 -1
@@ -41,7 +41,6 @@ Depends: adduser,
41 openssl,
42 libmnl0,
43 libjson-c2,
44 - cups,
44 freeipmi,
45 libnetfilter-acct1,
46 libprotobuf-c0,
@@ -54,3 +53,9 @@ Description: real-time charts for system monitoring
53 and presents a web site to view and analyze them. The presentation
54 is also real-time and full of interactive charts that precisely
55 render all collected values.
56 +
57 +Package: netdata-plugin-cups
58 +Architecture: any
59 +Depends: cups,
60 + netdata (>= ${source:Version})
61 +Description: The Common Unix Printing System plugin for metrics collection from cupds
contrib/debian/control.wheezy
+6
@@ -23,3 +23,9 @@ Description: real-time charts for system monitoring
23 and presents a web site to view and analyze them. The presentation
24 is also real-time and full of interactive charts that precisely
25 render all collected values.
26 +
27 +Package: netdata-plugin-cups
28 +Architecture: any
29 +Depends: cups,
30 + netdata (>= ${source:Version})
31 +Description: The Common Unix Printing System plugin for metrics collection from cupds
contrib/debian/control.xenial
+6 -1
@@ -43,7 +43,6 @@ Depends: adduser,
43 openssl,
44 libmnl0,
45 libjson-c2,
46 - cups,
46 freeipmi,
47 libnetfilter-acct1,
48 libprotobuf-c1,
@@ -56,3 +55,9 @@ Description: real-time charts for system monitoring
55 and presents a web site to view and analyze them. The presentation
56 is also real-time and full of interactive charts that precisely
57 render all collected values.
58 +
59 +Package: netdata-plugin-cups
60 +Architecture: any
61 +Depends: cups,
62 + netdata (>= ${source:Version})
63 +Description: The Common Unix Printing System plugin for metrics collection from cupds
contrib/debian/rules
+37 -2
@@ -4,6 +4,7 @@
4 # the location of plugins in /usr/lib
5 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
6 TOP = $(CURDIR)/debian/netdata
7 +TEMPTOP = $(CURDIR)/debian/tmp
8
9 %:
10 # For jessie and beyond
@@ -31,9 +32,36 @@ override_dh_install: debian/netdata.postinst
32 #
33 find "$(TOP)" -name .keep -exec rm '{}' ';'
34
35 + # Set the CUPS plugin install rule
36 + #
37 + mkdir -p $(TOP)-plugin-cups/usr/libexec/netdata/plugins.d
38 + mv -f $(TEMPTOP)/usr/libexec/netdata/plugins.d/cups.plugin \
39 + $(TOP)-plugin-cups/usr/libexec/netdata/plugins.d/cups.plugin
40 +
41 + # Set the rest of the software in the main package
42 + #
43 + cp -rp $(TEMPTOP)/usr $(TOP)/usr
44 + cp -rp $(TEMPTOP)/var $(TOP)/var
45 + #cp -rp $(TEMPTOP)/etc $(TOP)/etc
46 +
47 + # Copy sample netdata.conf
48 + cp -p $(CURDIR)/system/edit-config $(TOP)/etc/netdata/
49 +
50 + # Create placeholder dirs in netdata configuration directory
51 + #
52 + mkdir -p $(TOP)/etc/netdata/health.d
53 + mkdir -p $(TOP)/etc/netdata/python.d
54 + mkdir -p $(TOP)/etc/netdata/charts.d
55 + mkdir -p $(TOP)/etc/netdata/cystonm-plugins.d
56 + mkdir -p $(TOP)/etc/netdata/go.d
57 + mkdir -p $(TOP)/etc/netdata/ssl
58 + mkdir -p $(TOP)/etc/netdata/node.d
59 + mkdir -p $(TOP)/etc/netdata/statsd.d
60 +
61 +
62 # Move files that local user shouldn't be editing to /usr/share/netdata
63 #
36 - mkdir -p "$(TOP)/usr/share/netdata"
64 + mkdir -p "$(TOP)/usr/share/netdata/www"
65 for D in $$(find "$(TOP)/var/lib/netdata/www/" -maxdepth 1 -type d -printf '%f '); do \
66 echo Relocating $$D; \
67 mv "$(TOP)/var/lib/netdata/www/$$D" "$(TOP)/usr/share/netdata/www/$$D"; \
@@ -55,7 +83,7 @@ override_dh_install: debian/netdata.postinst
83
84 # Install go
85 #
58 - debian/install_go.sh $$(cat ${CURDIR}/packaging/go.d.version) $(TOP)/usr/lib/$(DEB_HOST_MULTIARCH)/netdata/ $(TOP)/usr/libexec/netdata
86 + debian/install_go.sh $$(cat ${CURDIR}/packaging/go.d.version) $(TOP)/usr/lib/netdata $(TOP)/usr/libexec/netdata
87
88 override_dh_installdocs:
89 dh_installdocs
@@ -81,6 +109,13 @@ override_dh_fixperms:
109 chmod 0754 $(TOP)/usr/libexec/netdata/plugins.d/perf.plugin
110 chmod 0750 $(TOP)/usr/libexec/netdata/plugins.d/go.d.plugin
111
112 + # Support script for configuration file management
113 + #
114 + chmod 0750 $(TOP)/etc/netdata/edit-config
115 +
116 + # CUPS plugin package
117 + chmod 0750 $(TOP)-plugin-cups/usr/libexec/netdata/plugins.d/cups.plugin
118 +
119 override_dh_installlogrotate:
120 cp system/netdata.logrotate debian/netdata.logrotate
121 dh_installlogrotate