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

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

ifndef UPVER
UPVER := $(shell dpkg-parsechangelog | grep ^Version | cut -d\  -f2 | cut -d- -f1 | cut -d+ -f1)
endif

%:
	dh $@

get-orig-source:
	uscan \
		--verbose \
		--download-version $(UPVER) \
		--force-download \
		--rename \
		--destdir .
	tar xf node-topcube_$(UPVER).orig.tar.gz
	@echo Removing sampleapp/, since it contains minified sources for which \
		no uncompressed form is provided
	rm -vrf creationix-topcube-*/sampleapp/
	tar zcf node-topcube_$(UPVER)+ds1.orig.tar.gz creationix-topcube-*/
	rm -rf creationix-topcube-*/ node-topcube_$(UPVER).orig.tar.gz
