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

%:
	dh $@ --with python2

export OSLO_PACKAGE_VERSION=0.17.1

override_dh_auto_clean:
	dh_auto_clean
	rm -rf .testrepository

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	ostestr
endif

BRANCH = master
DATE=$(shell date +%Y%m%d%H%M)
get-orig-snapshot:
	rm -Rf pylxd-upstream
	git clone https://github.com/lxc/pylxd pylxd-upstream
	cd pylxd-upstream && \
		export COMMIT=`git rev-parse --short HEAD` && \
		export UPSTREAM_VERSION=`grep version setup.cfg | cut -d ' ' -f 3` && \
		 git archive --format tgz --prefix=python-pylxd-$$UPSTREAM_VERSION~git$(DATE)/ \
			-o ../../python-pylxd_$$UPSTREAM_VERSION~git$(DATE).$$COMMIT.orig.tar.gz $(BRANCH)
	rm -Rf pylxd-upstream
