summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules107
1 files changed, 107 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..a52a8e4
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,107 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE=1
+
+# Enable hardening build flags
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+
+include /usr/share/dpkg/architecture.mk
+
+export CTEST_OUTPUT_ON_FAILURE=1
+
+ifneq (,$(filter $(DEB_HOST_ARCH), armel mips mipsel powerpc))
+ export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
+endif
+
+%:
+ dh $@
+
+override_dh_auto_clean:
+ dh_auto_clean
+
+ test ! -f third-party/cmake/GNUInstallDirs.cmake.disabled || \
+ mv third-party/cmake/GNUInstallDirs.cmake.disabled third-party/cmake/GNUInstallDirs.cmake
+
+override_dh_auto_configure:
+ test -f third-party/cmake/GNUInstallDirs.cmake.disabled || \
+ mv third-party/cmake/GNUInstallDirs.cmake third-party/cmake/GNUInstallDirs.cmake.disabled
+
+ dh_auto_configure \
+ -- \
+ -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
+ -DCMAKE_INSTALL_SYSCONFDIR=/etc \
+ -DICINGA2_RUNDIR=/run \
+ -DICINGA2_USER=nagios \
+ -DICINGA2_GROUP=nagios \
+ -DICINGA2_COMMAND_GROUP=www-data \
+ -DICINGA2_GIT_VERSION_INFO=false \
+ -DICINGA2_PLUGINDIR=/usr/lib/nagios/plugins \
+ -DUSE_SYSTEMD=ON
+
+override_dh_auto_test:
+ifneq (,$(filter $(DEB_BUILD_ARCH),i386 mips64el ppc64el powerpc))
+ dh_auto_test || echo "Ignoring test failures"
+else
+ dh_auto_test
+endif
+
+override_dh_auto_install:
+ dh_auto_install
+
+ # remove features-enabled - these will be activated by postinst later
+ $(RM) -r debian/tmp/etc/icinga2/features-enabled/*
+
+override_dh_install-arch:
+ dh_install -a
+
+ $(RM) debian/libicinga2/usr/lib/*/icinga2/libdb_ido_*
+
+ for dbms in mysql pgsql; do \
+ mkdir -p debian/icinga2-ido-$$dbms/usr/share/dbconfig-common/data/icinga2-ido-$$dbms/install ; \
+ mkdir -p debian/icinga2-ido-$$dbms/usr/share/dbconfig-common/data/icinga2-ido-$$dbms/upgrade/$$dbms; \
+ cp lib/db_ido_$$dbms/schema/$$dbms.sql debian/icinga2-ido-$$dbms/usr/share/dbconfig-common/data/icinga2-ido-$$dbms/install/$$dbms ; \
+ for file in lib/db_ido_$$dbms/schema/upgrade/* ; do \
+ cp $$file debian/icinga2-ido-$$dbms/usr/share/dbconfig-common/data/icinga2-ido-$$dbms/upgrade/$$dbms/`basename $$file .sql`; \
+ done; \
+ done
+
+override_dh_install-indep:
+ dh_install -i
+
+ chmod +x debian/icinga2-common/usr/lib/icinga2/prepare-dirs
+
+ $(RM) debian/icinga2-common/etc/icinga2/features-available/ido-*
+
+override_dh_installinit:
+ dh_installinit --name=icinga2
+
+override_dh_installsystemd:
+ dh_installsystemd --name=icinga2
+
+override_dh_vim-addon:
+ dh_vim-addon -p vim-icinga2
+
+override_dh_compress:
+ dh_compress
+ dh_compress -p icinga2-doc usr/share/doc/icinga2/markdown/01-about.md
+
+override_dh_missing:
+ # Explicitly remove files not included in any package
+ $(RM) debian/tmp/etc/bash_completion.d/icinga2
+ $(RM) debian/tmp/etc/init.d/icinga2
+ $(RM) debian/tmp/usr/lib/*/icinga2/lib*.so
+ $(RM) debian/tmp/usr/lib/systemd/system/icinga2.service
+ $(RM) debian/tmp/usr/share/doc/icinga2/AUTHORS
+ $(RM) debian/tmp/usr/share/doc/icinga2/CHANGELOG.md
+ $(RM) debian/tmp/usr/share/doc/icinga2/COPYING
+ $(RM) debian/tmp/usr/share/doc/icinga2/COPYING.Exceptions
+ $(RM) debian/tmp/usr/share/doc/icinga2/NEWS
+ $(RM) debian/tmp/usr/share/doc/icinga2/README.md
+
+ dh_missing --list-missing
+
+# we don't build shared libraries
+override_dh_makeshlibs:
+ dh_makeshlibs --no-scripts
+
+# vi: noexpandtab ts=4 sw=4 :