File: rules

package info (click to toggle)
apt-howto 2.0.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,648 kB
  • ctags: 36
  • sloc: sh: 942; makefile: 337; perl: 137; lisp: 9; sed: 3
file content (247 lines) | stat: -rwxr-xr-x 7,876 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatibility version to use.
export DH_COMPAT=4
export LC_ALL=C

MANUAL := apt-howto
LANGS  := ca de el en es fr it ja ko pt-br pl ru tr uk
BUILD_TYPE := package
ENTFILES := $(foreach lang,$(LANGS),$(MANUAL).$(lang).ent)

$(MANUAL).%.ent:
	echo "<!entity language \"$*\">"        > $@
	echo "<!entity % lang-$* \"INCLUDE\">" >> $@
	echo "<!entity docversion \"$(shell \
		LC_ALL=C \
		dpkg-parsechangelog | \
		sed -n 's/^Version: *//p')\">" >> $@
	echo "<!entity docdate \"$(shell \
		bin/getdocdate -p $*)\">"      >> $@

configure: configure-stamp
configure-stamp: $(ENTFILES)
	dh_testdir
	touch configure-stamp

patch:
	for i in $$(ls debian/patches/*.diff); do \
		test -f $${i}.patched || \
		patch -p0 < $${i} && \
		touch $${i}.patched; \
	done


build: patch build-stamp

build-stamp: configure-stamp 
	dh_testdir
	# Add here commands to compile the package.
	$(MAKE) "MANUAL=$(MANUAL)" "LANGS=$(LANGS)" \
	        "BUILD_TYPE=$(BUILD_TYPE)" html txt pdf ps README
	touch build-stamp

clean:
	dh_testdir
	dh_testroot

	for i in $$(ls debian/patches/*.patched); do \
		patch -p0 -R < $${i/.patched/}; \
	done

	# code based on gnome-pkg-tools to auto create Uploaders field from 
	# metainfo available on the Debian Brasil's Team SVN repo
	TEAM_LIST=../../metainfo/debian-br.team; \
	if test -f $${TEAM_LIST}; then \
		MAINTAINER=$$(sed -n 's/^Maintainer: //p' debian/control.in); \
		grep -vF "$${MAINTAINER}" $${TEAM_LIST} | tr '\n' ' ' > debian/uploaders.tmp; \
		cat debian/uploaders.tmp; \
		if diff -q debian/uploaders debian/uploaders.tmp; then \
			rm debian/uploaders.tmp; \
		else \
			mv debian/uploaders.tmp debian/uploaders; \
		fi; \
	fi
	UPLOADERS=$$(cat debian/uploaders); \
	sed "s/@DEBIAN_BR_TEAM@/$${UPLOADERS}/g" < debian/control.in > debian/control.tmp; \
	if diff -q debian/control debian/control.tmp; then \
		rm debian/control.tmp; \
	else \
		mv debian/control.tmp debian/control; \
	fi

	# end of Uploaders generating code

	if patch --dry-run -R -p0 < debian/patches/00_special_case_el_in_fixhtml.diff >& /dev/null; then \
	   patch -R -p0 < debian/patches/00_special_case_el_in_fixhtml.diff; \
	fi
	rm -f build-stamp configure-stamp
	# Add here commands to clean up after the build process.
	-$(MAKE) "MANUAL=$(MANUAL)" "LANGS=$(LANGS)" \
	 clean
	-cd $(CURDIR)/debian/ ;  rm -f apt-howto.README.Debian
	-cd $(CURDIR)/debian/ ;  rm -f apt-howto-common.README.Debian
	-cd $(CURDIR)/debian/ ; for xx in $(LANGS) ; do \
	rm -f apt-howto-$${xx}.README.Debian \
	      apt-howto-$${xx}.dirs \
	      apt-howto-$${xx}.doc-base; \
	done
	-rm *.ent

	dh_clean

refresh: clean
	dh_testdir
	dh_testroot
# 	cvs -d :ext:osamu@cvs.qref.sf.net:/cvsroot/qref up
#	cvs -d :pserver:anonymous@cvs.qref.sf.net:/cvsroot/qref up

new:    clean
#	rm ../debian-refernce
#	cvs -d :ext:osamu@cvs.qref.sf.net:/cvsroot/qref export -d ../debian-reference -D tomorrow qref
#	cvs -d :pserver:anonymous@cvs.qref.sf.net:/cvsroot/qref up

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/apt-howto-??.
	test -d $(CURDIR)/debian/apt-howto-common/usr/bin \
	   || install -d -m 755 $(CURDIR)/debian/apt-howto-common/usr/bin
	install -m 755 --preserve-timestamps apt-howto \
	    $(CURDIR)/debian/apt-howto-common/usr/bin/apt-howto

	$(MAKE) LANGS=ca "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-ca/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=en "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-en/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=el "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-el/usr/share/doc/Debian \
	    publish-html publish-txt

	$(MAKE) LANGS=fr "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-fr/usr/share/doc/Debian \
	    publish-html publish-txt #publish-ps publish-pdf

	$(MAKE) LANGS=it "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-it/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=es "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-es/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=de "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-de/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=pt-br "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-pt-br/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=pl "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-pl/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=ja "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-ja/usr/share/doc/Debian \
	    publish-html publish-txt #publish-ps publish-pdf

	$(MAKE) LANGS=ko "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-ko/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=ru "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-ru/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=tr "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-tr/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

	$(MAKE) LANGS=uk "MANUAL=$(MANUAL)" "BUILD_TYPE=$(BUILD_TYPE)" \
	    PUBLISHDIR=$(CURDIR)/debian/apt-howto-uk/usr/share/doc/Debian \
	    publish-html publish-txt publish-ps publish-pdf

#	copy README.Debian for all the packages
	cd $(CURDIR)/debian/ ; for xx in \
	apt-howto apt-howto-common ; do \
	cp README.Debian.all $${xx}.README.Debian ; done
	cd $(CURDIR)/debian/ ; for xx in $(LANGS) ; do \
	cp README.Debian.all apt-howto-$${xx}.README.Debian ; done

	cd $(CURDIR)/debian/ ; for xx in $(LANGS) ; do \
	case $$xx in \
	ca) LANG="Catalan" ;; \
	el) LANG="Greek" ;; \
	en) LANG="English" ;;  \
	de) LANG="German" ;;   \
	fr) LANG="French" ;;   \
	fi) LANG="Finnish" ;;  \
	es) LANG="Spanish" ;;  \
	it) LANG="Italian" ;;  \
	ja) LANG="Japanese" ;; \
	ko) LANG="Korean" ;; \
	pl) LANG="Polish" ;; \
	ru) LANG="Russian" ;; \
	tr) LANG="Turkish" ;; \
	uk) LANG="Ukrainian" ;; \
	pt-br) LANG="Portuguese (Brazil)" ;; \
	zh-tw) LANG="Chinese (Traditional)" ;; \
	zh-cn) LANG="Chinese (Simplified)" ;; \
	esac ; \
	sed  -e "s/@@/$$xx/" \
	<apt-howto.dirs.all  >apt-howto-$${xx}.dirs ; \
	sed  -e "s/@@/$$xx/" -e "s/@LANG@/$$LANG/" \
	<apt-howto.doc-base-all  >apt-howto-$${xx}.doc-base ; \
	done


# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
#	dh_installdebconf	
#	dh_movefiles
	dh_installdocs
	dh_installexamples
	dh_installmenu
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
	dh_installcron
	dh_installman -p apt-howto-common apt-howto.1
	dh_installinfo
#	dh_undocumented
	dh_installchangelogs 
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install

binary: binary-indep binary-arch

.PHONY: build clean binary-indep binary-arch binary install configure refresh patch