File: rules

package info (click to toggle)
tercpp 0.6.2+svn46-1.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 548 kB
  • ctags: 401
  • sloc: cpp: 4,279; makefile: 24; sh: 6
file content (35 lines) | stat: -rwxr-xr-x 1,176 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/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"