File: get-orig-source.mk

package info (click to toggle)
python-repoze.who-plugins 20090913-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,448 kB
  • ctags: 713
  • sloc: python: 2,684; makefile: 180; sh: 11
file content (36 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download | duplicates (4)
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
36
# debian/rules snippet for creating multi-upstream tarball relying on
# several debian/*.watch files

# Copyright © 2009 Stefano Zacchiroli <zack@debian.org>
# License: GNU GPL version 3 or above
# Created: Sat, 30 May 2009 11:58:16 +0200
# Last-Modified: Sun, 31 May 2009 00:46:12 +0200

# TODO: does not yet fully implement policy wrt get-orig-source:
#       - the target cannot be invoked from any dir (rely on "debian/")
#       - tmpdir handling is not fully safe (e.g., no "mktemp -d")

GOSTMP = get-orig-source.tmp
ORIGNAME = $(PKG)-$(shell date +%Y%m%d)
ORIGTARBALL = $(PKG)_$(shell date +%Y%m%d).orig.tar.gz

get-orig-source: $(patsubst %,%/get-orig-source,$(UPSTREAMS))
	cd $(GOSTMP) && \
	mkdir $(ORIGNAME) && \
	for p in $(UPSTREAMS) ; do \
		mv `readlink $$p` $(ORIGNAME) ; \
		mv $$p $(ORIGNAME) ; \
	done && \
	tar cvzf $(ORIGTARBALL) $(ORIGNAME) && \
	mv $(ORIGTARBALL) ../ && \
	cd .. && \
	rm -rf $(GOSTMP)/
$(GOSTMP):
	-mkdir $@
%/get-orig-source: $(GOSTMP)
	uscan --watchfile debian/$*.watch \
		--upstream-version 0 --package $* \
		--download --destdir $(GOSTMP)/
	cd $(GOSTMP) && \
	tar xzf $**.orig.tar.gz && \
	ln -s `tar tzf $**.orig.tar.gz | head -n1` $*