#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ PKD = $(abspath $(dir $(MAKEFILE_LIST))) PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source)) VER = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};') SVN_ADDR = https://svn.code.sf.net/p/tercpp/code/trunk/tercpp.0.6 SVN_REV := $(shell echo $(VER) | awk -F"+" '{ print $$2 }' | sed 's/svn//' ) TARBALL = $(PKG)_$(VER).orig.tar.xz .PHONY: get-orig-source get-orig-source: rm -rf $(CURDIR)/get-orig-source $(TARBALL) mkdir $(CURDIR)/get-orig-source svn export -r $(SVN_REV) $(SVN_ADDR) $(CURDIR)/get-orig-source/$(PKG)-$(VER).orig # remove unneeded files cd $(CURDIR)/get-orig-source/$(PKG)-$(VER).orig && $(RM) -r \ src/tinyxmlparser.cpp \ src/tinyxmlerror.cpp \ src/tinyxml.cpp \ src/tinyxml.h \ src/tinystr.cpp \ src/tinystr.h \ doc/art-servan-schwenk.pdf tar cjf $(TARBALL) -C $(CURDIR)/get-orig-source $(PKG)-$(VER).orig rm -rf $(CURDIR)/get-orig-source echo " "$(TARBALL)" created; move it to the right destination to build the package"