#!/usr/bin/make -f
#export DH_VERBOSE = 1

export PYBUILD_NAME=pyswarms

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

override_dh_auto_build:
	dh_auto_build
	# Needed regardless of if we build or not
	mkdir -p build/html
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -bhtml docs/ build/html
endif

override_dh_auto_install:
	# Stray file that gets generated during build and test
	rm -f report.log .pybuild/*/build/report.log docs/report.log
	dh_auto_install

override_dh_installdocs:
	dh_installdocs --package=python-pyswarms-doc --doc-main-package=python3-pyswarms
	dh_installdocs --remaining-packages

override_dh_auto_clean:
	dh_auto_clean
	rm -rf .pytest_cache build
