#!/usr/bin/make -f
# debhelper rules file for donkey, the One-Time-Password calculator

# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS=	hardening=+all
DEB_CFLAGS_MAINT_APPEND=	-Wall -W -Wextra -Wno-stringop-truncation

ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
config_werror=	--enable-werror
else
config_werror=
endif

include /usr/share/dpkg/default.mk

include /usr/share/debhelper/dh_package_notes/package-notes.mk

override_dh_auto_configure:
	dh_auto_configure -D src -- $(config_werror)

override_dh_auto_build:
	dh_auto_build -D src

override_dh_auto_test:
	dh_auto_test -D src -- TEST_PROCESS_DRIVER=pty

override_dh_auto_clean:
	dh_auto_clean -D src

override_dh_auto_install:
	dh_auto_install -D src --destdir '$(CURDIR)/debian/donkey' -- \
		INSTALL_PROGRAM='install -m 755' \
		INSTALL_DATA='install -m 644'

execute_after_dh_installchangelogs:
	install -m 644 00changes debian/donkey/usr/share/doc/donkey/NEWS

%:
	dh $@
