#!/usr/bin/make -f

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

export PYBUILD_NAME=django-floppyforms

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

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. sphinx-build -b html -N docs/ docs/.build/html

override_dh_auto_install:
	dh_auto_install
	set -e; \
	for ol in debian/python*-django-floppyforms/usr/lib/python*/*-packages/floppyforms/static/floppyforms; do \
		ln -s ../../../../../../share/javascript/openlayers $$ol/openlayers; \
	done

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	set -e; \
	for python in $(shell pyversions -r) $(shell py3versions -r); do \
		PYTHONPATH="." DJANGO_SETTINGS_MODULE=tests.settings $$python runtests.py; \
	done
endif

override_dh_auto_clean:
	rm -rf docs/.build
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs -- CHANGES.rst
