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

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

export PYBUILD_NAME=drizzle
export SETUPTOOLS_SCM_PRETEND_VERSION=${DEB_VERSION_UPSTREAM}
export DRIZZLE_TEST_DIR=$(shell pwd)/drizzle/tests/data

%:
	dh $@ --with=python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	echo ${SETUPTOOLS_SCM_PRETEND_VERSION}
	python3 setup.py build_ext -i
	python3 -m sphinx docs build/sphinx/html

override_dh_install-arch:
	dh_install
	rm -rf debian/python*-drizzle/usr/bin/ \
	       debian/python*-drizzle/usr/lib/python*/*/drizzle/tests/data

override_dh_fixperms-indep:
	dh_fixperms
	chmod a-x debian/python-drizzle-*/usr/share/python-drizzle/test_data/j8bt06nyq_flt.fits

override_dh_python3-arch:
	dh_python3
	dh_numpy3
