#!/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: 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
	PYTHONPATH=. sphinx-build -N -b html doc build/html
	PYTHONPATH=. sphinx-build -N -b man doc build/man

override_dh_auto_install:
	dh_auto_install

	# install the spyder-common files
	dh_install -p spyder-common spyder/images usr/share/spyder
	dh_install -p spyder-common spyder/locale 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:
