1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
#! /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
|