#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

%:
	dh $@

override_dh_auto_clean:
	$(MAKE) -C doc/ clean
	$(MAKE) -C tests/ clean

override_dh_auto_build:
	$(MAKE) -B -C doc/

override_dh_auto_test:
ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" ""
	adt_adequate=./adequate adt_testpkg=dpkg debian/tests/smoke-test
	$(MAKE) -C tests/ changes
endif

execute_after_dh_install:
	sed -i \
		-r -e 's/^(our \$$VERSION) =.*/\1 = "$(DEB_VERSION)";/' \
		debian/*/usr/bin/*
