2014-10-05 11:53:19 +02:00
|
|
|
#!/usr/bin/make -f
|
2017-05-20 00:00:42 +02:00
|
|
|
# debian/rules makefile for nagios4
|
2014-10-05 11:53:19 +02:00
|
|
|
# Last modified:
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
# export DH_VERBOSE=1
|
2017-05-20 07:05:24 +02:00
|
|
|
#export DEB_BUILD_HARDENING=1
|
2014-10-05 11:53:19 +02:00
|
|
|
|
|
|
|
b := $(shell pwd)/debian
|
|
|
|
|
|
|
|
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
|
|
|
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
|
|
|
|
|
|
|
# -Wall disabled until source is fixed to not print tons of warnings with it. :)
|
|
|
|
#CFLAGS = -Wall -g
|
|
|
|
CFLAGS = -g
|
|
|
|
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
|
|
|
CFLAGS += -O0
|
|
|
|
else
|
|
|
|
CFLAGS += -O2
|
|
|
|
endif
|
|
|
|
|
|
|
|
SHELL = /bin/sh -e
|
|
|
|
CONFIGURE = CFLAGS='$(CFLAGS)' ./configure --prefix=/usr \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--bindir=/usr/sbin \
|
2017-05-20 00:00:42 +02:00
|
|
|
--sbindir=/usr/lib/cgi-bin/nagios4 \
|
2019-08-06 17:16:07 +02:00
|
|
|
--with-cgibindir=/usr/lib/cgi-bin/nagios4 \
|
2017-05-20 00:00:42 +02:00
|
|
|
--datadir=/usr/share/nagios4/htdocs \
|
|
|
|
--sysconfdir=/etc/nagios4 \
|
2014-10-05 11:53:19 +02:00
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--libexecdir=/usr/lib/nagios/plugins \
|
2017-05-20 00:00:42 +02:00
|
|
|
--localstatedir=/var/lib/nagios4 \
|
2014-10-05 11:53:19 +02:00
|
|
|
--enable-event-broker \
|
|
|
|
--enable-embedded-perl \
|
|
|
|
--with-nagios-user=nagios \
|
|
|
|
--with-nagios-group=nagios \
|
|
|
|
--with-command-user=nagios \
|
|
|
|
--with-command-group=nagios \
|
|
|
|
--with-init-dir=/etc/init.d \
|
2017-05-20 00:00:42 +02:00
|
|
|
--with-lockfile=/var/run/nagios4/nagios4.pid \
|
2014-10-05 11:53:19 +02:00
|
|
|
--with-mail=/usr/bin/mail \
|
|
|
|
--with-perlcache \
|
|
|
|
--build=$(DEB_BUILD_GNU_TYPE) \
|
|
|
|
--host=$(DEB_HOST_GNU_TYPE) \
|
2017-05-20 00:00:42 +02:00
|
|
|
--with-htmurl=/nagios4 \
|
|
|
|
--with-cgiurl=/cgi-bin/nagios4
|
2014-10-05 11:53:19 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
dh_testdir -a
|
|
|
|
dh_testroot -a
|
|
|
|
if test -f Makefile; then make distclean; fi
|
|
|
|
rm -f install-stamp configure-stamp build-stamp fix-configs-stamp
|
|
|
|
rm -rf debian-configs
|
|
|
|
-rm contrib/perlxsi.c
|
|
|
|
find -type d -name autom4te.cache -print0 | xargs -0 -r rm -rf \;
|
|
|
|
-rm -f platform.h auto-include.h
|
|
|
|
find -type d -name build -print0 | xargs -0 -r rm -rf \;
|
|
|
|
dh_clean
|
|
|
|
|
|
|
|
fix-configs: fix-configs-stamp
|
|
|
|
fix-configs-stamp: configure-stamp
|
|
|
|
mkdir -p debian-configs
|
|
|
|
sed -e '/Sample CGI/ s/\([0-9]\.[0-9]\.[0-9]\)//' \
|
|
|
|
-e '/Last Modified/,+1 d' \
|
|
|
|
sample-config/cgi.cfg > debian-configs/cgi.cfg
|
|
|
|
sed -e '/Sample Main Config/ s/\([0-9]\.[0-9]\.[0-9]\)//' \
|
|
|
|
-e '/Last Modified/ d' \
|
|
|
|
sample-config/nagios.cfg > debian-configs/nagios.cfg
|
|
|
|
sed -e '/SAMPLE COMMAND DEFINITIONS/ s/\([0-9]\.[0-9]\.[0-9]\)//' \
|
|
|
|
-e '/Last Modified/,+1 d' \
|
|
|
|
-e '/^#$$/ d' sample-config/template-object/commands.cfg > debian-configs/commands.cfg
|
|
|
|
|
|
|
|
configure: configure-stamp
|
|
|
|
configure-stamp:
|
|
|
|
dh_testdir -a
|
|
|
|
@echo "Doing $@"
|
|
|
|
if test -f Makefile; then make clean; fi
|
|
|
|
ln -sf /usr/share/misc/config.sub .
|
|
|
|
ln -sf /usr/share/misc/config.guess .
|
|
|
|
rm -f config.cache
|
|
|
|
$(CONFIGURE)
|
|
|
|
touch configure-stamp
|
|
|
|
|
2017-05-20 08:43:30 +02:00
|
|
|
build-arch: build-stamp
|
|
|
|
build-indep: build-stamp
|
|
|
|
|
2014-10-05 11:53:19 +02:00
|
|
|
build: build-stamp
|
|
|
|
build-stamp: configure-stamp
|
|
|
|
dh_testdir -a
|
|
|
|
@echo "Doing $@"
|
|
|
|
$(MAKE) all
|
|
|
|
make -C contrib
|
|
|
|
touch build-stamp
|
|
|
|
|
|
|
|
install: install-stamp
|
|
|
|
install-stamp: build-stamp fix-configs-stamp
|
|
|
|
@echo "Doing $@"
|
|
|
|
dh_testdir -a
|
|
|
|
dh_testroot -a
|
|
|
|
dh_installdirs -a -i
|
|
|
|
# zero out INSTALL_OPTS to prevent chowning at build-time
|
|
|
|
make install-unstripped DESTDIR=$b/tmp INSTALL_OPTS=""
|
|
|
|
# move some arch-indep stuff to the other packages
|
2017-05-20 00:00:42 +02:00
|
|
|
chgrp www-data ${b}/nagios4-common/var/cache/nagios4
|
|
|
|
chmod g+s ${b}/nagios4-common/var/cache/nagios4
|
|
|
|
chown root:www-data ${b}/nagios4-common/var/lib/nagios4/rw
|
|
|
|
chmod 700 ${b}/nagios4-common/var/lib/nagios4/rw
|
|
|
|
mv debian/tmp/usr/sbin/nagios ${b}/nagios4-core/usr/sbin/nagios4
|
|
|
|
mv debian/tmp/usr/sbin/nagiostats ${b}/nagios4-core/usr/sbin/nagios4stats
|
2014-10-05 11:53:19 +02:00
|
|
|
dh_link -i
|
|
|
|
dh_lintian
|
|
|
|
dh_installdocs -i
|
2017-05-20 00:00:42 +02:00
|
|
|
dh_installman -a -pnagios4
|
2014-10-05 11:53:19 +02:00
|
|
|
dh_installlogrotate
|
|
|
|
dh_installchangelogs -i
|
|
|
|
dh_install -i
|
2017-05-20 00:00:42 +02:00
|
|
|
dh_installinit --name nagios4 -- defaults 30 18
|
2014-10-05 11:53:19 +02:00
|
|
|
dh_installexamples
|
2017-05-20 00:00:42 +02:00
|
|
|
chmod 755 ${b}/nagios4-common/var/lib/nagios4
|
|
|
|
rm ${b}/nagios4-common/etc/nagios4/cgi.cfg
|
2014-10-05 11:53:19 +02:00
|
|
|
touch install-stamp
|
|
|
|
|
|
|
|
binary: binary-arch binary-indep
|
|
|
|
binary-arch: install-stamp
|
|
|
|
@echo "Doing $@"
|
|
|
|
dh_testdir -a
|
|
|
|
dh_testroot -a
|
|
|
|
dh_link -a
|
|
|
|
dh_installchangelogs -a
|
|
|
|
dh_installdocs -a
|
|
|
|
dh_installdebconf -a
|
|
|
|
dh_install -a
|
2017-05-20 00:00:42 +02:00
|
|
|
chmod 600 ${b}/nagios4-common/etc/nagios4/resource.cfg
|
2014-10-05 11:53:19 +02:00
|
|
|
# fix permissions of p1
|
2017-05-20 00:00:42 +02:00
|
|
|
#chmod 755 ${b}/nagios4-core/usr/lib/nagios4/p1.pl
|
|
|
|
mkdir -p ${b}/nagios4-dbg/usr/bin/
|
|
|
|
#mv contrib/mini_epn ${b}/nagios4-dbg/usr/bin/mini_epn_nagios4
|
|
|
|
dh_strip -a --dbg-package=nagios4-dbg
|
2014-10-05 11:53:19 +02:00
|
|
|
dh_compress -a -X.php
|
2017-05-20 00:00:42 +02:00
|
|
|
dh_fixperms -a -X/var/cache/nagios4
|
2014-10-05 11:53:19 +02:00
|
|
|
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
|
2017-05-20 00:00:42 +02:00
|
|
|
dh_fixperms -i -Xnagios4/resource.cfg
|
2014-10-05 11:53:19 +02:00
|
|
|
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
|