Code

Released changelog.
[pkg-pnp4nagios.git] / debian / rules
index 46da9ce88d2ae65b0cca8c26fcb2d3ed75669a1f..e3ea6e59bdf44968bd4987b39e769686c67a4db8 100755 (executable)
@@ -19,6 +19,9 @@ else
 CROSS= --build $(DEB_BUILD_GNU_TYPE)
 endif
 
+CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
+
 get-orig-source:
        uscan --force --verbose --rename
 
@@ -37,9 +40,13 @@ config.status: configure
                                --without-kohana \
                                --with-kohana_system=/usr/share/php/kohana2/system \
                                --with-httpd-conf=/etc/apache2/conf.d \
-                               CFLAGS="$(CFLAGS)"
+                               CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)"
+
+build: build-arch build-indep
+
+build-arch: build-stamp
 
-build: build-stamp
+build-indep: build-stamp
 
 build-stamp: $(QUILT_STAMPFN) config.status
        dh_testdir
@@ -70,6 +77,7 @@ clean: unpatch
        [ ! -f Makefile ] || $(MAKE) distclean
 
        dh_clean
+       rm -f scripts/rrd_modify.pl
        debconf-updatepo
 
 install: build
@@ -117,6 +125,9 @@ install: build
        cp -av contrib/ssi debian/tmp/usr/share/doc/pnp4nagios/examples/
        rm -fv debian/tmp/usr/share/doc/pnp4nagios/examples/ssi/*.in
 
+       # Icinga module sample configuration
+       cp debian/icinga-module.cfg debian/tmp/usr/share/doc/pnp4nagios/examples/
+
        # Remove external PHP classes/libraries: FPDF, FPDF-TPL, FPDI
        rm -r debian/tmp/usr/share/pnp4nagios/html/application/vendor/fpdf
 
@@ -137,6 +148,10 @@ install: build
 
        cp -av sample-config/httpd.conf debian/tmp/etc/pnp4nagios/apache.conf
 
+       # Remove unnecessary config files (duplicates)
+       rm -f debian/tmp/etc/pnp4nagios/config_local.php
+       rm -f debian/tmp/etc/pnp4nagios/config.php.0.6*
+
        # Add subdirs to /var/spool/pnp4nagios/ to prepare for different modes
        mkdir debian/tmp/var/spool/pnp4nagios/nagios
        mkdir debian/tmp/var/spool/pnp4nagios/npcd
@@ -147,6 +162,9 @@ install: build
        rmdir debian/tmp/usr/share/pnp4nagios/html/application/hooks/
        #rmdir debian/tmp/usr/share/pnp4nagios/html/application/libraries/
 
+       mkdir debian/tmp/etc/pnp4nagios/templates.d
+       cp debian/README.templates.d debian/tmp/etc/pnp4nagios/templates.d/README
+
        dh_install --sourcedir=debian/tmp --fail-missing
 
 # Build architecture-independent files here.
@@ -176,7 +194,8 @@ binary-arch: build install
        dh_installexamples -a
        dh_installdebconf -a
        dh_installinit -ppnp4nagios-bin --name=npcd
-       dh_installman -a man/npcd.8
+       dh_installinit -ppnp4nagios-bin --name=pnp_gearman_worker
+       dh_installman -a
        dh_link -a
        dh_strip -a
        dh_compress -a