| #!/usr/bin/make -f | |
| # -*- makefile -*- | |
| # Uncomment this to turn on verbose mode. | |
| # export DH_VERBOSE=1 | |
| PKG_VERSION=$(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }') | |
| WITH_SYSTEMD=$(shell dh --list 2>/dev/null | sed -ne 's/^systemd$$/--with systemd/p') | |
| %: | |
| dh $@ --parallel --with bash-completion $(WITH_SYSTEMD) | |
| override_dh_auto_clean: | |
| dh_auto_clean | |
| rm -f debian/drbd-utils.drbd.init | |
| configure_with = --prefix=/usr --localstatedir=/var --sysconfdir=/etc \ | |
| --sbindir=/usr/sbin --with-udev --with-xen \ | |
| --with-pacemaker --with-rgmanager --without-bashcompletion | |
| ifneq ($(WITH_SYSTEMD),) | |
| configure_with += --with-systemdunitdir=/lib/systemd/system \ | |
| --with-initscripttype=both | |
| # alternatively: --with-initscripttype=systemd, | |
| # if you want to drop the sysv script from the package. | |
| # Need to adjust below, in that case. | |
| endif | |
| override_dh_auto_configure: | |
| ./configure $(configure_with) | |
| override_dh_auto_install: | |
| dh_auto_install --destdir debian/drbd-utils | |
| override_dh_install: | |
| dh_install --fail-missing | |
| # Place the initscript where dh_installinit can find it | |
| # (yes, it may be missing; yes, modern debhelper would find it anyways) | |
| -mv $(CURDIR)/debian/drbd-utils/etc/init.d/drbd $(CURDIR)/debian/drbd-utils.drbd.init | |
| ifneq ($(WITH_SYSTEMD),) | |
| # Place the systemd service script ... | |
| mv $(CURDIR)/debian/drbd-utils/lib/systemd/system/drbd.service $(CURDIR)/debian/ || : | |
| endif | |
| # do not stop/restart/start, no reason to reconfigure the kernel | |
| # just because we install/upgrade some tools | |
| override_dh_installinit: | |
| dh_installinit -p drbd-utils --name=drbd \ | |
| --no-restart-on-upgrade --no-start | |
| override_dh_gencontrol: | |
| dh_gencontrol -Ndrbd8-utils | |
| # Add the previous epoch to drbd8-utils | |
| dh_gencontrol -pdrbd8-utils -- -v2:$(PKG_VERSION) | |
| .PHONY: override_dh_auto_configure override_dh_install \ | |
| override_dh_auto_clean override_dh_installinit \ | |
| override_dh_gencontrol override_dh_auto_install |