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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export PYBUILD_NAME=spyder
export PYBUILD_BUILD_ARGS=--no-doc
export PYBUILD_INSTALL_ARGS=--no-doc
export PYBUILD_AFTER_INSTALL=rm -rf {destdir}/usr/bin/ {destdir}/usr/share


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

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. http_proxy='localhost' sphinx-build -N -bhtml doc/ build/html  # HTML generator
	PYTHONPATH=. http_proxy='localhost' sphinx-build -N -bman doc/ build/man  # HTML generator

override_dh_auto_install:
	dh_auto_install

	# install the spyder-common files
	dh_install -p spyder-common spyder/images usr/share/spyder

	# install the spyder files
	python setup.py install_scripts -d debian/spyder/usr/bin
	python setup.py install_data -d debian/spyder/usr
	rm -f debian/spyder/usr/bin/spyder_win_post_install.py

	# install the spyder3 files
	python3 setup.py install_scripts -d debian/spyder3/usr/bin
	python3 setup.py install_data -d debian/spyder3/usr
	rm -f debian/spyder3/usr/bin/spyder_win_post_install.py

# skip tests for now
override_dh_auto_test:
