summaryrefslogtreecommitdiff
path: root/debian/rules
blob: b1834e8593346610338e9deaac3375a7f0f3e5b1 (plain)
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
#!/usr/bin/make -f

ARCHS=$(shell cd debian; ./getfromlist archlist)
LANGS=$(shell cd debian; ./getfromlist langlist)
VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
DATE=$(shell echo $(VERSION) | cut -d '.' -f 1)
SUITE=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Distribution: | cut -d ' ' -f 2)
ifeq (${SUITE},unstable)
SUITE=lenny
endif

MANTMP=$(shell pwd)/debian/manual

clean:
	dh_testdir
	dh_testroot
	dh_clean build-stamp
	rm -rf $(MANTMP)
	dh_clean doc-base-stamp
	rm -rf debian/installation-guide-*.doc-base.*
	rm -rf build/build.out build/build.tmp build/build.po

doc-base: doc-base-stamp
doc-base-stamp:
	@echo $(ARCHS)
	rm -f $@
	rm -rf debian/installation-guide-*.doc-base.*
	set -e && cd debian && \
	    for arch in $(ARCHS) ; do \
		for lang in $(LANGS) ; do \
		    arch_full="$$(grep "^$$arch[[:space:]]" archlist | cut -f 2)" ; \
		    lang_full="$$(grep "^$$lang[[:space:]]" langlist | cut -f 2)" ; \
		    sed -e "s:%ARCH%:$$arch:g" -e "s:%ARCH_FULL%:$$arch_full:g" \
			-e "s:%LANG%:$$lang:g" -e "s:%LANG_FULL%:$$lang_full:g" \
			doc-base.TEMPLATE > installation-guide-$$arch.doc-base.$$lang ; \
		done ; \
	    done
	touch $@

build: build-stamp
build-stamp:
	rm -f $@
	-rm -rf $(MANTMP)
	set -e && cd build && \
	    for arch in $(ARCHS) ; do \
		official_build=1 manual_release=$(SUITE) \
		architectures="$$arch" languages="$(LANGS)" \
		destination=$(MANTMP)/$$arch noarchdir=1 \
		./build.sh ; \
	    done
	touch $@

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	
binary-arch:

binary-indep: install doc-base
	dh_testdir
	dh_testroot
	dh_installchangelogs
	for arch in $(ARCHS) ; do \
		dh_installdocs -p installation-guide-$$arch $(MANTMP)/$$arch/* ; \
	done
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

	# Create a tarball for each arch for use in debian-cd
	# Note: these should be uploaded manually
	#set -e && cd $(MANTMP) && \
	#    for arch in $(ARCHS) ; do \
	#	tarname=di-manual-$${arch}_$(VERSION).tar.gz ; \
	#	cd $$arch ; \
	#	tar czf ../../../../$$tarname . ; \
	#	cd .. ; \
	#    done

binary: binary-indep binary-arch 
.PHONY: build build-images clean binary-indep binary-arch binary install