#!/usr/bin/make -f # 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 VERSION := $(shell dpkg-parsechangelog -SVersion) VERSION_MAJOR := $(word 1, $(subst ., ,$(VERSION))) VERSION_MINOR := $(word 2, $(subst ., ,$(VERSION))) VERSION_FIX := $(word 3, $(subst -, ,$(subst ., ,$(VERSION)))) VERSION_SUFFIX := -$(word 4, $(subst -, ,$(subst ., ,$(VERSION)))) export DH_VERBOSE = 1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -O3 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed MULTIARCH_INSTALL = debian/netdata.postinst %: dh $@ override_dh_autoreconf: rm -f debian/configure.ac.orig cp configure.ac debian/configure.ac.orig sed -i -e 's/^\(define(\[VERSION_MAJOR]\).*/\1, [$(VERSION_MAJOR)])/' \ -e 's/^\(define(\[VERSION_MINOR]\).*/\1, [$(VERSION_MINOR)])/' \ -e 's/^\(define(\[VERSION_FIX]\).*/\1, [$(VERSION_FIX)])/' \ -e 's/^\(define(\[VERSION_SUFFIX]\).*/\1, [$(VERSION_SUFFIX)])/' \ configure.ac dh_autoreconf override_dh_autoreconf_clean: if [ -e debian/configure.ac.orig ]; \ then \ rm -f configure.ac; \ mv debian/configure.ac.orig configure.ac; \ fi dh_autoreconf_clean override_dh_auto_configure: dh_auto_configure -- --libexecdir=/usr/lib/$(DEB_HOST_MULTIARCH) --disable-x86-sse --enable-plugin-freeipmi --with-math $(MULTIARCH_INSTALL): % : %.in sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@ override_dh_install: $(MULTIARCH_INSTALL) # Remove unneeded .keep files find debian/tmp -name .keep -delete dh_install override_dh_install-indep: dh_install # Setting package version (update check) echo $(VERSION) > $(TOP)-data/usr/share/netdata/web/version.txt override_dh_fixperms-arch: dh_fixperms # apps.plugin should only be runnable by the netdata user. It will be # given extra capabilities in the postinst script. # chmod 0754 $(TOP)/usr/lib/$(DEB_HOST_MULTIARCH)/netdata/plugins.d/apps.plugin chmod 0644 $(TOP)/usr/lib/$(DEB_HOST_MULTIARCH)/netdata/plugins.d/loopsleepms.sh.inc chmod 4754 $(TOP)/usr/lib/$(DEB_HOST_MULTIARCH)/netdata/plugins.d/freeipmi.plugin chmod 0644 $(TOP)/usr/lib/$(DEB_HOST_MULTIARCH)/netdata/charts.d/*.sh chmod 0644 $(TOP)/usr/lib/$(DEB_HOST_MULTIARCH)/netdata/python.d/*.py