#!/usr/bin/make -f
#export DH_VERBOSE=1
#export DEB_BUILD_OPTIONS=nocheck
export PYBUILD_NAME=deap
export LC_ALL=C.UTF-8
export DEB_BUILD_MAINT_OPTIONS:= hardening=+all

%:
	dh $@ --with 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
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=$(CURDIR) $(MAKE) -C doc html
endif

override_dh_auto_install:
	dh_auto_install
	rdfind -outputname /dev/null -makesymlinks true debian/deap-doc
	symlinks -r -s -c debian/deap-doc

override_dh_installdocs:
	pandoc -f markdown -t plain -o .pybuild/README README.md
	dh_installdocs -A .pybuild/README

override_dh_compress:
	dh_compress -X.py -X.json -X.csv -X.cpp # save examples

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/_build
