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

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

export PYBUILD_NAME=spyder
export PYBUILD_DESTDIR_python2=debian/python-$(PYBUILD_NAME)
export PYBUILD_DESTDIR_python3=debian/python3-$(PYBUILD_NAME)
export PYBUILD_BUILD_ARGS=--no-doc
export PYBUILD_INSTALL_ARGS=--no-doc --install-data=usr
export PYBUILD_AFTER_INSTALL={interpreter} setup.py install_scripts --skip-build --install-dir={destdir}/usr/bin \
	; rm -f {destdir}/usr/bin/spyder_win_post_install.py

%:
	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
	cp -f build/man/spyder.1 build/man/spyder3.1

override_dh_auto_install:
	dh_auto_install
	dh_movefiles --package=spyder --sourcedir=$(PYBUILD_DESTDIR_python2) usr/bin usr/share
	find $(PYBUILD_DESTDIR_python2) -type d -empty -delete
	dh_movefiles --package=spyder3 --sourcedir=$(PYBUILD_DESTDIR_python3) usr/bin usr/share
	find $(PYBUILD_DESTDIR_python3) -type d -empty -delete

# skip tests for now
override_dh_auto_test:
