#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

CURVER=$(shell dpkg-parsechangelog | grep ^Version | cut -d\  -f2)
DEBVER=$(shell echo $(CURVER) | cut -d- -f1)
UPVER=$(shell echo $(DEBVER) | cut -d+ -f1)

%:
	dh -Spython_distutils $@

get-orig-source:
	uscan --verbose \
		--download-version $(UPVER) \
		--force-download \
		--destdir .
	tar xvf pycountry-$(UPVER).tar.gz
	rm -vrf pycountry-$(UPVER)/src/pycountry/databases
	rm -vrf pycountry-$(UPVER)/src/pycountry/locales
	tar cf pycountry_$(DEBVER).orig.tar pycountry-$(UPVER)
	gzip -9 pycountry_$(DEBVER).orig.tar
	rm -vrf pycountry-$(UPVER)/ pycountry-$(UPVER).tar.gz
