#!/usr/bin/make -f

LAST_CHANGE = $(shell dpkg-parsechangelog -S Date)
BUILD_DATE  = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")
SPHINXOPTS := -D today=\"$(BUILD_DATE)\"

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

override_dh_auto_test:
	python-coverage run tests/runtests.py

override_dh_auto_build:
	dh_auto_build
	rm docs/_templates/layout.html
	cd docs && make html SPHINXOPTS="$(SPHINXOPTS)"

override_dh_auto_install:
	dh_auto_install
	chmod 644 debian/*/usr/lib/python*/dist-packages/wtforms/locale/*/LC_MESSAGES/wtforms.mo
