1
by Matthias Klose
- Initial checkin |
1 |
#!/usr/bin/make -f
|
2 |
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
|
|
3 |
||
4 |
unexport LANG LC_ALL LC_CTYPE LC_COLLATE LC_TIME LC_NUMERIC LC_MESSAGES |
|
5 |
||
6 |
export SHELL = /bin/bash |
|
7 |
||
8 |
# Uncomment this to turn on verbose mode.
|
|
9 |
#export DH_VERBOSE=1
|
|
10 |
||
11 |
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) |
|
12 |
DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) |
|
13 |
||
14 |
changelog_values := $(shell dpkg-parsechangelog \ |
|
15 |
| awk '/^(Version|Source):/ {print $$2}') |
|
16 |
PKGSOURCE := $(word 1, $(changelog_values)) |
|
17 |
PKGVERSION := $(word 2, $(changelog_values)) |
|
18 |
||
19 |
on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes) |
|
20 |
||
21 |
ifneq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) |
|
22 |
WITHOUT_CHECK := yes |
|
23 |
endif
|
|
24 |
ifeq ($(on_buildd),yes) |
|
25 |
ifneq (,$(findstring $(DEB_BUILD_ARCH), hppa s390)) |
|
26 |
WITHOUT_CHECK := yes |
|
27 |
endif
|
|
28 |
endif
|
|
29 |
# WITHOUT_CHECK := yes
|
|
30 |
||
31 |
distribution := $(shell lsb_release -is) |
|
32 |
#distribution := Ubuntu
|
|
33 |
||
34 |
export VER=2.5 |
|
35 |
export NVER=2.6 |
|
36 |
export PVER=python2.5 |
|
37 |
export PRIORITY=$(shell echo $(VER) | tr -d '.')0 |
|
38 |
||
39 |
PREVVER := $(shell awk '/^python/ && NR > 1 {print substr($$2,2,length($$2)-2); exit}' debian/changelog) |
|
40 |
||
41 |
# default versions are built from the python-defaults source package
|
|
42 |
# keep the definition to adjust package priorities.
|
|
43 |
DEFAULT_VERSION = no |
|
44 |
STATIC_PYTHON=yes |
|
45 |
||
46 |
MIN_MODS := $(shell awk '/^ / && $$2 == "module" { print $$1 }' \ |
|
47 |
debian/PVER-minimal.README.Debian.in) |
|
48 |
MIN_EXTS := $(shell awk '/^ / && $$2 == "extension" { print $$1 }' \ |
|
49 |
debian/PVER-minimal.README.Debian.in) |
|
50 |
MIN_BUILTINS := $(shell awk '/^ / && $$2 == "builtin" { print $$1 }' \ |
|
51 |
debian/PVER-minimal.README.Debian.in) |
|
52 |
MIN_ENCODINGS := $(foreach i, \ |
|
53 |
$(filter-out \ |
|
54 |
big5% bz2% cp932.py cp949.py cp950.py euc_% \ |
|
55 |
gb% iso2022% johab.py shift_jis% , \ |
|
56 |
$(shell cd Lib/encodings && echo *.py)), \ |
|
57 |
encodings/$(i)) \ |
|
58 |
codecs.py stringprep.py |
|
59 |
||
60 |
with_tk := no |
|
61 |
with_gdbm := no |
|
62 |
with_interp := static |
|
63 |
#with_interp := shared
|
|
64 |
||
65 |
ifneq (,$(findstring -doc, $(PKGSOURCE))) |
|
66 |
USE_L2H = yes |
|
67 |
with_doc := yes |
|
68 |
build_target := build-doc |
|
69 |
#install_target := install
|
|
70 |
python_for_doc = $(PY_INTERPRETER) |
|
71 |
else
|
|
72 |
build_target := build-all |
|
73 |
install_target := install |
|
74 |
python_for_doc = $(buildd_static)/python |
|
75 |
dh_args = -N$(p_doc) |
|
76 |
endif
|
|
77 |
ifeq ($(distribution),Ubuntu) |
|
78 |
dh_args := |
|
79 |
ifneq (,$(findstring -doc, $(PKGSOURCE))) |
|
80 |
with_doc := |
|
81 |
else
|
|
82 |
with_doc := yes |
|
83 |
with_doc_update = $(USE_L2H) |
|
84 |
doc_dependencies := stamp-unpack-doc |
|
85 |
info_docs=unpacked |
|
86 |
endif
|
|
87 |
endif
|
|
88 |
ifeq ($(USE_L2H),yes) |
|
89 |
doc_dependencies := stamp-doc-html stamp-doc-info update-doc |
|
90 |
info_docs=built |
|
91 |
endif
|
|
92 |
||
93 |
PY_INTERPRETER = /usr/bin/python$(VER) |
|
94 |
||
95 |
ifeq ($(DEFAULT_VERSION),yes) |
|
96 |
PY_PRIO = standard |
|
97 |
#PYSTDDEP = , python (>= $(VER))
|
|
98 |
else
|
|
99 |
PY_PRIO = optional |
|
100 |
endif
|
|
101 |
ifeq ($(distribution),Ubuntu) |
|
102 |
PY_MINPRIO = required |
|
103 |
with_fpectl = yes |
|
104 |
with_doc := yes |
|
105 |
else
|
|
106 |
PY_MINPRIO = $(PY_PRIO) |
|
107 |
endif
|
|
108 |
||
109 |
CC = gcc |
|
110 |
ifneq ($(CC),gcc) |
|
111 |
GCCBDEP =, gcc-4.1 |
|
112 |
GCCDEP =, $(CC) |
|
113 |
endif
|
|
114 |
||
115 |
# on alpha, use -O2 only, use -mieee
|
|
116 |
ifeq ($(DEB_BUILD_ARCH),alpha) |
|
117 |
OPTSETTINGS = OPT="-g -O2 -mieee -Wall -Wstrict-prototypes" |
|
118 |
OPTDEBUGSETTINGS = OPT="-g -O0 -mieee -Wall -Wstrict-prototypes" |
|
119 |
endif
|
|
120 |
ifeq ($(DEB_BUILD_ARCH),m68k) |
|
121 |
OPTSETTINGS = OPT="-g -O2 -Wall -Wstrict-prototypes" |
|
122 |
endif
|
|
123 |
||
124 |
PWD := $(shell pwd) |
|
125 |
buildd_static := $(PWD)/build-static |
|
126 |
buildd_shared := $(PWD)/build-shared |
|
127 |
buildd_debug := $(PWD)/build-debug |
|
128 |
||
129 |
d := debian/tmp |
|
130 |
scriptdir = usr/share/lib/python$(VER) |
|
131 |
scriptdir = usr/share/python$(VER) |
|
132 |
scriptdir = usr/lib/python$(VER) |
|
133 |
||
134 |
# package names and directories
|
|
135 |
p_base := $(PVER) |
|
136 |
p_min := $(PVER)-minimal |
|
137 |
p_tk := $(PVER)-tk |
|
138 |
p_gdbm := $(PVER)-gdbm |
|
139 |
p_dev := $(PVER)-dev |
|
140 |
p_exam := $(PVER)-examples |
|
141 |
#p_xml := $(PVER)-xmlbase
|
|
142 |
p_idle := idle-$(PVER) |
|
143 |
p_doc := $(PVER)-doc |
|
144 |
p_dbg := $(PVER)-dbg |
|
145 |
||
146 |
d_base := debian/$(p_base) |
|
147 |
d_min := debian/$(p_min) |
|
148 |
d_tk := debian/$(p_tk) |
|
149 |
d_gdbm := debian/$(p_gdbm) |
|
150 |
d_dev := debian/$(p_dev) |
|
151 |
d_exam := debian/$(p_exam) |
|
152 |
#d_xml := debian/$(p_xml)
|
|
153 |
d_idle := debian/$(p_idle) |
|
154 |
d_doc := debian/$(p_doc) |
|
155 |
d_dbg := debian/$(p_dbg) |
|
156 |
||
157 |
build: $(build_target) |
|
158 |
build-all: stamp-build |
|
159 |
stamp-build: stamp-build-static stamp-build-shared stamp-build-debug stamp-mincheck stamp-check stamp-pystone stamp-pybench $(doc_dependencies) |
|
160 |
touch stamp-build |
|
161 |
||
162 |
stamp-build-static: stamp-configure-static |
|
163 |
dh_testdir
|
|
164 |
$(MAKE) -C $(buildd_static) |
|
165 |
touch stamp-build-static |
|
166 |
||
167 |
stamp-build-shared: stamp-configure-shared |
|
168 |
dh_testdir
|
|
169 |
$(MAKE) -C $(buildd_shared) |
|
170 |
# : # build the shared library
|
|
171 |
# $(MAKE) -C $(buildd_shared) \
|
|
172 |
# libpython$(VER).so
|
|
173 |
: # build a static library with PIC objects |
|
174 |
$(MAKE) -C $(buildd_shared) \ |
|
175 |
LIBRARY=libpython$(VER)-pic.a libpython$(VER)-pic.a |
|
176 |
touch stamp-build-shared |
|
177 |
||
178 |
stamp-build-debug: stamp-configure-debug |
|
179 |
dh_testdir
|
|
180 |
$(MAKE) -C $(buildd_debug) |
|
181 |
touch stamp-build-debug |
|
182 |
||
183 |
common_configure_args = \ |
|
184 |
--prefix=/usr \ |
|
185 |
--enable-ipv6 \ |
|
186 |
--enable-unicode=ucs4 \ |
|
187 |
--without-cxx \ |
|
188 |
--with-system-ffi \ |
|
189 |
||
190 |
ifeq ($(with_fpectl),yes) |
|
191 |
common_configure_args += \ |
|
192 |
--with-fpectl |
|
193 |
endif
|
|
194 |
||
195 |
stamp-configure-shared: patch-stamp |
|
196 |
rm -rf $(buildd_shared) |
|
197 |
mkdir -p $(buildd_shared) |
|
198 |
cd $(buildd_shared) && \ |
|
199 |
CC="$(CC)" $(OPTSETTINGS) \ |
|
200 |
../configure \ |
|
201 |
--enable-shared \ |
|
202 |
$(common_configure_args) |
|
203 |
||
204 |
touch stamp-configure-shared |
|
205 |
||
206 |
stamp-configure-static: patch-stamp |
|
207 |
rm -rf $(buildd_static) |
|
208 |
mkdir -p $(buildd_static) |
|
209 |
cd $(buildd_static) && \ |
|
210 |
CC="$(CC)" $(OPTSETTINGS) \ |
|
211 |
../configure \ |
|
212 |
$(common_configure_args) |
|
213 |
||
214 |
: # apply workaround for missing os.fsync |
|
215 |
sed 's/HAVE_SYNC/HAVE_FSYNC/g' $(buildd_static)/pyconfig.h \ |
|
216 |
> $(buildd_static)/pyconfig.h.new |
|
217 |
touch -r $(buildd_static)/pyconfig.h $(buildd_static)/pyconfig.h.new |
|
218 |
mv -f $(buildd_static)/pyconfig.h.new $(buildd_static)/pyconfig.h |
|
219 |
||
220 |
touch stamp-configure-static |
|
221 |
||
222 |
stamp-configure-debug: patch-stamp |
|
223 |
rm -rf $(buildd_debug) |
|
224 |
mkdir -p $(buildd_debug) |
|
225 |
cd $(buildd_debug) && \ |
|
226 |
CC="$(CC)" $(OPTDEBUGSETTINGS) \ |
|
227 |
../configure \ |
|
228 |
$(common_configure_args) \ |
|
229 |
--with-pydebug |
|
230 |
||
231 |
: # apply workaround for missing os.fsync |
|
232 |
sed 's/HAVE_SYNC/HAVE_FSYNC/g' $(buildd_debug)/pyconfig.h \ |
|
233 |
> $(buildd_debug)/pyconfig.h.new |
|
234 |
touch -r $(buildd_debug)/pyconfig.h $(buildd_debug)/pyconfig.h.new |
|
235 |
mv -f $(buildd_debug)/pyconfig.h.new $(buildd_debug)/pyconfig.h |
|
236 |
||
237 |
touch stamp-configure-debug |
|
238 |
||
239 |
stamp-mincheck: |
|
240 |
for m in $(MIN_MODS) $(MIN_EXTS) $(MIN_BUILTINS); do \ |
|
241 |
echo "import $$m"; \ |
|
242 |
done > $(buildd_static)/minmods.py |
|
243 |
cd $(buildd_static) && ./python ../debian/pymindeps.py minmods.py \ |
|
244 |
> $(buildd_static)/mindeps.txt |
|
245 |
if [ -x /usr/bin/dot ]; then \ |
|
246 |
python debian/depgraph.py < $(buildd_static)/mindeps.txt \ |
|
247 |
> $(buildd_static)/mindeps.dot; \ |
|
248 |
dot -Tpng -o $(buildd_static)/mindeps.png \ |
|
249 |
$(buildd_static)/mindeps.dot; \ |
|
250 |
else true; fi |
|
251 |
cd $(buildd_static) && ./python ../debian/mincheck.py \ |
|
252 |
minmods.py mindeps.txt |
|
253 |
touch stamp-mincheck |
|
254 |
||
255 |
TEST_RESOURCES = all |
|
256 |
ifeq ($(on_buildd),yes) |
|
257 |
TEST_RESOURCES := $(TEST_RESOURCES),-network |
|
258 |
endif
|
|
259 |
TESTOPTS = -w -l -u$(TEST_RESOURCES) |
|
260 |
ifeq ($(on_buildd),yes) |
|
8
by Matthias Klose
merge 2.5.1-7 |
261 |
TESTOPTS += -x test_tcl test_codecmaps_cn test_codecmaps_hk \ |
262 |
test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw \ |
|
263 |
test_normalization test_ossaudiodev |
|
1
by Matthias Klose
- Initial checkin |
264 |
endif
|
265 |
ifneq (,$(findstring $(DEB_BUILD_ARCH), arm m68k)) |
|
8
by Matthias Klose
merge 2.5.1-7 |
266 |
ifeq ($(on_buildd),yes) |
267 |
TESTOPTS += test_compiler |
|
268 |
else
|
|
269 |
TESTOPTS += -x test_compiler |
|
270 |
endif
|
|
1
by Matthias Klose
- Initial checkin |
271 |
endif
|
272 |
||
273 |
stamp-check: |
|
274 |
ifeq ($(WITHOUT_CHECK),yes) |
|
275 |
echo "check run disabled for this build" > $(buildd_static)/test_results |
|
276 |
else
|
|
277 |
: # build locales needed by the testsuite |
|
278 |
rm -rf locales |
|
279 |
mkdir locales |
|
280 |
chmod +x debian/locale-gen |
|
281 |
debian/locale-gen |
|
282 |
||
283 |
@echo ========== test environment ============ |
|
284 |
@env |
|
285 |
@echo ======================================== |
|
286 |
||
287 |
@echo "BEGIN test static" |
|
288 |
-time \ |
|
289 |
LOCPATH=$(PWD)/locales \ |
|
290 |
$(MAKE) -C $(buildd_static) test \ |
|
291 |
TESTOPTS="$(TESTOPTS)" 2>&1 \ |
|
292 |
| tee $(buildd_static)/test_results |
|
293 |
@echo "END test static" |
|
294 |
@echo "BEGIN test shared" |
|
295 |
-time \ |
|
296 |
LOCPATH=$(PWD)/locales \ |
|
297 |
$(MAKE) -C $(buildd_shared) test \ |
|
298 |
TESTOPTS="$(TESTOPTS)" 2>&1 \ |
|
299 |
| tee $(buildd_shared)/test_results |
|
300 |
@echo "END test shared" |
|
301 |
ifeq (,$(findstring $(DEB_BUILD_ARCH), alpha)) |
|
302 |
@echo "BEGIN test debug" |
|
303 |
-time \ |
|
304 |
LOCPATH=$(PWD)/locales \ |
|
305 |
$(MAKE) -C $(buildd_debug) test \ |
|
306 |
TESTOPTS="$(TESTOPTS)" 2>&1 \ |
|
307 |
| tee $(buildd_debug)/test_results |
|
308 |
@echo "END test debug" |
|
309 |
endif
|
|
310 |
endif
|
|
311 |
cp -p $(buildd_static)/test_results debian/ |
|
312 |
touch stamp-check |
|
313 |
||
314 |
stamp-pystone: |
|
315 |
@echo "BEGIN pystone static" |
|
316 |
cd $(buildd_static) && ./python ../Lib/test/pystone.py |
|
317 |
cd $(buildd_static) && ./python ../Lib/test/pystone.py |
|
318 |
@echo "END pystone static" |
|
319 |
@echo "BEGIN pystone shared" |
|
320 |
cd $(buildd_shared) \ |
|
321 |
&& LD_LIBRARY_PATH=. ./python ../Lib/test/pystone.py |
|
322 |
cd $(buildd_shared) \ |
|
323 |
&& LD_LIBRARY_PATH=. ./python ../Lib/test/pystone.py |
|
324 |
@echo "END pystone shared" |
|
325 |
@echo "BEGIN pystone debug" |
|
326 |
cd $(buildd_debug) && ./python ../Lib/test/pystone.py |
|
327 |
cd $(buildd_debug) && ./python ../Lib/test/pystone.py |
|
328 |
@echo "END pystone debug" |
|
329 |
touch stamp-pystone |
|
330 |
||
331 |
stamp-pybench: |
|
8
by Matthias Klose
merge 2.5.1-7 |
332 |
ifeq ($(WITHOUT_CHECK),yes) |
1
by Matthias Klose
- Initial checkin |
333 |
echo "pybench run disabled for this build" > $(buildd_static)/pybench.log |
334 |
else
|
|
8
by Matthias Klose
merge 2.5.1-7 |
335 |
ifeq (,$(filter $(DEB_BUILD_ARCH), arm armel m68k)) |
1
by Matthias Klose
- Initial checkin |
336 |
@echo "BEGIN pybench static" |
337 |
cd $(buildd_static) \ |
|
338 |
&& time ./python ../Tools/pybench/pybench.py -f run1.pybench |
|
339 |
cd $(buildd_static) \ |
|
340 |
&& ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench |
|
341 |
@echo "END pybench static" |
|
342 |
@echo "BEGIN pybench shared" |
|
343 |
cd $(buildd_shared) \ |
|
344 |
&& LD_LIBRARY_PATH=. ./python ../Tools/pybench/pybench.py -f run1.pybench |
|
345 |
cd $(buildd_shared) \ |
|
346 |
&& LD_LIBRARY_PATH=. ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench |
|
347 |
@echo "END pybench shared" |
|
8
by Matthias Klose
merge 2.5.1-7 |
348 |
ifeq (,$(filter $(DEB_BUILD_ARCH), arm armel m68k)) |
1
by Matthias Klose
- Initial checkin |
349 |
@echo "BEGIN pybench debug" |
350 |
cd $(buildd_debug) \ |
|
351 |
&& time ./python ../Tools/pybench/pybench.py -f run1.pybench |
|
352 |
cd $(buildd_debug) \ |
|
353 |
&& ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench |
|
354 |
@echo "END pybench debug" |
|
355 |
endif
|
|
356 |
@echo "BEGIN shared/static comparision" |
|
357 |
$(buildd_static)/python Tools/pybench/pybench.py \ |
|
358 |
-s $(buildd_static)/run2.pybench -c $(buildd_shared)/run2.pybench \ |
|
359 |
| tee $(buildd_static)/pybench.log |
|
360 |
@echo "END shared/static comparision" |
|
361 |
else
|
|
362 |
echo "pybench not run on arch $(DEB_BUILD_ARCH)." > $(buildd_static)/pybench.log |
|
363 |
endif
|
|
364 |
endif
|
|
365 |
touch stamp-pybench |
|
366 |
||
367 |
minimal-test: |
|
368 |
rm -rf mintest |
|
369 |
mkdir -p mintest/lib mintest/dynlib mintest/testlib mintest/all-lib |
|
370 |
cp -p $(buildd_static)/python mintest/ |
|
371 |
cp -p $(foreach i,$(MIN_MODS),Lib/$(i).py) \ |
|
372 |
mintest/lib/ |
|
373 |
cp -p $(foreach i,$(MIN_EXTS),$(buildd_static)/build/lib*/$(i).so) \ |
|
374 |
mintest/dynlib/ |
|
375 |
cp -p Lib/unittest.py mintest/lib/ |
|
376 |
cp -pr Lib/test mintest/lib/ |
|
377 |
cp -pr Lib mintest/all-lib |
|
378 |
cp -p $(buildd_static)/build/lib*/*.so mintest/all-lib/ |
|
379 |
( \
|
|
380 |
echo "import sys"; \ |
|
381 |
echo "sys.path = ["; \ |
|
382 |
echo " '$(PWD)/mintest/lib',"; \ |
|
383 |
echo " '$(PWD)/mintest/dynlib',"; \ |
|
384 |
echo "]"; \ |
|
385 |
cat Lib/test/regrtest.py; \ |
|
386 |
) > mintest/lib/test/mintest.py |
|
387 |
cd mintest && ./python -E -S lib/test/mintest.py \ |
|
388 |
-x test_codecencodings_cn test_codecencodings_hk \ |
|
389 |
test_codecencodings_jp test_codecencodings_kr \ |
|
390 |
test_codecencodings_tw test_codecs test_multibytecodec \ |
|
391 |
||
392 |
stamp-doc-html: |
|
393 |
dh_testdir
|
|
394 |
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(buildd_static) \ |
|
395 |
$(MAKE) -C Doc tarhtml \ |
|
396 |
PYTHON=$(python_for_doc) \ |
|
397 |
MKHOWTO='TEXINPUTS=$$(TEXINPUTS) $$(PYTHON) $$(PWD)/tools/mkhowto' |
|
398 |
touch stamp-doc-html |
|
399 |
||
400 |
stamp-doc-info: |
|
401 |
dh_testdir
|
|
402 |
patch -p0 < debian/patches/libre.diff |
|
403 |
$(MAKE) -C Doc/info VERSION=$(VER) |
|
404 |
patch -R -p0 < debian/patches/libre.diff |
|
405 |
touch stamp-doc-info |
|
406 |
||
407 |
build-doc: patch-stamp stamp-build-doc |
|
408 |
stamp-build-doc: $(doc_dependencies) |
|
409 |
touch stamp-build-doc |
|
410 |
||
411 |
update-doc: |
|
412 |
ifeq ($(distribution),Ubuntu) |
|
413 |
: # copy just build docs to debian/patches |
|
414 |
ifneq (,$(findstring info, $(doc_dependencies))) |
|
415 |
tar cfj - Doc/html-*.tar Doc/info/*.info* \ |
|
416 |
| uuencode -m docs.tar.bz2 > debian/patches/docs.uue |
|
417 |
else
|
|
418 |
tar cfj - Doc/html-*.tar \ |
|
419 |
| uuencode -m docs.tar.bz2 > debian/patches/docs.uue |
|
420 |
endif
|
|
421 |
endif
|
|
422 |
||
423 |
stamp-unpack-doc: |
|
424 |
uudecode debian/patches/docs.uue |
|
425 |
tar xfj docs.tar.bz2 |
|
426 |
rm -f docs.tar.bz2 |
|
427 |
touch stamp-unpack-doc |
|
428 |
||
429 |
ifneq (,$(findstring -doc, $(PKGSOURCE))) |
|
430 |
control_files = debian/control.doc |
|
431 |
else
|
|
432 |
control_files = debian/control.in |
|
433 |
endif
|
|
434 |
||
435 |
control-file: |
|
436 |
sed -e "s/@PVER@/$(PVER)/g" \ |
|
437 |
-e "s/@VER@/$(VER)/g" \ |
|
438 |
-e "s/@PYSTDDEP@/$(PYSTDDEP)/g" \ |
|
439 |
-e "s/@GCCDEP@/$(GCCDEP)/g" \ |
|
440 |
-e "s/@GCCBDEP@/$(GCCBDEP)/g" \ |
|
441 |
-e "s/@PRIO@/$(PY_PRIO)/g" \ |
|
442 |
-e "s/@MINPRIO@/$(PY_MINPRIO)/g" \ |
|
443 |
$(control_files) > debian/control.tmp |
|
444 |
ifeq ($(distribution),Ubuntu) |
|
445 |
ifneq (,$(findstring ubuntu, $(PKGVERSION))) |
|
446 |
m='Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>'; \ |
|
447 |
sed -i "/^Maintainer:/s/\(.*\)/Maintainer: $$m\nXSBC-Original-\1/" \ |
|
448 |
debian/control.tmp |
|
449 |
endif
|
|
450 |
endif
|
|
451 |
[ -e debian/control ] \ |
|
452 |
&& cmp -s debian/control debian/control.tmp \ |
|
453 |
&& rm -f debian/control.tmp && exit 0; \ |
|
454 |
mv debian/control.tmp debian/control |
|
455 |
||
456 |
||
457 |
||
458 |
clean: control-file |
|
459 |
dh_testdir
|
|
460 |
dh_testroot
|
|
461 |
$(MAKE) -f debian/rules unpatch |
|
462 |
rm -f stamp-* |
|
463 |
rm -f patch-stamp* pxxx |
|
464 |
rm -f debian/test_results |
|
465 |
||
466 |
-$(MAKE) -C Doc PYTHON=$(python_for_doc) realclean |
|
467 |
-$(MAKE) -C Doc/info clobber |
|
468 |
rm -f Doc/html-*.t?? |
|
469 |
rm -f Doc/commontex/patchlevel.tex |
|
470 |
-$(MAKE) -f Makefile.pre.in srcdir=. distclean |
|
471 |
rm -rf Lib/test/db_home |
|
472 |
rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) |
|
473 |
-find -name '*.py[co]' | xargs -n 50 rm -f |
|
474 |
rm -rf locales |
|
475 |
rm -rf $(d)-dbg |
|
476 |
||
477 |
for f in debian/*.in; do \ |
|
478 |
f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \ |
|
479 |
if [ $$f2 != debian/control ]; then \ |
|
480 |
rm -f $$f2; \ |
|
481 |
fi; \ |
|
482 |
done
|
|
483 |
ifneq (,$(findstring -doc, $(PKGSOURCE))) |
|
484 |
rm -f debian/patches/docs.uue |
|
485 |
endif
|
|
486 |
dh_clean
|
|
487 |
||
488 |
stamp-control: |
|
489 |
: # We have to prepare the various control files |
|
490 |
||
491 |
for f in debian/*.in; do \ |
|
492 |
f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \ |
|
493 |
if [ $$f2 != debian/control ]; then \ |
|
494 |
sed -e "s/@PVER@/$(PVER)/g;s/@VER@/$(VER)/g" \ |
|
495 |
-e "s/@PRIORITY@/$(PRIORITY)/g" \ |
|
496 |
-e "s,@SCRIPTDIR@,/$(scriptdir),g" \ |
|
497 |
-e "s,@INFO@,$(info_docs),g" \ |
|
498 |
<$$f >$$f2; \ |
|
499 |
fi; \ |
|
500 |
done
|
|
501 |
||
502 |
install: $(build_target) stamp-install |
|
503 |
stamp-install: stamp-build control-file stamp-control |
|
504 |
dh_testdir
|
|
505 |
dh_testroot
|
|
506 |
dh_clean -k |
|
507 |
dh_installdirs
|
|
508 |
||
509 |
: # make install into tmp and subsequently move the files into |
|
510 |
: # their packages' directories. |
|
511 |
install -d $(d)/usr |
|
512 |
ifeq ($(with_interp),static) |
|
513 |
$(MAKE) -C $(buildd_static) install prefix=$(PWD)/$(d)/usr |
|
514 |
else
|
|
515 |
$(MAKE) -C $(buildd_shared) install prefix=$(PWD)/$(d)/usr |
|
516 |
endif
|
|
517 |
||
518 |
: # add additional files |
|
519 |
mkdir -p $(d)/usr/lib/python$(VER)/plat-mac |
|
520 |
cp -p Lib/plat-mac/plistlib.py $(d)/usr/lib/python$(VER)/plat-mac/ |
|
521 |
||
522 |
: # remove files, which are not packaged |
|
523 |
rm -f $(d)/usr/bin/smtpd.py |
|
524 |
||
525 |
: # move manpages to new names |
|
526 |
if [ -d $(d)/usr/man/man1 ]; then \ |
|
527 |
mkdir -p $(d)/usr/share/man; \ |
|
528 |
mv $(d)/usr/man/man1/* $(d)/usr/share/man/man1/; \ |
|
529 |
rm -rf $(d)/usr/man/; \ |
|
530 |
fi
|
|
531 |
mv $(d)/usr/share/man/man1/python.1 \ |
|
532 |
$(d)/usr/share/man/man1/python$(VER).1 |
|
533 |
cp -p debian/pydoc.1 $(d)/usr/share/man/man1/pydoc$(VER).1 |
|
534 |
||
535 |
: # Symlinks to /usr/bin for some tools |
|
536 |
ln -sf ../lib/python$(VER)/pdb.py $(d)/usr/bin/pdb$(VER) |
|
537 |
cp -p debian/pdb.1 $(d)/usr/share/man/man1/pdb$(VER).1 |
|
538 |
||
539 |
: # versioned install only |
|
540 |
rm -f $(d)/usr/bin/python-config |
|
541 |
||
542 |
ifeq ($(with_interp),static) |
|
543 |
: # install the shared library |
|
544 |
cp -p $(buildd_shared)/libpython$(VER).so.1.0 $(d)/usr/lib/ |
|
545 |
endif
|
|
546 |
ifeq ($(with_interp),shared) |
|
547 |
: # install the statically linked runtime |
|
548 |
install -m755 $(buildd_static)/python $(d)/usr/bin/python$(VER)-static |
|
549 |
endif
|
|
550 |
ln -sf libpython$(VER).so.1.0 $(d)/usr/lib/libpython$(VER).so.1 |
|
551 |
ln -sf libpython$(VER).so.1 $(d)/usr/lib/libpython$(VER).so |
|
552 |
ln -sf ../../libpython$(VER).so \ |
|
553 |
$(d)/usr/lib/python$(VER)/config/libpython$(VER).so |
|
554 |
||
555 |
mv $(d)/usr/bin/pydoc $(d)/usr/bin/pydoc$(VER) |
|
556 |
cp -p Tools/i18n/pygettext.py $(d)/usr/bin/pygettext$(VER) |
|
557 |
cp -p debian/pygettext.1 $(d)/usr/share/man/man1/pygettext$(VER).1 |
|
558 |
||
559 |
: # install the Makefile of the shared python build |
|
560 |
sed -e '/^OPT/s,-O3,-O2,' \ |
|
561 |
-e 's,^RUNSHARED *=.*,RUNSHARED=,' \ |
|
562 |
build-shared/Makefile > $(d)/$(scriptdir)/config/Makefile |
|
563 |
||
564 |
: # Move the binary and the minimal libraries into $(p_min). |
|
565 |
dh_installdirs -p$(p_min) \ |
|
566 |
usr/bin \ |
|
567 |
usr/share/man/man1 \ |
|
568 |
$(scriptdir) |
|
569 |
DH_COMPAT=2 dh_movefiles -p$(p_min) --sourcedir=$(d) \ |
|
570 |
usr/bin/python$(VER) \ |
|
571 |
usr/share/man/man1/python$(VER).1 \ |
|
572 |
$(foreach i,$(MIN_EXTS),$(scriptdir)/lib-dynload/$(i).so) \ |
|
573 |
$(foreach i,$(MIN_MODS),$(scriptdir)/$(i).py) \ |
|
12
by Matthias Klose
* Move site.py to python2.4-minimal, remove `addbuilddir' from site.py, |
574 |
$(foreach i,$(MIN_ENCODINGS),$(scriptdir)/$(i)) \ |
575 |
$(scriptdir)/site.py |
|
1
by Matthias Klose
- Initial checkin |
576 |
|
577 |
ifneq ($(with_interp),static) |
|
578 |
DH_COMPAT=2 dh_movefiles -p$(p_min) --sourcedir=$(d) \ |
|
579 |
usr/lib/libpython$(VER).so.* |
|
580 |
endif
|
|
581 |
||
9
by Matthias Klose
* Move site customization into sitecustomize.py, don't make site.py |
582 |
: # Install sitecustomize.py. |
1
by Matthias Klose
- Initial checkin |
583 |
dh_installdirs -p$(p_min) etc/$(PVER) |
12
by Matthias Klose
* Move site.py to python2.4-minimal, remove `addbuilddir' from site.py, |
584 |
cp -p debian/sitecustomize.py $(d_min)/etc/$(PVER)/ |
585 |
patch -d $(d_min)/$(scriptdir) < debian/patches/site-builddir.diff |
|
9
by Matthias Klose
* Move site customization into sitecustomize.py, don't make site.py |
586 |
dh_link -p$(p_min) /etc/$(PVER)/sitecustomize.py \ |
587 |
/$(scriptdir)/sitecustomize.py |
|
1
by Matthias Klose
- Initial checkin |
588 |
|
589 |
: # Move the static library and the header files into $(p_dev). |
|
590 |
# mv $(d)/usr/share/include/python$(VER)/* $(d)/usr/include/python$(VER)/.
|
|
591 |
# rm -rf $(d)/usr/share/include
|
|
592 |
dh_installdirs -p$(p_dev) \ |
|
5
by Matthias Klose
* Merge with Debian; remaining changes: |
593 |
usr/share/doc/python$(VER) \ |
1
by Matthias Klose
- Initial checkin |
594 |
$(scriptdir) \ |
595 |
$(scriptdir)/doc/html \ |
|
596 |
usr/include \ |
|
597 |
usr/lib |
|
5
by Matthias Klose
* Merge with Debian; remaining changes: |
598 |
cp -p Misc/HISTORY Misc/README.valgrind Misc/gdbinit \ |
599 |
debian/README.maintainers \ |
|
600 |
debian/test_results $(buildd_static)/pybench.log \ |
|
601 |
$(d_dev)/usr/share/doc/python$(VER)/ |
|
602 |
||
1
by Matthias Klose
- Initial checkin |
603 |
DH_COMPAT=2 dh_movefiles -p$(p_dev) --sourcedir=$(d) \ |
604 |
usr/lib/python$(VER)/config \ |
|
605 |
usr/include/python$(VER) \ |
|
606 |
usr/lib/libpython$(VER).so \ |
|
607 |
usr/bin/python$(VER)-config |
|
608 |
mv $(d_dev)/usr/lib/python$(VER)/config/Makefile \ |
|
609 |
$(d)/usr/lib/python$(VER)/config/ |
|
610 |
mv $(d_dev)/usr/include/python$(VER)/pyconfig.h \ |
|
611 |
$(d)/usr/include/python$(VER)/ |
|
612 |
cp -p $(buildd_shared)/libpython$(VER)-pic.a \ |
|
613 |
$(d_dev)/usr/lib/python$(VER)/config/ |
|
614 |
||
615 |
: # copy the templates, scripts and tools from the Doc subdir |
|
616 |
cp -a Doc/{commontex,perl,templates,texinputs,tools} \ |
|
617 |
$(d_dev)/usr/lib/python$(VER)/doc/. |
|
618 |
cp -a Doc/html/{icons,about.dat,stdabout.dat,style.css} \ |
|
619 |
$(d_dev)/usr/lib/python$(VER)/doc/html/. |
|
620 |
mkdir $(d_dev)/usr/lib/python$(VER)/doc/api |
|
621 |
cp -a Doc/api/refcounts.dat $(d_dev)/usr/lib/python$(VER)/doc/api/. |
|
622 |
||
623 |
ifeq ($(with_tk),yes) |
|
624 |
: # Move the Tkinter files into $(p_tk). |
|
625 |
dh_installdirs -p$(p_tk) \ |
|
626 |
$(scriptdir) \ |
|
627 |
usr/lib/python$(VER)/lib-dynload |
|
628 |
DH_COMPAT=2 dh_movefiles -p$(p_tk) --sourcedir=$(d) \ |
|
629 |
usr/lib/python$(VER)/lib-dynload/_tkinter.so |
|
630 |
endif
|
|
631 |
||
632 |
ifeq ($(with_gdbm),yes) |
|
633 |
: # gdbm and dbm modules into $(p_gdbm). |
|
634 |
dh_installdirs -p$(p_gdbm) \ |
|
635 |
usr/lib/python$(VER)/lib-dynload |
|
636 |
DH_COMPAT=2 dh_movefiles -p$(p_gdbm) --sourcedir=$(d) \ |
|
637 |
usr/lib/python$(VER)/lib-dynload/gdbm.so |
|
638 |
endif
|
|
639 |
||
640 |
# : # xml module into $(p_xml).
|
|
641 |
# dh_installdirs -p$(p_xml) \
|
|
642 |
# $(scriptdir) \
|
|
643 |
# usr/lib/python$(VER)/lib-dynload
|
|
644 |
# DH_COMPAT=2 dh_movefiles -p$(p_xml) --sourcedir=$(d) \
|
|
645 |
# usr/lib/python$(VER)/lib-dynload/pyexpat.so \
|
|
646 |
# $(scriptdir)/xml
|
|
647 |
||
648 |
# : # The test framework into $(p_base), regression tests dropped
|
|
649 |
DH_COMPAT=2 dh_movefiles -p$(p_base) --sourcedir=$(d) \ |
|
650 |
$(scriptdir)/test/{regrtest.py,test_support.py,__init__.py,README,pystone.py} |
|
651 |
rm -rf $(d)/$(scriptdir)/test |
|
652 |
rm -rf $(d)/$(scriptdir)/ctypes/test |
|
653 |
rm -rf $(d)/$(scriptdir)/bsddb/test |
|
654 |
rm -rf $(d)/$(scriptdir)/email/test |
|
655 |
rm -rf $(d)/$(scriptdir)/sqlite/test |
|
656 |
||
657 |
: # IDLE |
|
658 |
mv $(d)/usr/bin/idle $(d)/usr/bin/idle-python$(VER) |
|
659 |
rm -f $(d)/usr/lib/python$(VER)/idlelib/idle.bat |
|
660 |
dh_installdirs -p$(p_idle) \ |
|
661 |
usr/bin \ |
|
662 |
usr/share/man/man1 |
|
663 |
DH_COMPAT=2 dh_movefiles -p$(p_idle) \ |
|
664 |
usr/bin/idle-python$(VER) |
|
665 |
cp -p debian/idle-$(PVER).1 $(d_idle)/usr/share/man/man1/ |
|
666 |
||
667 |
: # Move the demos and tools into $(p_exam)'s doc directory |
|
668 |
dh_installdirs -p$(p_exam) \ |
|
669 |
usr/share/doc/python$(VER)/examples |
|
670 |
||
671 |
cp -rp Demo Tools $(d_exam)/usr/share/doc/python$(VER)/examples/ |
|
672 |
rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Demo/sgi |
|
673 |
: # IDLE is in its own package: |
|
674 |
rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Tools/idle |
|
675 |
: # XXX: We don't need rgb.txt, we'll use our own: |
|
676 |
rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Tools/pynche/X |
|
677 |
||
678 |
: # XXX: Some files in upstream Demo and Tools have strange |
|
679 |
: # exec permissions, make lintian glad: |
|
680 |
-chmod 644 $(d_tk)/$(scriptdir)/lib-tk/Tix.py |
|
681 |
-chmod 644 $(d)/$(scriptdir)/runpy.py |
|
682 |
||
683 |
cd $(d_exam)/usr/share/doc/python$(VER)/examples && chmod 644 \ |
|
684 |
Demo/{classes/*.py*,comparisons/patterns} \ |
|
685 |
Demo/{rpc/test,threads/*.py*,md5test/*} \ |
|
686 |
Demo/pdist/{client.py,cmdfw.py,cmptree.py,cvslib.py,cvslock.py,FSProxy.py,mac.py,rcsclient.py,rcslib.py,security.py,server.py,sumtree.py} \ |
|
687 |
Demo/scripts/{morse.py,newslist.doc,wh.py} \ |
|
688 |
Demo/sockets/{broadcast.py,ftp.py,mcast.py,radio.py} \ |
|
689 |
Demo/tix/{bitmaps/{tix.gif,*x[pb]m*},samples/*.py} \ |
|
690 |
Demo/tkinter/guido/{AttrDialog.py,hanoi.py,hello.py,imagedraw.py,imageview.py,listtree.py,ManPage.py,ShellWindow.py,wish.py} \ |
|
691 |
Tools/scripts/pydocgui.pyw \ |
|
692 |
Tools/{scripts/mailerdaemon.py,modulator/genmodule.py} |
|
693 |
||
694 |
: # Replace all '#!' calls to python with $(PY_INTERPRETER) |
|
695 |
: # and make them executable |
|
696 |
for i in `find debian -mindepth 3 -type f`; do \ |
|
697 |
sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)\1,' \ |
|
698 |
$$i > $$i.temp; \ |
|
699 |
if cmp --quiet $$i $$i.temp; then \ |
|
700 |
rm -f $$i.temp; \ |
|
701 |
else \
|
|
702 |
mv -f $$i.temp $$i; \ |
|
703 |
chmod 755 $$i; \ |
|
704 |
echo "fixed interpreter: $$i"; \ |
|
705 |
fi; \ |
|
706 |
done
|
|
707 |
||
708 |
: # Move the docs into $(p_base)'s /usr/share/doc/$(PVER) directory, |
|
709 |
: # all other packages only have a copyright file. |
|
710 |
dh_installdocs -p$(p_base) \ |
|
5
by Matthias Klose
* Merge with Debian; remaining changes: |
711 |
README Misc/NEWS Misc/ACKS |
1
by Matthias Klose
- Initial checkin |
712 |
ln -sf NEWS.gz $(d_base)/usr/share/doc/$(p_base)/changelog.gz |
713 |
dh_installdocs --all -N$(p_base) -N$(p_dev) -N$(p_dbg) debian/README.Debian |
|
714 |
||
715 |
: # IDLE has its own changelogs, docs... |
|
716 |
dh_installchangelogs -p$(p_idle) Lib/idlelib/ChangeLog |
|
717 |
dh_installdocs -p$(p_idle) Lib/idlelib/{NEWS,README,TODO,extend}.txt |
|
718 |
||
719 |
mkdir -p $(d_idle)/usr/share/applications |
|
720 |
cp -p debian/idle.desktop \ |
|
721 |
$(d_idle)/usr/share/applications/idle-$(PVER).desktop |
|
722 |
||
723 |
: # those packages have own README.Debian's |
|
724 |
install -m 644 -p debian/README.$(p_base) \ |
|
725 |
$(d_base)/usr/share/doc/$(PVER)/README.Debian |
|
726 |
install -m 644 -p debian/README.$(p_idle) \ |
|
727 |
$(d_idle)/usr/share/doc/$(p_idle)/README.Debian |
|
728 |
ifeq ($(with_tk),yes) |
|
729 |
cp -p debian/README.Tk $(d_tk)/usr/share/doc/$(p_tk)/ |
|
730 |
endif
|
|
731 |
||
732 |
: # The rest goes into $(p_base) |
|
733 |
mkdir -p $(d)/usr/lib/python$(VER)/site-packages |
|
734 |
(cd $(d) && tar cf - .) | (cd $(d_base) && tar xpf -) |
|
735 |
sh debian/dh_rmemptydirs -p$(p_base) |
|
736 |
rm -f $(d_base)/usr/bin/python |
|
737 |
||
9
by Matthias Klose
* Move site customization into sitecustomize.py, don't make site.py |
738 |
: # Install menu icon |
1
by Matthias Klose
- Initial checkin |
739 |
dh_installdirs -p$(p_base) usr/share/pixmaps |
740 |
cp -p debian/pylogo.xpm $(d_base)/usr/share/pixmaps/$(PVER).xpm |
|
741 |
||
742 |
: # generate binfmt file |
|
743 |
mkdir -p $(d_min)/usr/share/binfmts |
|
744 |
$(buildd_static)/python debian/mkbinfmt.py $(PVER) \ |
|
745 |
> $(d_min)/usr/share/binfmts/$(PVER) |
|
746 |
||
747 |
: # desktop entry |
|
748 |
mkdir -p $(d_base)/usr/share/applications |
|
749 |
cp -p debian/$(PVER).desktop \ |
|
750 |
$(d_base)/usr/share/applications/$(PVER).desktop |
|
751 |
||
752 |
: # remove some things |
|
753 |
-find debian -name CVS | xargs rm -rf |
|
754 |
-find debian -name .cvsignore | xargs rm -f |
|
755 |
-find debian -name '*.py[co]' | xargs rm -f |
|
756 |
||
757 |
: # remove empty directories, when all components are in place |
|
758 |
for d in `find debian -depth -type d -empty 2> /dev/null`; do \ |
|
759 |
while rmdir $$d 2> /dev/null; do d=`dirname $$d`; done; \ |
|
760 |
done
|
|
761 |
||
762 |
: # install debug package |
|
763 |
rm -rf $(d)-dbg |
|
764 |
$(MAKE) -C $(buildd_debug) install DESTDIR=$(PWD)/$(d)-dbg |
|
765 |
dh_installdirs -p$(p_dbg) \ |
|
766 |
usr/bin \ |
|
767 |
usr/share/man/man1 \ |
|
768 |
$(scriptdir)/lib-dynload \ |
|
769 |
usr/include/$(PVER)_d \ |
|
770 |
usr/share/doc/$(p_base) |
|
771 |
cp -p Misc/SpecialBuilds.txt $(d_dbg)/usr/share/doc/$(p_base)/ |
|
772 |
cp -p debian/$(PVER)-dbg.README.Debian \ |
|
773 |
$(d_dbg)/usr/share/doc/$(p_base)/README.debug |
|
774 |
cp -p $(buildd_debug)/python $(d_dbg)/usr/bin/$(PVER)-dbg |
|
775 |
sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)-dbg\1,' \ |
|
776 |
$(d)-dbg/usr/bin/$(PVER)-config \ |
|
777 |
> $(d_dbg)/usr/bin/$(PVER)-dbg-config |
|
778 |
chmod 755 $(d_dbg)/usr/bin/$(PVER)-dbg-config |
|
779 |
cp -p $(buildd_debug)/build/lib*/*_d.so \ |
|
780 |
$(d_dbg)/$(scriptdir)/lib-dynload/ |
|
781 |
ifneq ($(with_gdbm),yes) |
|
782 |
rm -f $(d_dbg)/$(scriptdir)/lib-dynload/gdbm_d.so |
|
783 |
rm -f $(d_dbg)/usr/lib/debug/$(scriptdir)/lib-dynload/gdbm.so |
|
784 |
endif
|
|
785 |
ifneq ($(with_tk),yes) |
|
786 |
rm -f $(d_dbg)/$(scriptdir)/lib-dynload/_tkinter_d.so |
|
787 |
rm -f $(d_dbg)/usr/lib/debug/$(scriptdir)/lib-dynload/_tkinter.so |
|
788 |
endif
|
|
789 |
cp -a $(d)-dbg/$(scriptdir)/config_d $(d_dbg)/$(scriptdir)/ |
|
790 |
for i in $(d_dev)/usr/include/$(PVER)/*; do \ |
|
791 |
i=$$(basename $$i); \ |
|
792 |
case $$i in pyconfig.h) continue; esac; \ |
|
793 |
ln -sf ../$(PVER)/$$i $(d_dbg)/usr/include/$(PVER)_d/$$i; \ |
|
794 |
done
|
|
795 |
cp -p $(buildd_debug)/pyconfig.h $(d_dbg)/usr/include/$(PVER)_d/ |
|
796 |
ln -sf $(PVER).1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg.1.gz |
|
797 |
||
798 |
touch stamp-install |
|
799 |
||
800 |
# Build architecture-independent files here.
|
|
801 |
binary-indep: $(install_target) $(build_target) stamp-build-doc stamp-control |
|
802 |
dh_testdir -i |
|
803 |
dh_testroot -i |
|
804 |
||
805 |
ifeq ($(with_doc),yes) |
|
806 |
: # $(p_doc) package |
|
807 |
dh_installdirs -p$(p_doc) \ |
|
808 |
usr/share/doc/$(p_base)/html \ |
|
809 |
usr/share/doc/$(p_doc) \ |
|
810 |
usr/share/info |
|
811 |
dh_installdocs -p$(p_doc) |
|
812 |
cat Doc/html*.tar \ |
|
813 |
| (cd $(d_doc)/usr/share/doc/$(p_base)/html; tar xf -) |
|
814 |
-find $(d_doc)/usr/share/doc/$(p_base)/html ! -type d ! -perm 644 |
|
815 |
-find $(d_doc)/usr/share/doc/$(p_base)/html ! -type d ! -perm 644 \ |
|
816 |
| xargs chmod 644 |
|
817 |
mv $(d_doc)/usr/share/doc/$(p_base)/html/Python-Docs*/* \ |
|
818 |
$(d_doc)/usr/share/doc/$(p_base)/html/. |
|
819 |
rmdir $(d_doc)/usr/share/doc/$(p_base)/html/Python-Docs* |
|
820 |
||
821 |
cp -p Doc/info/*info* \ |
|
822 |
$(d_doc)/usr/share/info/ |
|
823 |
dh_link -p$(p_doc) \ |
|
824 |
/usr/share/doc/$(p_base)/html /usr/share/doc/$(p_doc)/html |
|
825 |
||
826 |
: # devhelp docs |
|
827 |
$(python_for_doc) debian/pyhtml2devhelp.py \ |
|
828 |
$(d_doc)/usr/share/doc/$(p_base)/html index.html \ |
|
829 |
> $(d_doc)/usr/share/doc/$(p_base)/html/$(PVER).devhelp |
|
830 |
gzip -9v $(d_doc)/usr/share/doc/$(p_base)/html/$(PVER).devhelp |
|
831 |
dh_link -p$(p_doc) \ |
|
832 |
/usr/share/doc/$(p_base)/html /usr/share/devhelp/books/$(PVER) |
|
833 |
dh_installinfo -p$(p_doc) --noscripts \ |
|
834 |
Doc/info/*info* |
|
835 |
endif
|
|
836 |
dh_installdebconf -i $(dh_args) |
|
837 |
dh_installexamples -i $(dh_args) |
|
838 |
dh_installmenu -i $(dh_args) |
|
839 |
dh_desktop -i $(dh_args) |
|
840 |
-dh_icons -i $(dh_args) || dh_iconcache -i $(dh_args) |
|
841 |
dh_installchangelogs -i $(dh_args) |
|
842 |
dh_link -i $(dh_args) |
|
843 |
dh_compress -i $(dh_args) -X.py -X.cls -X.css -X.txt -Xgdbinit |
|
844 |
dh_fixperms -i $(dh_args) |
|
845 |
||
846 |
: # make python scripts starting with '#!' executable |
|
847 |
for i in \ |
|
848 |
`find debian -mindepth 2 -type f ! -perm 755`; \ |
|
849 |
do \
|
|
850 |
if head -1 $$i | grep -q '^#!'; then \ |
|
851 |
chmod 755 $$i; \ |
|
852 |
echo "make executable: $$i"; \ |
|
853 |
fi; \ |
|
854 |
done
|
|
855 |
-find $(d_doc) -name '*.txt' -perm 755 -exec chmod 644 {} \; |
|
856 |
||
857 |
dh_installdeb -i $(dh_args) |
|
858 |
dh_gencontrol -i $(dh_args) |
|
859 |
dh_md5sums -i $(dh_args) |
|
860 |
dh_builddeb -i $(dh_args) |
|
861 |
||
862 |
# Build architecture-dependent files here.
|
|
863 |
binary-arch: build install |
|
864 |
dh_testdir -a |
|
865 |
dh_testroot -a |
|
866 |
# dh_installdebconf -a
|
|
867 |
dh_installexamples -a |
|
868 |
dh_installmenu -a |
|
869 |
dh_desktop -a |
|
870 |
-dh_icons -a || dh_iconcache -a |
|
871 |
# dh_installmime -a
|
|
872 |
dh_installchangelogs -a |
|
873 |
for i in $(p_dev) $(p_dbg); do \ |
|
874 |
rm -rf debian/$$i/usr/share/doc/$$i; \ |
|
875 |
ln -s $(p_base) debian/$$i/usr/share/doc/$$i; \ |
|
876 |
done
|
|
877 |
-find debian ! -perm -200 -print -exec chmod +w {} \; |
|
878 |
ifneq ($(with_tk),yes) |
|
879 |
rm -f $(d_base)/$(scriptdir)/lib-dynload/_tkinter.so |
|
880 |
endif
|
|
881 |
ifneq ($(with_gdbm),yes) |
|
882 |
rm -f $(d_base)/$(scriptdir)/lib-dynload/gdbm.so |
|
883 |
endif
|
|
884 |
dh_strip -a -N$(p_dbg) -Xdebug -Xdbg --dbg-package=$(p_dbg) |
|
885 |
dh_link -a |
|
886 |
dh_compress -a -X.py |
|
887 |
dh_fixperms -a |
|
888 |
||
889 |
: # make python scripts starting with '#!' executable |
|
890 |
for i in \ |
|
891 |
`find debian -mindepth 2 -type f ! -perm 755`; \ |
|
892 |
do \
|
|
893 |
if head -1 $$i | grep -q '^#!'; then \ |
|
894 |
chmod 755 $$i; \ |
|
895 |
echo "make executable: $$i"; \ |
|
896 |
fi; \ |
|
897 |
done
|
|
898 |
||
899 |
# dh_makeshlibs -a
|
|
900 |
dh_installdeb -a |
|
901 |
dh_shlibdeps -a |
|
902 |
dh_gencontrol -a |
|
903 |
dh_md5sums -a |
|
904 |
dh_builddeb -a |
|
905 |
||
906 |
# rules to patch the unpacked files in the source directory
|
|
907 |
# ---------------------------------------------------------------------------
|
|
908 |
# various rules to unpack addons and (un)apply patches.
|
|
909 |
# - patch / apply-patches
|
|
910 |
# - unpatch / reverse-patches
|
|
911 |
||
912 |
patchdir = debian/patches |
|
913 |
||
914 |
debian_doc_patches = \ |
|
915 |
doc-faq \ |
|
916 |
profile-doc \ |
|
917 |
||
9
by Matthias Klose
* Move site customization into sitecustomize.py, don't make site.py |
918 |
# svn-updates \
|
919 |
||
1
by Matthias Klose
- Initial checkin |
920 |
# which patches should be applied?
|
921 |
debian_patches = \ |
|
922 |
deb-setup \ |
|
923 |
deb-locations \ |
|
924 |
locale-module \ |
|
925 |
distutils-link \ |
|
926 |
test-sundry \ |
|
927 |
tkinter-import \ |
|
928 |
link-opt \ |
|
929 |
egg-info-no-version \ |
|
930 |
debug-build \ |
|
931 |
hotshot-import \ |
|
932 |
subprocess-eintr-safety \ |
|
933 |
webbrowser \
|
|
934 |
linecache \
|
|
935 |
CVE-2007-4965 \ |
|
936 |
hurd-broken-poll \ |
|
12
by Matthias Klose
* Move site.py to python2.4-minimal, remove `addbuilddir' from site.py, |
937 |
issue961805 \
|
1
by Matthias Klose
- Initial checkin |
938 |
|
939 |
# pydebug-path \
|
|
940 |
||
941 |
ifeq ($(with_fpectl),yes) |
|
942 |
debian_patches += \ |
|
943 |
enable-fpectl |
|
944 |
endif
|
|
945 |
||
946 |
ifeq ($(DEB_BUILD_ARCH),arm) |
|
947 |
debian_patches += arm-float |
|
948 |
endif
|
|
949 |
||
950 |
# svn-updates \
|
|
951 |
# patchlevel \
|
|
952 |
# distutils-debian \
|
|
953 |
# html-docs \
|
|
954 |
# patchlevel \
|
|
955 |
||
956 |
glibc_version := $(shell dpkg -s locales | awk '/^Version:/ {print $$2}') |
|
957 |
broken_utimes := $(shell dpkg --compare-versions $(glibc_version) lt 2.3.5 && echo yes || echo no) |
|
958 |
ifeq ($(broken_utimes),yes) |
|
959 |
debian_patches += \ |
|
960 |
disable-utimes |
|
961 |
endif
|
|
962 |
||
963 |
ifeq ($(distribution),Ubuntu) |
|
964 |
debian_patches += \ |
|
965 |
langpack-gettext |
|
966 |
endif
|
|
967 |
||
968 |
ifeq ($(DEB_BUILD_ARCH_OS),hurd) |
|
969 |
debian_patches += \ |
|
970 |
no-large-file-support \ |
|
971 |
cthreads
|
|
972 |
endif
|
|
973 |
||
974 |
ifneq (,$(findstring -doc, $(PKGSOURCE))) |
|
975 |
debian_patches := $(debian_doc_patches) |
|
976 |
else
|
|
977 |
debian_patches += $(debian_doc_patches) |
|
978 |
endif
|
|
979 |
||
980 |
patch: patch-stamp |
|
981 |
apply-patches: patch-stamp |
|
982 |
||
983 |
patch-stamp: $(foreach p,$(debian_patches),patch-stamp-$(p)) |
|
984 |
echo ""; echo "Patches applied in this version:" > pxxx |
|
985 |
for i in $(debian_patches); do \ |
|
986 |
echo "" >> pxxx; echo "$$i:" >> pxxx; \ |
|
987 |
sed -n 's/^# *DP: */ /p' $(patchdir)/$$i.dpatch >> pxxx; \ |
|
988 |
done
|
|
989 |
mv -f pxxx $@ |
|
990 |
||
991 |
reverse-patches: unpatch |
|
992 |
unpatch: |
|
993 |
for stamp in none `ls -1t patch-stamp-* 2>/dev/null`; do \ |
|
994 |
case "$$stamp" in none|patched-stamp|patched-\*) continue; esac; \ |
|
995 |
patch=`echo $$stamp | sed -e 's,patch-stamp-,,'`; \ |
|
996 |
echo "trying to revert patch $$patch ..."; \ |
|
997 |
if [ -x $(patchdir)/$$patch.dpatch ]; then true; else \ |
|
998 |
chmod +x $(patchdir)/$$patch.dpatch; fi; \ |
|
999 |
if $(patchdir)/$$patch.dpatch -unpatch; then \ |
|
1000 |
echo "reverted $$patch patch."; \ |
|
1001 |
rm -f $$stamp; \ |
|
1002 |
else \
|
|
1003 |
echo "error in reverting $$patch patch."; \ |
|
1004 |
exit 1; \ |
|
1005 |
fi; \ |
|
1006 |
done
|
|
1007 |
rm -f patch-stamp |
|
1008 |
||
1009 |
patch-stamp-%: $(patchdir)/%.dpatch |
|
1010 |
if [ -x $< ]; then true; else chmod +x $<; fi |
|
1011 |
if [ -f $@ ]; then \ |
|
1012 |
echo "$* patches already applied."; exit 1; \ |
|
1013 |
fi
|
|
1014 |
$< -patch |
|
1015 |
echo "$* patches applied." > $@ |
|
1016 |
autoreconf -i |
|
1017 |
||
1018 |
binary: binary-indep binary-arch |
|
1019 |
||
1020 |
.PHONY: control-file configure build clean binary-indep binary-arch binary install |
|
1021 |
||
1022 |
# Local Variables:
|
|
1023 |
# mode: makefile
|
|
1024 |
# end:
|