#! /usr/bin/make -f

export PYBUILD_AFTER_INSTALL=rm -rf '{destdir}/{install_dir}/mintpy/sh'

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

override_dh_auto_clean:
	dh_auto_clean
	$(RM) -r *.egg-info

override_dh_auto_test:
	PYBUILD_SYSTEM=custom \
        PYBUILD_TEST_ARGS="env PYTHONPATH={build_dir} {interpreter} $(CURDIR)/tests/asc_desc2horz_vert.py" \
	dh_auto_test

override_dh_auto_build: export http_proxy=127.0.0.1:9
override_dh_auto_build: export https_proxy=127.0.0.1:9
override_dh_auto_build:
	dh_auto_build
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	mkdocs build -c -f mkdocs.yml --no-directory-urls -d .pybuild/docs/html
else
	mkdir -p .pybuild/docs/html
endif

override_dh_numpy3:
	dh_numpy3 -p python3-mintpy
