#!/usr/bin/make -f
#export DH_VERBOSE = 1

export PREFIX=/usr
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean --sourcedirectory=extras/kdf-keys

override_dh_auto_build:
	dh_auto_build --sourcedirectory=extras/kdf-keys

override_dh_auto_install:
	dh_auto_install
	dh_auto_install --sourcedirectory=extras/kdf-keys
	dh_auto_install --sourcedirectory=extras/cloak

# Would need network connection
override_dh_auto_test:

# If 'nodoc' is absent from DEB_BUILD_OPTIONS, create an examples directory
# holding cipher files for possible use with the cloak/uncloak commands.
# We would prefer to do this via dh-exec if it would support dh_installdocs.
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
execute_after_dh_installdocs:
	install \
		-Dt debian/tomb/usr/share/doc/tomb/examples/cloak-ciphers \
		-m 644 extras/cloak/ciphers/*
endif
