#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export PYBUILD_NAME=psd-tools

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

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(CURDIR)/src/psd_tools.egg-info

override_dh_auto_build:
	dh_auto_build
	export http_proxy=127.0.0.1:9
	export https_proxy=127.0.0.1:9
	PYTHONPATH=./src python3 -m sphinx -N -bman \
		docs/ build/man # Manpage generator
	cp -f build/man/src.1 build/man/psd-tools.1

# If you need to rebuild the Sphinx documentation:
# Add sphinxdoc to the dh --with line.
#
# And uncomment the following lines.
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:
	PYTHONPATH=./src python3 -m sphinx -N -bhtml \
		docs/ build/html # HTML generator
	#PYTHONPATH=. python3 -m sphinx -N -bman \
	#docs/ build/man # Manpage generator
	#cp -f build/man/src.1 build/man/psd-tools.1

override_dh_auto_test:
	# No auto test because we remove test data due to copyright.
	# Instead we have wrote some autopkgtest to do some working tests.
	#dh_auto_test -- --test-args="-p test_b*.py"
