#!/usr/bin/make -f

%:
	dh $@

#override_dh_installman:
#	dh_installman debian/checkgmail.1

#--- To get a new SVN snapshot from upstream repo

PACKAGE = checkgmail
SRC_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/^Version: \(.*\)-.*/\1/')
SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz

.PHONY: get-orig-source
get-orig-source:
	rm -rf get-orig-source $(TARBALL)
	mkdir get-orig-source
	svn export -r $(SVN_REVISION) https://checkgmail.svn.sourceforge.net/svnroot/checkgmail get-orig-source/$(PACKAGE)-$(SRC_VERSION)
	tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION)
	rm -rf get-orig-source
	echo "  "$(TARBALL)" created; move it to the right destination to build the package"
