158 lines
4.7 KiB
Plaintext
158 lines
4.7 KiB
Plaintext
|
#!/usr/bin/make -f
|
||
|
# debian/rules makefile for nagios3
|
||
|
# Last modified:
|
||
|
# $Id$
|
||
|
|
||
|
# export DH_VERBOSE=1
|
||
|
export DEB_BUILD_HARDENING=1
|
||
|
|
||
|
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 \
|
||
|
--sbindir=/usr/lib/cgi-bin/nagios3 \
|
||
|
--datadir=/usr/share/nagios3/htdocs \
|
||
|
--sysconfdir=/etc/nagios3 \
|
||
|
--infodir=/usr/share/info \
|
||
|
--libexecdir=/usr/lib/nagios/plugins \
|
||
|
--localstatedir=/var/lib/nagios3 \
|
||
|
--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 \
|
||
|
--with-lockfile=/var/run/nagios3/nagios3.pid \
|
||
|
--with-mail=/usr/bin/mail \
|
||
|
--with-perlcache \
|
||
|
--build=$(DEB_BUILD_GNU_TYPE) \
|
||
|
--host=$(DEB_HOST_GNU_TYPE) \
|
||
|
--with-htmurl=/nagios3 \
|
||
|
--with-cgiurl=/cgi-bin/nagios3
|
||
|
|
||
|
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
|
||
|
|
||
|
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
|
||
|
chgrp www-data ${b}/nagios3-common/var/cache/nagios3
|
||
|
chmod g+s ${b}/nagios3-common/var/cache/nagios3
|
||
|
chown root:www-data ${b}/nagios3-common/var/lib/nagios3/rw
|
||
|
chmod 700 ${b}/nagios3-common/var/lib/nagios3/rw
|
||
|
mv debian/tmp/usr/sbin/nagios ${b}/nagios3-core/usr/sbin/nagios3
|
||
|
mv debian/tmp/usr/sbin/nagiostats ${b}/nagios3-core/usr/sbin/nagios3stats
|
||
|
dh_link -i
|
||
|
dh_lintian
|
||
|
dh_installdocs -i
|
||
|
dh_installman -a -pnagios3
|
||
|
dh_installlogrotate
|
||
|
dh_installchangelogs -i
|
||
|
dh_install -i
|
||
|
dh_installinit --name nagios3 -- defaults 30 18
|
||
|
dh_installexamples
|
||
|
chmod 755 ${b}/nagios3-common/var/lib/nagios3
|
||
|
rm ${b}/nagios3-common/etc/nagios3/cgi.cfg
|
||
|
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
|
||
|
chmod 600 ${b}/nagios3-common/etc/nagios3/resource.cfg
|
||
|
# fix permissions of p1
|
||
|
chmod 755 ${b}/nagios3-core/usr/lib/nagios3/p1.pl
|
||
|
mkdir -p ${b}/nagios3-dbg/usr/bin/
|
||
|
mv contrib/mini_epn ${b}/nagios3-dbg/usr/bin/mini_epn_nagios3
|
||
|
dh_strip -a --dbg-package=nagios3-dbg
|
||
|
dh_compress -a -X.php
|
||
|
dh_fixperms -a -X/var/cache/nagios3
|
||
|
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 -Xnagios3/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
|