#!/usr/bin/make -f

%:
	dh $@

# Mangling version is necessary, as upstream pretends that 2.2 < 2.29 < 2.291 < 2.3
# We put a dot between every digit of the minor number.
VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
UVER=$(shell echo '$(VER)' | sed -e 's/[.]/\#/' | tr -d '.' | tr '\#' '.')

get-orig-source:
	uscan --noconf --force-download --rename --download-version=$(VER) --destdir=.; \
	mkdir html2text-$(VER); \
	mv html2text-$(UVER).py html2text-$(VER)/html2text.py; \
	cp /usr/share/common-licenses/GPL-3 html2text-$(VER)/COPYING; \
	tar -czf python-html2text_$(VER).orig.tar.gz html2text-$(VER); \
	rm -rf html2text-$(VER)
