#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

export PYBUILD_NAME=pyface
export PYBUILD_AFTER_INSTALL=cp -v {dir}/pyface/image/library/*.zip {destdir}{install_dir}/pyface/image/library
export PYBUILD_AFTER_INSTALL= \
	cp -v {dir}/pyface/image/library/*.zip {destdir}{install_dir}/pyface/image/library ; \
	find "{destdir}{install_dir}/pyface/" -name "*.py" | xargs -r chmod -c a-x


# autopkgtest: run the test suite shipped in the installed package under Xvfb;
# the default discovery in {build_dir} finds no tests.
ifdef PYBUILD_AUTOPKGTEST
export PYBUILD_TEST_CUSTOM=1
export PYBUILD_TEST_ARGS=cd {build_dir} && xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" {interpreter} -m unittest discover -v -s pyface
endif

include /usr/share/dpkg/default.mk
export DEB_VERSION_UPSTREAM:=$(DEB_VERSION_UPSTREAM)

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_test:
	xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" dh_auto_test
