#!/usr/bin/make -f

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

export PYBUILD_NAME=djangorestframework-extensions

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

override_dh_auto_build:
	dh_auto_build
	PYTHONIOENCODING=UTF-8 python3 docs/backdoc.py --source docs/index.md --title "Django Rest Framework extensions documentation" > docs/index.html

override_dh_auto_test:
	dh_auto_test -- --system=custom --test-args="PYTHONPATH='.:tests_app' {interpreter} /usr/bin/django-admin test --settings=settings tests_app"

override_dh_clean:
	rm -rf docs/.build
	dh_clean

override_dh_installchangelogs:
	awk '/^### Release notes$$/,0' < docs/index.md >CHANGELOG
	dh_installchangelogs -- CHANGELOG
