#!/usr/bin/make -f
%:
	dh $@ --with python2

.PHONY: override_dh_auto_test
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	django-admin startproject testproject
	cp debian/settings.py testproject/settings.py
	set -e; \
	for python in $(shell pyversions -r); do \
	  PYTHONPATH=".:src" $$python testproject/manage.py test --settings=testproject.settings; \
	done
	rm -rf testproject
endif

.PHONY: override_dh_auto_install
override_dh_auto_install:
	dh_auto_install
	sed -i 's/Metadata-Version: 1\.0/Metadata-Version: 1\.1/' debian/python-django-floppyforms/usr/lib/python2.*/*-packages/django_floppyforms-*.egg-info/PKG-INFO
