summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules67
1 files changed, 67 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..49b9298
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,67 @@
+#!/usr/bin/make -f
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# Ensure that we link against all needed libraries (cf. Policy 10.2)
+export DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs
+
+ifneq ($(wildcard /usr/include/statgrab.h),)
+enable-monitoring=--enable-monitoring
+endif
+
+ifneq ($(wildcard /usr/include/linux/watchdog.h),)
+enable-watchdog=--enable-watchdog
+endif
+
+ifneq ($(wildcard /usr/include/systemd/sd-daemon.h),)
+enable-systemd=--enable-systemd
+endif
+
+%:
+ dh $@
+
+# Avoid useless dependencies in the libraries
+override_dh_autoreconf:
+ dh_autoreconf --as-needed
+
+# Explicit BASHPATH fixes reproducible build on merged-usr vs non-merged:
+override_dh_auto_configure:
+ dh_auto_configure -- \
+ BASHPATH=/bin/bash \
+ --with-initconfigdir=/etc/default \
+ --with-logdir=/var/log/corosync \
+ --with-systemddir=/lib/systemd/system \
+ --enable-dbus \
+ $(enable-monitoring) \
+ $(enable-watchdog) \
+ --enable-augeas \
+ --enable-nozzle \
+ --enable-snmp \
+ --enable-xmlconf \
+ $(enable-systemd) \
+ --enable-vqsim \
+ --disable-static
+
+override_dh_auto_build-indep:
+ $(MAKE) -C man
+ $(MAKE) doxygen
+ find doc/api/html -name "*.md5" -print -delete
+
+# The check target would unnecessarily build the software
+override_dh_auto_test-indep:
+
+override_dh_auto_install-indep:
+ $(MAKE) -C man DESTDIR="$(CURDIR)/debian/tmp" install
+
+CONF=debian/tmp/etc/corosync/corosync.conf
+override_dh_auto_install-arch:
+ dh_auto_install
+# We patched the example into a working config file:
+ mv -v $(CONF).example $(CONF)
+ rm -v debian/tmp/usr/lib/*/lib*.la
+# we don't need the upstream license
+ rm debian/tmp/usr/share/doc/corosync/LICENSE
+
+execute_before_dh_gencontrol:
+ debian/check_header_deps