+PACKAGE = smartmontools
+SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p'| cut -d':' -f2)
+SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
+TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
+
+get-orig-source:
+ rm -rf get-orig-source $(TARBALL)
+ mkdir get-orig-source
+ svn export -r $(SVN_REVISION) https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools/ \
+ get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
+ 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"