#! /usr/bin/make -f # for DEB_VERSION_UPSTREAM include /usr/share/dpkg/pkg-info.mk # export DH_VERBOSE=1 MAKEOPTS = INSTALLDIRS=vendor BUILD_DATE = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "@$(SOURCE_DATE_EPOCH)") %: dh $@ override_dh_auto_build: # ./getversion reads RELEASE if it exists echo "$(DEB_VERSION_UPSTREAM)" >RELEASE dh_auto_build -- $(MAKEOPTS) # show local network configuration (debugging a build failure on the buildd hosts) ip addr || ifconfig || true cat /etc/hosts || true # build java plugin files $(MAKE) -f Makefile.config -f Makefile.javaplugin build-plugins-java $(MAKE) -C doc html man SPHINXOPTS="-D today=\"$(BUILD_DATE)\"" override_dh_auto_install: dh_auto_install rm -rfv debian/tmp/usr/share/man/man1 # configuration files mv debian/tmp/etc/munin/munin-node.conf.sample debian/tmp/etc/munin/munin-node.conf sed -i -e '/^log_file/clog_file Sys::Syslog' debian/tmp/etc/munin/munin-node.conf sed -i -e '/^pid_file/cpid_file /run/munin-node.pid' debian/tmp/etc/munin/munin-node.conf mv debian/tmp/etc/munin/munin.conf.sample debian/tmp/etc/munin/munin.conf # install debian provided plugin configuration install -D -m0644 debian/plugins.conf \ $(CURDIR)/debian/munin-node/etc/munin/plugin-conf.d/munin-node # replace embedded copies of "fonts-materialdesignicons-webfont" with symlinks $(RM) debian/tmp/etc/munin/static/css/materialdesignicons.css ln -s ../../../../usr/share/fonts-materialdesignicons-webfont/css/materialdesignicons.css \ debian/tmp/etc/munin/static/css/materialdesignicons.css $(RM) -r debian/tmp/etc/munin/static/fonts ln -s ../../../../usr/share/fonts-materialdesignicons-webfont/fonts \ debian/tmp/etc/munin/static/fonts # replace embedded copy of "libjs-jquery" with symlink $(RM) debian/tmp/etc/munin/static/js/jquery-1.8.3.js ln -s ../../../../usr/share/javascript/jquery/jquery.js \ debian/tmp/etc/munin/static/js/jquery.js sed -i 's#/js/jquery-1\.8\.3\.js#/js/jquery.js#' \ debian/tmp/etc/munin/templates/partial/head.tmpl # java plugins $(MAKE) -f Makefile.javaplugin install-plugins-java \ LIBDIR=debian/munin-plugins-java/usr/share/munin \ JAVALIBDIR=debian/munin-plugins-java/usr/share/munin override_dh_strip_nondeterminism: # Sadly "Rules-Requires-Root: no" combined with "ExtUtils::MakeMaker" leads to directories # (and files) with read-only permissions for the owner. # See https://alioth-lists-archive.debian.net/pipermail/debhelper-devel/2017-October/007241.html # We need to add owner's write permissions for changes by "dh_strip_nondeterminism". find debian/munin/etc/munin/static/img/ -type f -name "*.png" -perm 0444 -print0 | xargs -0 chmod u+w dh_strip_nondeterminism override_dh_installinit: dh_installinit --package=munin-async dh_installinit --package=munin-node dh_installinit --name=munin-httpd dh_installinit --name=munin-rrdcached dh_installinit --name=munin-tmpfiles override_dh_installsystemd: dh_installsystemd --package=munin dh_installsystemd --package=munin-async dh_installsystemd --package=munin-node dh_installsystemd --name=munin-httpd dh_installsystemd --name=munin-rrdcached override_dh_installdocs: dh_installdocs --link-doc=munin-common --doc-main-package=munin-common -p munin-doc dh_installdocs --link-doc=munin-common --remaining-packages @ # Use the packaged javascript libraries rm debian/munin-doc/usr/share/doc/munin-common/html/_static/jquery.js; \ ln -s /usr/share/javascript/jquery/jquery.js \ debian/munin-doc/usr/share/doc/munin-common/html/_static/jquery.js; \ rm debian/munin-doc/usr/share/doc/munin-common/html/_static/underscore.js; \ ln -s /usr/share/javascript/underscore/underscore.js \ debian/munin-doc/usr/share/doc/munin-common/html/_static/underscore.js; \ override_dh_missing: dh_missing --fail-missing