#!/usr/bin/make -f

export PYBUILD_NAME=rasterio
#disable tests in test_rio_overview as they only seem to work after installation
export PYBUILD_BEFORE_TEST= cp -r {dir}/tests {build_dir};rm {build_dir}/tests/test_rio_overview.py;rm {build_dir}/tests/test_rio_info.py

export PYBUILD_AFTER_TEST=rm -rf {build_dir}/tests
export PYBUILD_TEST_PYTEST=1


%:
	dh $@ --with python2 --buildsystem pybuild

override_dh_clean:
	dh_clean
	rm -f rasterio/*.c
	rm -f rasterio/_*.cpp
	rm -f VERSION.txt
	rm -f gdal-config.txt
	rm -f .coverage 

debian/rasterio.1:
	help2man rasterio -N -n "command line interface to rasterio">debian/rasterio.1

override_dh_install:
	dh_install
	rm -rf debian/python3-rasterio/usr/bin
	rm -rf debian/python-rasterio/usr/bin
