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

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

# This has to be exported to make some magic below work.
export DH_OPTIONS


%:
	dh  $@

# Override needed for docs and egg-info
override_dh_auto_clean:
	dh_auto_clean
	rm -rf Pyevolve.egg-info
	rm -rf docs/html

# Override needed for building documentation; jquery link
override_dh_auto_build:
	dh_auto_build
	cd docs && sphinx-build -E -a -b html ./source ./html
	rm -rf docs/html/.buildinfo
	rm -rf docs/html/.doctrees
	rm -rf docs/html/_sources
	rm -f docs/html/objects.inv
	rm -f docs/html/_static/jquery.js

# Override needed for multiple binary package;
# script must be renamed, line endings converted to Unix
override_dh_auto_install:
	dh_auto_install --destdir=debian/python-pyevolve
	tr -d '\r' < debian/python-pyevolve/usr/bin/pyevolve_graph.py \
	           > debian/python-pyevolve/usr/bin/pyevolve-graph
	rm -f debian/python-pyevolve/usr/bin/pyevolve_graph.py

# Override needed for README
override_dh_installexamples:
	dh_installexamples
	cp debian/README.examples \
		debian/python-pyevolve-doc/usr/share/doc/python-pyevolve-doc/

# Don't compress sphinx's javascript and Python example files
override_dh_compress:
	dh_compress -X.js -X.py


.PHONY: get-orig-source
get-orig-source:
	uscan --no-symlink --download-current-version
