File: vsag.mk

package info (click to toggle)
vsag 0.1.2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 76 kB
  • ctags: 4
  • sloc: sh: 61; makefile: 1
file content (128 lines) | stat: -rw-r--r-- 4,393 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#
# Copyright (C) 2009  Robert Millan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

SHELL = bash

dpkg_scanpackages	= dpkg-scanpackages

ifneq (, $(override_file))
dpkg_scanpackages	+= --extra-override="$(override_file)"
endif

INDEXES = \
	$(foreach arch, $(arches), dists/$(release)/main/binary-$(arch)/Release) \
	$(foreach p, Packages Packages.gz Packages.bz2 Packages.lzma, \
		$(foreach arch, $(arches), dists/$(release)/main/binary-$(arch)/$(p)) \
	) \
	$(foreach arch, $(arches), dists/$(release)/main/debian-installer/binary-$(arch)/Release) \
	$(foreach p, Packages Packages.gz Packages.bz2 Packages.lzma, \
		$(foreach arch, $(arches), dists/$(release)/main/debian-installer/binary-$(arch)/$(p)) \
	) \
	$(foreach arch, $(arches), dists/$(release)/main/source/Release) \
	$(foreach s, Sources Sources.gz Sources.bz2 Sources.lzma, \
		$(foreach arch, $(arches), dists/$(release)/main/source/$(s)) \
	) \
	$(NULL)

dists: dists/$(release)/Release dists/$(release)/Release.gpg archive-key.asc $(INDEXES)

$(foreach arch, $(arches), dists/%/main/binary-$(arch)/Packages): $(pkgdir)
	base=`echo $@ | sed -e s,/binary-.*,,g` ; \
	for arch in $(arches) ; do \
		mkdir -p $$base/binary-$$arch ; \
		$(dpkg_scanpackages) -a $$arch $^ /dev/null > $$base/binary-$$arch/Packages ; \
	done

$(foreach arch, $(arches), dists/%/main/debian-installer/binary-$(arch)/Packages): $(pkgdir)
	base=`echo $@ | sed -e s,/binary-.*,,g` ; \
	for arch in $(arches) ; do \
		mkdir -p $$base/binary-$$arch ; \
		$(dpkg_scanpackages) -u -a $$arch $^ /dev/null > $$base/binary-$$arch/Packages ; \
	done

dists/%/main/source/Sources: $(pkgdir)
	mkdir -p `dirname $@`
	dpkg-scansources $^ /dev/null > $@

%.gz: %
	gzip -9 -n < $^ > $@

%.bz2: %
	bzip2 -9 < $^ > $@

%.lzma: %
	lzma -9 < $^ > $@

dists/%/Release: $(INDEXES)
	mkdir -p `dirname $@`

	# FIXME: some of these still need to be made configurable, but which
	# ones actually matter?
	(echo "Origin: Debian" ; \
	echo "Label: Debian" ; \
	echo "Suite: stable" ; \
	echo "Codename: $(release)" ; \
	echo "Date: Fri, 09 Jan 2009 08:32:38 UTC" ; \
	echo "Valid-Until: Fri, 16 Jan 2099 08:32:38 UTC" ; \
	echo "Architectures: $(arches)" ; \
	echo "Components: main" ; \
	echo "Description: $(description)") > $@

	echo "MD5Sum:" >> $@
	for i in $^ ; do \
		echo " `md5sum $$i | sed -e "s/ .*//g"` `wc -c < $$i` `echo $$i | sed -e "s,^dists/[^/]*/,,g"`" ; \
	done >> $@
	echo "SHA1:" >> $@
	for i in $^ ; do \
		echo " `sha1sum $$i | sed -e "s/ .*//g"` `wc -c < $$i` `echo $$i | sed -e "s,^dists/[^/]*/,,g"`" ; \
	done >> $@
	if which sha256sum > /dev/null ; then \
		echo "SHA256:" >> $@ ; \
		for i in $^ ; do \
			echo " `sha256sum $$i | sed -e "s/ .*//g"` `wc -c < $$i` `echo $$i | sed -e "s,^dists/[^/]*/,,g"`" ; \
		done >> $@ ; \
	else \
		echo "WARNING: sha256sum not found, won't include SHA256 hash" >&2 ; \
	fi

$(foreach arch, $(arches), dists/$(release)/main/binary-$(arch)/Release dists/$(release)/main/debian-installer/binary-$(arch)/Release):
	for arch in $(arches) ; do \
		mkdir -p dists/$(release)/main/{debian-installer/,}binary-$$arch ; \
		(echo "Archive: stable" ; \
		echo "Version: 5.0" ; \
		echo "Component: main" ; \
		echo "Origin: Debian" ; \
		echo "Label: Debian" ; \
		echo "Architecture: $$arch") \
		| tee dists/$(release)/main/binary-$$arch/Release \
		> dists/$(release)/main/debian-installer/binary-$$arch/Release ; \
	done

dists/$(release)/main/source/Release:
	mkdir -p `dirname $@`
	(echo "Archive: stable" ; \
	echo "Version: 5.0" ; \
	echo "Component: main" ; \
	echo "Origin: Debian" ; \
	echo "Label: Debian" ; \
	echo "Architecture: source") \
	> dists/$(release)/main/source/Release

dists/%/Release.gpg: dists/%/Release
	gpg --default-key $(key) --detach-sign -a < $< > $@

archive-key.asc:
	gpg --export -a $(key) > $@