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

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

CURVER := $(shell parsechangelog | grep Version | cut -d\  -f2  | cut -d- -f1)
UPSVER := $(CURVER:+dfsg.1=)

override_dh_auto_install:
	dh_auto_install
	mv $(CURDIR)/debian/colorname/usr/bin/colorname.py $(CURDIR)/debian/colorname/usr/bin/colorname
	rm -rf $(CURDIR)/debian/colorname/usr/lib/

%:
	dh $@ \
		--with python2

get-orig-source:
	rm -rf $(CURDIR)/colorname-$(UPSVER)*
	uscan --verbose --force-download --destdir $(CURDIR) --no-symlink
	tar zxvf $(CURDIR)/colorname-$(UPSVER).tar.gz
	rm -rf $(CURDIR)/colorname-$(UPSVER)/colorname-colors/colorname-svg.txt
	tar cf $(CURDIR)/colorname_$(CURVER).orig.tar colorname-$(UPSVER)/
	gzip -9 $(CURDIR)/colorname_$(CURVER).orig.tar
	rm -rf $(CURDIR)/colorname-$(UPSVER)*
