#!/usr/bin/make -f
#DH_VERBOSE = 1

%:
	dh $@ --with python2

PACKAGE=nova-compute-lxd
SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
 TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
get-orig-source:
	rm -rf get-orig-source $(TARBALL)
	mkdir get-orig-source
	git clone git://github.com/lxc/$(PACKAGE).git get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
	cd get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig 
	rm -rf get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig/.git
	GZIP=--best tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION).orig
	rm -rf get-orig-source
	echo " "$(TARBALL)" created; move it to the right destination to build the package"
