#!/usr/bin/make -f
# -*- makefile -*-

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

export PYBUILD_NAME=pyorbital
export PYBUILD_TEST_ARGS=\
-k "not TestGetObserverLook \
and not test_tle_instance_printing" \
--pyargs ${PYBUILD_NAME}

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep:
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
	PYTHONPATH=$(CURDIR) python3 -m sphinx -N -E -T -b html doc/source $(CURDIR)/.pybuild/docs/html
	rm -rf $(CURDIR)/.pybuild/docs/html/.doctrees
endif

execute_after_dh_auto_install:
	mv debian/python3-pyorbital/usr/bin/fetch_tles.py debian/python3-pyorbital/usr/bin/fetch_tles
	chmod -x debian/python3-pyorbital/usr/lib/python3*/*-packages/pyorbital/*py

override_dh_numpy3:
	dh_numpy3 -p python3-pyorbital
