#!/usr/bin/make -f

# gbp import-orig --pristine-tar --uscan

export DH_VERBOSE=1
DEB_BUILD_HARDENING=1

%:
	dh $@

override_dh_auto_configure:
	./configure \
--prefix=/usr \
--unitdir=/lib/systemd/system \
--confdir=/etc \
--statedir=/var/spool/cron/crontabs \
--bindir=/usr/bin \
--libdir=/lib \
--enable-runparts=no \
--enable-boot=no \
--enable-setgid=yes \
--enable-yearly=yes \
--enable-persistent=yes

override_dh_auto_build:
	dh_auto_build --buildsystem=makefile

override_dh_installsystemd:
	# Only enable+start cron.target, it pulls in all the others via .timer files.
	dh_installsystemd cron.target

override_dh_clean:
	rm -f Makefile
	dh_clean

override_dh_auto_test:
	# tests disabled for now to avoid this bug on pbuilder:
	# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555331#40
	# they duplicate lintian check "manpage-has-errors-from-man" anyway

execute_after_dh_auto_install:
	# we rely on debhelper magic
	rm -rvf debian/systemd-cron/lib/sysusers.d/
	dh_installsysusers
