File: rules

package info (click to toggle)
python-doc-defaults 2.4.4-1
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k
  • size: 684 kB
  • ctags: 277
  • sloc: makefile: 166; sh: 5
file content (218 lines) | stat: -rwxr-xr-x 6,095 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

export SHELL = /bin/bash

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

DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)

export VER=2.4
export NVER=2.5
export PVER=python2.4
export PRIORITY=$(shell echo $(VER) | tr -d '.')0

PREVVER	:= $(shell awk '/^python/ && NR > 1 {print substr($$2,2,length($$2)-2); exit}' debian/changelog)
PREVVER := 2.4.4

PWD		:= $(shell pwd)

d		:= debian/tmp
scriptdir	=  usr/share/lib/python$(VER)
scriptdir	=  usr/share/python$(VER)
scriptdir	=  usr/lib/python$(VER)

rst2html	= $(PVER) /usr/share/python-docutils/rst2html.py

build: stamp-build
stamp-build:
	touch stamp-build

stamp-doc-policy:
	debiandoc2text debian/python-policy.sgml
	mv -f python-policy.txt debian/
	debiandoc2html debian/python-policy.sgml
	rm -rf debian/python-policy.html
	mv -f python-policy.html debian/
	touch stamp-doc-policy

stamp-doc: stamp-doc-policy
	touch stamp-doc

control-file:
	sed -e "s/@PVER@/$(PVER)/g" \
	    -e "s/@NVER@/$(NVER)/g" \
	    -e "s/@VER@/$(VER)/g" \
	    -e "s/@PREVVER@/$(PREVVER)/g" \
	    -e "s/@PRIO@/$(PY_PRIO)/g" \
		<debian/control.in >debian/control.tmp
	[ -e debian/control ] \
	  && cmp -s debian/control debian/control.tmp \
	  && rm -f debian/control.tmp && exit 0; \
	  mv debian/control.tmp debian/control

faqs = index general programming library extending windows gui installed
get-faq:
	rm -rf faq
	mkdir faq
	cd faq && \
	  wget -nv $(foreach p,$(faqs),http://python.org/doc/faq/$(p).ht)
	sed 's,\<\([a-zA-Z0-9]*\.html\)\>,faq/\1,' faq/index.ht \
		| awk '/^Translations$$/ {exit} {print}' > faq/FAQ.ht
	( \
	  echo ''; \
	  echo 'This is a local copy of the online FAQ located at'; \
	  echo 'http://python.org/doc/faq.'; \
	  echo "The copy was fetched and generated in `date '+%B %Y'`."; \
	) >> faq/FAQ.ht
	rm -f faq/index.ht

clean:
	dh_testdir
	dh_testroot
	rm -f stamp-*
	rm -f patch-stamp*

	rm -f debian/python-policy.txt
	rm -rf debian/python-policy.html
	rm -f faq/*.h2 faq/*.html

	for f in debian/*.in; do \
	    f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \
	    if [ $$f2 != debian/control ]; then \
	        rm -f $$f2; \
	    fi; \
	done
	dh_clean

stamp-control:
	: # We have to prepare the various control files

	for f in debian/*.in; do \
	    f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \
	    if [ $$f2 != debian/control ]; then \
		sed -e "s/@PVER@/$(PVER)/g;s/@VER@/$(VER)/g" \
		    -e "s/@PRIORITY@/$(PRIORITY)/g" \
		    -e "s,@SCRIPTDIR@,/$(scriptdir),g" \
		  <$$f >$$f2; \
	    fi; \
	done

install: build stamp-install
stamp-install: stamp-build control-file stamp-control
	dh_testdir
	dh_testroot
	dh_clean -k
ifeq (0,1)
	dh_installdirs usr/share/doc/python/faq

	cd faq && \
	for p in *.ht; do \
	  p=`basename $$p .ht`; \
	  echo $(rst2html) $$p.ht $$p.html; \
	  awk 'NR > 2' $$p.ht > $$p.ht2; \
	  $(rst2html) $$p.ht2 $$p.html; \
	  mv $$p.html ../debian/python/usr/share/doc/python/faq/; \
	  rm -f $$p.ht2; \
	done
	mv debian/python/usr/share/doc/python/faq/FAQ.html \
		debian/python/usr/share/doc/python/
endif

	touch stamp-install

# Build architecture-independent files here.
binary-indep: build install stamp-doc
	dh_testdir -i
	dh_testroot -i

ifeq (0,1)
	: # provide the python and python.1 defaults
	mkdir -p debian/python/usr/bin
	ln -sf python$(VER) debian/python/usr/bin/python
	ln -sf pydoc$(VER) debian/python/usr/bin/pydoc
	ln -sf pygettext$(VER) debian/python/usr/bin/pygettext
	ln -sf pdb$(VER) debian/python/usr/bin/pdb

	mkdir -p debian/python/usr/share/man/man1
	ln -sf python$(VER).1.gz \
		debian/python/usr/share/man/man1/python.1.gz
	ln -sf pydoc$(VER).1.gz \
		debian/python/usr/share/man/man1/pydoc.1.gz
	ln -sf pygettext$(VER).1.gz \
		debian/python/usr/share/man/man1/pygettext.1.gz
	ln -sf pdb$(VER).1.gz \
		debian/python/usr/share/man/man1/pdb.1.gz

	mkdir -p debian/python/usr/share/doc/python
	cp -a debian/python-policy.{html,sgml,txt} \
		debian/python/usr/share/doc/python/

	: # add symlinks to policy files
	mkdir -p debian/python/usr/share/doc/python$(VER)
	for ext in html sgml.gz txt.gz; do \
	  ln -sf ../python/python-policy.$$ext \
		debian/python/usr/share/doc/python$(VER)/python-policy.$$ext; \
	done
endif

	mkdir -p debian/python-doc/usr/share/doc/python
	ln -sf ../python$(VER)-doc/html \
		debian/python-doc/usr/share/doc/python/html

	mkdir -p debian/python-doc/usr/share/doc/python-doc
	ln -sf ../python$(VER)-doc/html \
		debian/python-doc/usr/share/doc/python-doc/html

ifeq (0,1)
	mkdir -p debian/python/usr/share/apps/konsole
	cp -p debian/python.desktop debian/python/usr/share/apps/konsole/

	: # provide the python-dbg and python-dbg.1 defaults
	mkdir -p debian/python-dbg/usr/bin
	ln -sf python$(VER)-dbg debian/python-dbg/usr/bin/python-dbg
	mkdir -p debian/python-dbg/usr/share/man/man1
	ln -sf python$(VER)-dbg.1.gz \
		debian/python-dbg/usr/share/man/man1/python-dbg.1.gz

	mkdir -p debian/python/usr/lib/valgrind
	cp -p debian/valgrind-python.supp \
		debian/python/usr/lib/valgrind/python.supp

	: # provide the idle and idle.1 defaults
	mkdir -p debian/idle/usr/bin
	ln -sf idle-python$(VER) debian/idle/usr/bin/idle

	mkdir -p debian/idle/usr/share/man/man1
	ln -sf idle-python$(VER).1.gz \
		debian/idle/usr/share/man/man1/idle.1.gz

	mkdir -p debian/python-tk/usr/share/doc/python-tk
	cp -p debian/README.Tk debian/python-tk/usr/share/doc/python-tk/
endif

#	dh_installdebconf -i
	dh_installdocs -i --all debian/README.Debian
	dh_installmenu -i
	dh_installchangelogs -i
#	rm -rf debian/python-all-dev/usr/share/doc/python-all-dev
#	ln -sf python$(VER)-all debian/python-all-dev/usr/share/doc/python-all-dev
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

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

binary: binary-indep binary-arch

.PHONY: control-file configure build clean binary-indep binary-arch binary install

# Local Variables:
# mode: makefile
# end: