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

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

export PSP_CONFIG_FILE=debian/pyspectral_testcfg.yaml

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

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

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)))
	PYTHONPATH=. python3 -m sphinx -N -bhtml doc build/html # HTML generator
	# PYTHONPATH=. python3 -m sphinx -N -bman doc build/man # Manpage generator
endif

override_dh_auto_install:
	dh_auto_install

	for f in debian/tmp/usr/bin/*.py; do \
		mv $$f $$(dirname $$f)/$$(basename $$f .py);\
	done
