#!/usr/bin/make -f

#export DH_VERBOSE = 1
#export PYBUILD_VERBOSE = 1
export PYBUILD_NAME = pyparsing

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


override_dh_installexamples:
	dh_installexamples -i -ppython-pyparsing-doc


override_dh_compress:
	dh_compress -i -X.py


# the following rule gets the original source and creates a dfsg free
# tarball
get-orig-source:
	DFSGVER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p'); \
	VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^+]+).*,\1,p'); \
	TMPDIR=`mktemp --directory`; \
	uscan --force-download --download-version=$$VER --destdir="$$TMPDIR"; \
	cd "$(CURDIR)"; mv "$$TMPDIR/pyparsing_$$DFSGVER.orig.tar.gz" .; \
	rm -rf "$$TMPDIR"

.PHONY: get-orig-source
