#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export RMTFS_BUILD_OPTS=prefix=/usr

%:
	dh $@

override_dh_auto_build:
	dh_auto_build -- ${RMTFS_BUILD_OPTS}

override_dh_auto_install:
	dh_auto_install -- ${RMTFS_BUILD_OPTS}

# Ensure the rmtfs service isn't stopped during upgrades, # as this can lead to
# losing network connectivity. Moreover, the rmtfs-dir must be disabled by
# default in order to prevent race conditions with the main rmtfs service
override_dh_installsystemd:
	dh_installsystemd --name rmtfs --no-stop-on-upgrade --no-restart-after-upgrade
	dh_installsystemd --name rmtfs-dir --no-start --no-enable --no-stop-on-upgrade --no-restart-after-upgrade
