#! /usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS := hardening=+bindnow

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --libexecdir=/usr/lib/$(DEB_HOST_MULTIARCH)/ --with-bash-completion-dir=/usr/share/bash-completion/completions/ GUILE_EFFECTIVE_VERSION=3.0

execute_before_dh_auto_build:
	rm -v doc/shepherd.info doc/herd.1 doc/shepherd.1

override_dh_auto_install:
	dh_auto_install $(DH_BUILD_OPTS) --destdir=debian/tmp

execute_after_dh_auto_install:
#	mv debian/tmp/etc/bash_completion.d debian/tmp/usr/share/bash-completion-completions
	rm -v debian/tmp/usr/sbin/halt
	rm -v debian/tmp/usr/sbin/reboot
	rm -v debian/tmp/usr/sbin/shutdown
	rm -v debian/tmp/usr/share/man/man8/halt.8
	rm -v debian/tmp/usr/share/man/man8/reboot.8
	rmdir -v debian/tmp/usr/sbin
	rmdir -v debian/tmp/usr/share/man/man8
	rmdir -v debian/tmp/var/run/shepherd debian/tmp/var/run debian/tmp/var

override_dh_auto_test:
	true

override_dh_dwz:
	dh_dwz --exclude=.go

override_dh_shlibdeps:
	dh_shlibdeps --exclude=.go
