| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
#export DH_VERBOSE=1 |
| 4 |
|
| 5 |
# Enable hardening build flags |
| 6 |
export DEB_BUILD_MAINT_OPTIONS=hardening=+all |
| 7 |
|
| 8 |
include /usr/share/dpkg/architecture.mk |
| 9 |
|
| 10 |
export CTEST_OUTPUT_ON_FAILURE=1 |
| 11 |
|
| 12 |
ifneq (,$(filter $(DEB_HOST_ARCH), armel powerpc)) |
| 13 |
export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed |
| 14 |
endif |
| 15 |
|
| 16 |
%: |
| 17 |
dh $@ |
| 18 |
|
| 19 |
override_dh_auto_configure: |
| 20 |
dh_auto_configure \ |
| 21 |
-- \ |
| 22 |
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \ |
| 23 |
-DCMAKE_INSTALL_SYSCONFDIR=/etc \ |
| 24 |
-DICINGA2_RUNDIR=/run \ |
| 25 |
-DICINGA2_USER=nagios \ |
| 26 |
-DICINGA2_GROUP=nagios \ |
| 27 |
-DICINGA2_COMMAND_GROUP=www-data \ |
| 28 |
-DICINGA2_GIT_VERSION_INFO=false \ |
| 29 |
-DICINGA2_PLUGINDIR=/usr/lib/nagios/plugins \ |
| 30 |
-DUSE_SYSTEMD=ON |
| 31 |
|
| 32 |
override_dh_auto_test: |
| 33 |
ifneq (,$(filter $(DEB_BUILD_ARCH),i386 loong64 ppc64el)) |
| 34 |
dh_auto_test || echo "Ignoring test failures" |
| 35 |
else |
| 36 |
dh_auto_test |
| 37 |
endif |
| 38 |
|
| 39 |
execute_after_dh_auto_install: |
| 40 |
# remove features-enabled - these will be activated by postinst later |
| 41 |
$(RM) -r debian/tmp/etc/icinga2/features-enabled/* |
| 42 |
|
| 43 |
execute_after_dh_install-arch: |
| 44 |
$(RM) debian/libicinga2/usr/lib/*/icinga2/libdb_ido_* |
| 45 |
|
| 46 |
for dbms in mysql pgsql; do \ |
| 47 |
mkdir -p debian/icinga2-ido-$$dbms/usr/share/dbconfig-common/data/icinga2-ido-$$dbms/install ; \ |
| 48 |
mkdir -p debian/icinga2-ido-$$dbms/usr/share/dbconfig-common/data/icinga2-ido-$$dbms/upgrade/$$dbms; \ |
| 49 |
cp lib/db_ido_$$dbms/schema/$$dbms.sql debian/icinga2-ido-$$dbms/usr/share/dbconfig-common/data/icinga2-ido-$$dbms/install/$$dbms ; \ |
| 50 |
for file in lib/db_ido_$$dbms/schema/upgrade/* ; do \ |
| 51 |
cp $$file debian/icinga2-ido-$$dbms/usr/share/dbconfig-common/data/icinga2-ido-$$dbms/upgrade/$$dbms/`basename $$file .sql`; \ |
| 52 |
done; \ |
| 53 |
done |
| 54 |
|
| 55 |
execute_after_dh_install-indep: |
| 56 |
chmod +x debian/icinga2-common/usr/lib/icinga2/prepare-dirs |
| 57 |
|
| 58 |
$(RM) debian/icinga2-common/etc/icinga2/features-available/ido-* |
| 59 |
|
| 60 |
override_dh_installinit: |
| 61 |
dh_installinit --name=icinga2 |
| 62 |
|
| 63 |
override_dh_installsystemd: |
| 64 |
dh_installsystemd --name=icinga2 |
| 65 |
|
| 66 |
override_dh_vim-addon: |
| 67 |
dh_vim-addon -p vim-icinga2 |
| 68 |
|
| 69 |
execute_after_dh_compress: |
| 70 |
dh_compress -p icinga2-doc usr/share/doc/icinga2/markdown/01-about.md |
| 71 |
|
| 72 |
execute_before_dh_missing: |
| 73 |
# Explicitly remove files not included in any package |
| 74 |
$(RM) debian/tmp/etc/bash_completion.d/icinga2 |
| 75 |
$(RM) debian/tmp/etc/init.d/icinga2 |
| 76 |
$(RM) debian/tmp/usr/lib/*/icinga2/lib*.so |
| 77 |
$(RM) debian/tmp/usr/lib/systemd/system/icinga2.service |
| 78 |
$(RM) debian/tmp/usr/share/doc/icinga2/AUTHORS |
| 79 |
$(RM) debian/tmp/usr/share/doc/icinga2/CHANGELOG.md |
| 80 |
$(RM) debian/tmp/usr/share/doc/icinga2/LICENSE.md |
| 81 |
$(RM) debian/tmp/usr/share/doc/icinga2/NEWS |
| 82 |
$(RM) debian/tmp/usr/share/doc/icinga2/README.md |
| 83 |
|
| 84 |
# we don't build shared libraries |
| 85 |
override_dh_makeshlibs: |
| 86 |
dh_makeshlibs --no-scripts |
| 87 |
|
| 88 |
# vi: noexpandtab ts=4 sw=4 : |