#!/usr/bin/make -f b := $(shell pwd)/debian export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DPKG_BUILD_CFLAGS = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --get CFLAGS) DPKG_BUILD_CPPFLAGS = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --get CPPFLAGS) DPKG_BUILD_LDFLAGS = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags --get LDFLAGS) DOC_PACKAGE = nagios4-cgi SHELL = /bin/sh -e get-orig-source: uscan --force-download clean: dh_testdir -a if test -f Makefile; then make distclean; fi find sources.orig -type f | while read f; do rm "$${f#sources.orig/}" && mv "$${f}" "$${f##sources.orig/}"; done rm -rf sources.orig rm -f keep install-stamp configure-stamp build-stamp rm -f html/js/histogram.js html/js/map.js html/js/trends.js rm -f startup/default-init startup/default-service startup/openrc-init startup/upstart-init find -type d -name autom4te.cache -print0 | xargs -0 -r rm -rf \; find -type d -name build -print0 | xargs -0 -r rm -rf \; rm -f html/index.php lib/snprintf.h t/Makefile dh_clean configure: configure-stamp configure-stamp: dh_testdir -a if test -f Makefile; then make clean; fi for f in ./config.sub ./config.guess; do [ -f "sources.orig/$${f}" ] || { mkdir -p "sources.orig/$${f%/*}" && mv "$${f}" "sources.orig/$${f}"; }; done ln -sf /usr/share/misc/config.sub . ln -sf /usr/share/misc/config.guess . rm -f config.cache CFLAGS='$(DPKG_BUILD_CFLAGS) $(DPKG_BUILD_CPPFLAGS)' LDFLAGS='$(DPKG_BUILD_LDFLAGS)' \ ./configure --prefix=/usr \ --mandir=/usr/share/man \ --bindir=/usr/sbin \ --datadir=/usr/share/nagios4/htdocs \ --sysconfdir=/etc/nagios4 \ --infodir=/usr/share/info \ --libexecdir=/usr/lib/nagios/plugins \ --localstatedir=/var/lib/nagios4 \ --enable-event-broker \ --with-cgibindir=/usr/lib/cgi-bin/nagios4 \ --with-nagios-user=nagios \ --with-nagios-group=nagios \ --with-command-user=nagios \ --with-command-group=nagios \ --with-init-dir=/etc/init.d \ --with-lockfile=/var/run/nagios4/nagios4.pid \ --with-mail=/usr/bin/mail \ --build=$(DEB_BUILD_GNU_TYPE) \ --host=$(DEB_HOST_GNU_TYPE) \ --with-htmurl=/nagios4 \ --with-cgiurl=/cgi-bin/nagios4 touch configure-stamp build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: configure-stamp dh_testdir -a $(MAKE) all make -C contrib touch build-arch-stamp install: install-stamp install-stamp: build-stamp dh_testdir -a dh_testroot -a dh_installdirs -a -i # zero out INSTALL_OPTS to prevent chowning at build-time make "DESTDIR=$(b)/tmp" COMMAND_OPTS= INSTALL_OPTS= install-unstripped # move some arch-indep stuff to the other packages mv debian/tmp/usr/sbin/nagios "$(b)/nagios4-core/usr/sbin/nagios4" mv debian/tmp/usr/sbin/nagiostats "$(b)/nagios4-core/usr/sbin/nagios4stats" dh_link -i dh_lintian dh_installdocs -i dh_installman -a -pnagios4 dh_installlogrotate dh_installchangelogs -i dh_install -i dh_installinit --name nagios4 -- defaults 30 18 dh_installexamples install -D debian/nagios4-cgi.conf -m 0644 debian/nagios4-cgi/usr/share/nagios4/apache2.conf dh_apache2 touch install-stamp binary: binary-arch binary-indep binary-arch: install-stamp dh_testdir -a dh_testroot -a dh_link -a dh_installchangelogs -a dh_installdocs -a dh_installdebconf -a dh_install -a chmod 600 ${b}/nagios4-common/etc/nagios4/resource.cfg x=$$(cd debian/$(DOC_PACKAGE) && find . -name 'jquery-*.min.js') && \ rm debian/$(DOC_PACKAGE)/$$x && \ dh_link -p$(DOC_PACKAGE) /usr/share/javascript/jquery/jquery.min.js $$x dh_strip -a dh_compress -a -X.php dh_fixperms -a dh_makeshlibs -a -V dh_installdeb -a dh_perl -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary-indep: install-stamp dh_link -i dh_compress -i dh_fixperms -i -Xnagios4/resource.cfg dh_installdebconf -i dh_perl -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i .PHONY: binary-indep binary-arch build configure binary install