#!/usr/bin/make -f

%:
	dh $@ --buildsystem=python_distutils --with=python2

check:
	# Sanity-check before upload.
	find -name debian -prune -o -name \*.py -print | xargs pycompile
	find -type f \( -name \*.pyc -o -name \*.pyo \) -print0 | xargs -0r rm -f
	# Check the syntax of any shell scripts.
	set -e; for x in $$(find -type f -print0 | xargs -0 file -i | grep "text/x-shellscript" | cut -d':' -f1); do \
			sh -n $$x; \
	done
	# Check the syntax of any Python scripts.
	./tests/run-pyflakes


override_dh_clean: check
	dh_clean
	cd $(CURDIR)/po; make clean
