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
|
#!/usr/bin/make -f
VERBOSE=1
include /usr/share/cdbs/1/rules/debhelper.mk
PKD = $(word 1,$(abspath $(dir $(MAKEFILE_LIST))))
PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
UVER = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
DTYPE =
VER ?= $(subst $(DTYPE),,$(UVER))
## http://wiki.debian.org/onlyjob/get-orig-source
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
@
## checkout from subversion (add "subversion, svn2cl | subversion-tools (<< 1.7.5)" to Build-Depends)
UURL = https://oss.gonicus.de/repositories/gosa-contrib/netgroups/trunk
REV = $(shell echo $(VER) | perl -ne 'print "$$1" if m/(?:git|svn|hg)(\d+)/;')
$(PKG)_$(VER)$(DTYPE).orig.tar.xz: $(info I: REV=$(REV))
$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
svn export --config-option config:miscellany:use-commit-times=yes -r $(REV) \
$(UURL) $(PKG)-$(VER) \
|| $(RM) -r $(PKG)-$(VER)
@echo "# Packing..."
find -L $(PKG)-$(VER) -xdev -type f -print | sort \
| XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
&& $(RM) -r "$(PKG)-$(VER)"
|