]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/make -f | |
2 | # debian/rules file to build packages from wx CVS source | |
3 | # | |
4 | # Sculpted 13/2/2000 by Ron Lee <ron@debian.org> from new and | |
5 | # variously stolen code :-) | |
6 | # It makes copious use of the debhelper utilities written by | |
7 | # Joey Hess and others. | |
8 | ||
9 | #export DH_VERBOSE=1 | |
10 | export DH_OPTIONS | |
11 | ||
12 | ifdef DISTCC_HOSTS | |
13 | ||
14 | #JOB_COUNT := $(shell set $${DISTCC_HOSTS} > /dev/null 2>&1 ; echo $$(($$\# + $$\#))) | |
15 | # Nearly as fast, but doesn't raise the room temperature | |
16 | # or saturate the build machines quite so much. | |
17 | JOB_COUNT := $(shell set $${DISTCC_HOSTS} > /dev/null 2>&1 ; echo $$\#) | |
18 | FAST_MAKE = $(MAKE) -j $(JOB_COUNT) | |
19 | ||
20 | else | |
21 | ||
22 | FAST_MAKE = $(MAKE) | |
23 | ||
24 | endif | |
25 | ||
26 | -include debian/python-version | |
27 | ||
28 | ||
29 | # This will extract a flavour out of the name of the source directory | |
30 | # and flavour the packages and binaries with it. 'Official' builds | |
31 | # should use a source dir of the form wxwidgets$RELEASE-$VERSION. | |
32 | # Flavoured builds may use wxwidgets$RELEASE-$FLAVOUR-$VERSION, where | |
33 | # any descriptive alphanumeric name will do for FLAVOUR. This will | |
34 | # allow a custom build to be installed alongside the mainline ones | |
35 | # without conflict. You will also need to make a corresponding | |
36 | # changelog entry for your flavour source package using: | |
37 | # wxwidget$RELEASE-$FLAVOUR ($VERSION) to satify dpkg-source and | |
38 | # to correctly set the release below. | |
39 | DEBIAN_WXFLAVOUR := $(shell pwd | sed -e 's@.*/wxwidgets[0-9.]\+-\?\(.*\)-[0-9.]\+-\?.*@\1@') | |
40 | ||
41 | release := $(shell dpkg-parsechangelog | sed -n 's/^Source: wxwidgets//p') | |
42 | soversion := $(shell grep '^WX_CURRENT=' configure.in | sed 's/WX_CURRENT=\([0-9]\+\).*/\1/') | |
43 | sorelease := $(release:%-$(DEBIAN_WXFLAVOUR)=%).$(soversion)$(addprefix -,$(DEBIAN_WXFLAVOUR)) | |
44 | ||
45 | pydir := usr/lib/$(python_ver)/site-packages | |
46 | wxpydir := $(pydir)/wx-$(sorelease)-gtk2-unicode | |
47 | ||
48 | cross_host = i586-mingw32msvc | |
49 | cross_build = $(shell ./config.guess) | |
50 | ||
51 | config_cache = ../config_deb.cache | |
52 | config_cache_cross = ../config_deb_cross.cache | |
53 | ||
54 | # Packages to build: | |
55 | package_gtk_lib = libwxgtk$(sorelease) | |
56 | package_gtk_dev = libwxgtk$(release)-dev | |
57 | package_gtk_dbg = libwxgtk$(release)-dbg | |
58 | package_gtk_py_lib = libwxgtk$(sorelease)-python | |
59 | package_gtk_py = wxpython$(sorelease) | |
60 | package_common = wx$(release)-common | |
61 | package_headers = wx$(release)-headers | |
62 | package_i18n = wx$(release)-i18n | |
63 | package_doc = wx$(release)-doc | |
64 | package_examples = wx$(release)-examples | |
65 | ||
66 | package_gtk_dbg_py = libwxgtk$(sorelease)-dbg-python | |
67 | package_msw_dev = libwxmsw$(release)-dev | |
68 | package_msw_dbg = libwxmsw$(release)-dbg | |
69 | package_headers_msw = wx$(release)-headers-msw | |
70 | ||
71 | # Build directories: | |
72 | objdir_gtk_shared = objs_gtk_sh | |
73 | objdir_gtk_static = objs_gtk_st | |
74 | objdir_gtk_debug = objs_gtk_d | |
75 | objdir_gtk_install = objs_gtk_install | |
76 | objdir_doc_cruft = objs_doc_con | |
77 | objdir_doc = docs/wx-manual.html | |
78 | objdir_examples = docs/examples | |
79 | objdir_i18n = locale | |
80 | ||
81 | objdir_msw_shared = objs_msw_sh | |
82 | objdir_msw_static = objs_msw_st | |
83 | objdir_msw_dbg = objs_msw_d | |
84 | objdir_msw_install = objs_msw_install | |
85 | ||
86 | objdirs = $(objdir_gtk_shared) $(objdir_gtk_static) $(objdir_gtk_debug) \ | |
87 | $(objdir_gtk_install) \ | |
88 | $(objdir_doc_cruft) $(objdir_doc) $(objdir_examples) \ | |
89 | $(objdir_msw_shared) $(objdir_msw_static) $(objdir_msw_dbg) \ | |
90 | $(objdir_msw_install) | |
91 | ||
92 | # note that the i18n package is actually arch indep (once built) | |
93 | # but must be built (and installed) during the arch any phase as | |
94 | # it's pulled out of the wxGTK shared lib package. | |
95 | ||
96 | ||
97 | # Build stamps: | |
98 | build_arch_stamps = build-gtk-shared-stamp build-gtk-shared-contrib-stamp \ | |
99 | build-gtk-static-stamp build-gtk-static-contrib-stamp \ | |
100 | build-gtk-debug-stamp build-gtk-debug-contrib-stamp \ | |
101 | build-i18n-stamp build-gtk-py-stamp | |
102 | ||
103 | ||
104 | build_indep_stamps = build-examples-stamp build-doc-stamp | |
105 | ||
106 | build_cross_stamps = build-msw-shared-stamp build-msw-static-stamp build-msw-dbg-stamp | |
107 | ||
108 | build_stamps_native = $(build_arch_stamps) $(build_indep_stamps) | |
109 | ||
110 | build_stamps = $(build_stamps_native) $(build_cross_stamps) | |
111 | ||
112 | ||
113 | # Install targets: | |
114 | install_all_arch = install-gtk-lib install-gtk-dev install-gtk-dbg \ | |
115 | install-common install-headers install-i18n \ | |
116 | install-gtk-py | |
117 | ||
118 | install_all_indep = install-examples install-doc | |
119 | ||
120 | install_all_cross = install-msw-dev install-msw-dbg install-headers-msw | |
121 | ||
122 | install_all_native = $(install_all_arch) $(install_all_indep) | |
123 | ||
124 | install_all = $(install_all_native) $(install_all_cross) | |
125 | ||
126 | ||
127 | wxconfig := $(shell pwd)/$(objdir_gtk_shared)/wx-config --no_rpath | |
128 | wxconfig-dbg := $(shell pwd)/$(objdir_gtk_debug)/wx-config --no_rpath | |
129 | ||
130 | #contrib_libs := $(subst CVS,,$(notdir $(wildcard contrib/include/wx/*))) | |
131 | ||
132 | ||
133 | # The Rules: | |
134 | ||
135 | debian/python-version: | |
136 | echo python_ver := python$(shell python -c "import sys;print sys.version[:3]") > $@ | |
137 | ||
138 | debian/control: $(addprefix debian/,control.in python-version) | |
139 | sed -e 's/=V/$(release)/g;s/=SOV/$(sorelease)/g;s/=PY/$(python_ver)/g' \ | |
140 | < debian/control.in > debian/control | |
141 | ||
142 | control-files-stamp: debian/control | |
143 | dh_testdir | |
144 | @for f in postinst prerm; do \ | |
145 | echo "generating control file $(package_gtk_dev).$$f"; \ | |
146 | sed -e 's/=V/$(release)/g' < debian/libwxgtk-dev.$$f \ | |
147 | > debian/$(package_gtk_dev).$$f; \ | |
148 | done; | |
149 | @for f in postinst prerm; do \ | |
150 | echo "generating control file $(package_gtk_dbg).$$f"; \ | |
151 | sed -e 's/=V/$(release)/g' < debian/libwxgtk-dbg.$$f \ | |
152 | > debian/$(package_gtk_dbg).$$f; \ | |
153 | done; | |
154 | @for f in docs postinst prerm; do \ | |
155 | echo "generating control file $(package_gtk_py_lib).$$f"; \ | |
156 | sed -e 's/=PY/$(python_ver)/g; \ | |
157 | s|=WXPYDIR|$(wxpydir)|g; \ | |
158 | s/=V/$(release)/g; \ | |
159 | s/=SOV/$(sorelease)/g' \ | |
160 | < debian/libwxgtk-python.$$f \ | |
161 | > debian/$(package_gtk_py_lib).$$f; \ | |
162 | done; | |
163 | @echo "generating control file $(package_gtk_py).menu"; \ | |
164 | sed -e 's/=SOV/$(sorelease)/g' < debian/wxpython.menu \ | |
165 | > debian/$(package_gtk_py).menu; | |
166 | @for f in docs postinst; do \ | |
167 | echo "generating control file $(package_gtk_dbg_py).$$f"; \ | |
168 | sed -e 's/=PY/$(python_ver)/g;s/=V/$(release)/g;s/=SOV/$(sorelease)/g' \ | |
169 | < debian/libwxgtk-python.$$f \ | |
170 | > debian/$(package_gtk_dbg_py).$$f; \ | |
171 | done; | |
172 | @echo "generating control file $(package_gtk_dbg_py).prerm"; \ | |
173 | sed 's/=SOV/$(sorelease)/g' < debian/libwxgtk-dbg-python.prerm \ | |
174 | > debian/$(package_gtk_dbg_py).prerm | |
175 | @for f in docs doc-base; do \ | |
176 | echo "generating control file $(package_doc).$$f"; \ | |
177 | sed -e 's/=V/$(release)/g' < debian/wx-doc.$$f \ | |
178 | > debian/$(package_doc).$$f; \ | |
179 | done; | |
180 | @for f in examples; do \ | |
181 | echo "generating control file $(package_examples).$$f"; \ | |
182 | cp debian/wx-examples.$$f debian/$(package_examples).$$f; \ | |
183 | done; | |
184 | @for f in postinst prerm; do \ | |
185 | echo "generating control file $(package_msw_dev).$$f"; \ | |
186 | sed -e 's/=V/$(release)/g;s/=H/$(cross_host)/g' < debian/libwxmsw-dev.$$f \ | |
187 | > debian/$(package_msw_dev).$$f; \ | |
188 | done; | |
189 | @for f in postinst prerm; do \ | |
190 | echo "generating control file $(package_msw_dbg).$$f"; \ | |
191 | sed -e 's/=V/$(release)/g;s/=H/$(cross_host)/g' < debian/libwxmsw-dbg.$$f \ | |
192 | > debian/$(package_msw_dbg).$$f; \ | |
193 | done; | |
194 | # @echo "generating control file $(package_common).menu"; \ | |
195 | # sed -e 's/=V/$(release)/g' < debian/wx-common.menu \ | |
196 | # > debian/$(package_common).menu; | |
197 | @echo "generating control file lintian-override"; \ | |
198 | sed -e 's/=V/$(release)/g' < debian/lintian-override.in \ | |
199 | > debian/lintian-override; \ | |
200 | touch $@ | |
201 | ||
202 | build_arch: control-files-stamp $(build_arch_stamps) | |
203 | build_all: control-files-stamp $(build_stamps_native) | |
204 | ||
205 | # Really we should probably do nothing here until we know which | |
206 | # binary target is being called, but alpha builds were exploding | |
207 | # (compiler segfaults) in random places when building under fakeroot | |
208 | # from the binary-arch target. Build all -arch files here then, and | |
209 | # let the -indep stuff fend for itself later. | |
210 | ||
211 | build: build_arch | |
212 | ||
213 | ||
214 | configure-gtk-shared-stamp: | |
215 | dh_testdir | |
216 | mkdir -p $(objdir_gtk_shared) | |
217 | cd $(objdir_gtk_shared) \ | |
218 | && ../configure --prefix=/usr \ | |
219 | --cache-file=$(config_cache) \ | |
220 | --with-flavour=$(DEBIAN_WXFLAVOUR) \ | |
221 | --with-gtk \ | |
222 | --enable-unicode \ | |
223 | --with-opengl \ | |
224 | --with-zlib=sys \ | |
225 | --with-libjpeg=sys \ | |
226 | --with-libpng=sys \ | |
227 | --with-libtiff=sys \ | |
228 | --with-gnomeprint \ | |
229 | --enable-dynamic-loader \ | |
230 | --enable-std_iostreams | |
231 | touch $@ | |
232 | ||
233 | build-gtk-shared-stamp: configure-gtk-shared-stamp | |
234 | dh_testdir | |
235 | cd $(objdir_gtk_shared) && $(FAST_MAKE) | |
236 | touch $@ | |
237 | ||
238 | configure-gtk-static-stamp: | |
239 | dh_testdir | |
240 | mkdir -p $(objdir_gtk_static) | |
241 | cd $(objdir_gtk_static) \ | |
242 | && ../configure --prefix=/usr \ | |
243 | --cache-file=$(config_cache) \ | |
244 | --with-flavour=$(DEBIAN_WXFLAVOUR) \ | |
245 | --with-gtk \ | |
246 | --enable-unicode \ | |
247 | --with-opengl \ | |
248 | --disable-shared \ | |
249 | --with-zlib=sys \ | |
250 | --with-libjpeg=sys \ | |
251 | --with-libpng=sys \ | |
252 | --with-libtiff=sys \ | |
253 | --with-gnomeprint \ | |
254 | --enable-dynamic-loader \ | |
255 | --enable-std_iostreams | |
256 | touch $@ | |
257 | ||
258 | build-gtk-static-stamp: configure-gtk-static-stamp | |
259 | dh_testdir | |
260 | cd $(objdir_gtk_static) && $(FAST_MAKE) | |
261 | touch $@ | |
262 | ||
263 | configure-gtk-debug-stamp: | |
264 | dh_testdir | |
265 | mkdir -p $(objdir_gtk_debug) | |
266 | cd $(objdir_gtk_debug) \ | |
267 | && ../configure --prefix=/usr \ | |
268 | --cache-file=$(config_cache) \ | |
269 | --with-flavour=$(DEBIAN_WXFLAVOUR) \ | |
270 | --with-gtk \ | |
271 | --enable-unicode \ | |
272 | --with-opengl \ | |
273 | --enable-debug \ | |
274 | --with-zlib=sys \ | |
275 | --with-libjpeg=sys \ | |
276 | --with-libpng=sys \ | |
277 | --with-libtiff=sys \ | |
278 | --with-gnomeprint \ | |
279 | --enable-dynamic-loader \ | |
280 | --enable-std_iostreams | |
281 | touch $@ | |
282 | ||
283 | build-gtk-debug-stamp: configure-gtk-debug-stamp | |
284 | dh_testdir | |
285 | cd $(objdir_gtk_debug) && $(FAST_MAKE) | |
286 | touch $@ | |
287 | ||
288 | ||
289 | build-gtk-shared-contrib-stamp: build-gtk-shared-stamp | |
290 | dh_testdir | |
291 | cd $(objdir_gtk_shared)/contrib/src && $(FAST_MAKE) | |
292 | cd $(objdir_gtk_shared)/utils/wxrc && $(FAST_MAKE) | |
293 | #cd $(objdir_gtk_shared)/contrib/utils/wxrcedit && $(FAST_MAKE) | |
294 | touch $@ | |
295 | ||
296 | build-gtk-static-contrib-stamp: build-gtk-static-stamp | |
297 | dh_testdir | |
298 | cd $(objdir_gtk_static)/contrib/src && $(FAST_MAKE) | |
299 | touch $@ | |
300 | ||
301 | build-gtk-debug-contrib-stamp: build-gtk-debug-stamp | |
302 | dh_testdir | |
303 | cd $(objdir_gtk_debug)/contrib/src && $(FAST_MAKE) | |
304 | touch $@ | |
305 | ||
306 | ||
307 | purge-dbg-py: | |
308 | @if [ ! -e build-gtk-py-stamp ]; then \ | |
309 | $(MAKE) -f debian/rules clean-py; \ | |
310 | fi | |
311 | $(RM) build-gtk-dbg-py-stamp | |
312 | ||
313 | build-gtk-py-stamp: build-gtk-shared-stamp purge-dbg-py | |
314 | dh_testdir | |
315 | touch docs/lgpl.txt | |
316 | cd wxPython \ | |
317 | && $(python_ver) ./setup.py build \ | |
318 | WX_CONFIG='$(wxconfig)' \ | |
319 | WXPORT=gtk2 \ | |
320 | UNICODE=1 \ | |
321 | FLAVOUR=$(DEBIAN_WXFLAVOUR) | |
322 | touch $@ | |
323 | ||
324 | build-doc-stamp: build-gtk-shared-stamp | |
325 | dh_testdir | |
326 | cd $(objdir_gtk_shared)/utils/tex2rtf/src && $(FAST_MAKE) | |
327 | rm -rf $(objdir_doc) | |
328 | rm -rf $(objdir_doc_cruft) | |
329 | mkdir $(objdir_doc) | |
330 | mkdir $(objdir_doc_cruft) | |
331 | cd $(objdir_doc_cruft) \ | |
332 | && LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib:$(LD_LIBRARY_PATH) \ | |
333 | ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \ | |
334 | ../docs/latex/wx/manual.tex \ | |
335 | ../$(objdir_doc)/wx$(release)-manual.html \ | |
336 | -twice -html | |
337 | cp docs/latex/wx/*.gif $(objdir_doc) | |
338 | rm -rf $(objdir_doc_cruft) | |
339 | rm -f $(objdir_doc)/wx$(release)-manual.{con,hh*,htx,ref} | |
340 | touch $@ | |
341 | ||
342 | build-examples-stamp: build-gtk-shared-stamp | |
343 | dh_testdir | |
344 | mkdir -p $(objdir_examples) | |
345 | ||
346 | # copy all samples and the Makefile generated for libwxgtk. | |
347 | cp -a samples $(objdir_examples) | |
348 | rm -f $(objdir_examples)/samples/Makefile | |
349 | cp -a $(objdir_gtk_shared)/samples/Makefile $(objdir_examples)/samples | |
350 | ||
351 | cd $(objdir_examples)/samples \ | |
352 | && find -name 'Makefile.in' -exec rm -f '{}' ';' \ | |
353 | && for d in $$(find -type d); do \ | |
354 | if [ -f $$d/makefile.unx ]; then \ | |
355 | mv $$d/makefile.unx $$d/Makefile; \ | |
356 | fi; \ | |
357 | done \ | |
358 | ||
359 | cp -a wxPython/demo $(objdir_examples)/wxPython | |
360 | ||
361 | touch $@ | |
362 | ||
363 | build-i18n-stamp: build-gtk-shared-stamp | |
364 | dh_testdir | |
365 | ||
366 | # touch .po files first, since if they are not already up | |
367 | # to date then _now_ is not the time to fix it. | |
368 | # That should have been been done before cvs was tagged. | |
369 | cd $(objdir_i18n) \ | |
370 | && touch *.po \ | |
371 | && $(MAKE) allmo | |
372 | touch $@ | |
373 | ||
374 | purge-release-py: | |
375 | @if [ ! -e build-gtk-dbg-py-stamp ]; then \ | |
376 | $(MAKE) -f debian/rules clean-py; \ | |
377 | fi | |
378 | $(RM) build-gtk-py-stamp | |
379 | ||
380 | build-gtk-dbg-py-stamp: build-gtk-debug-stamp purge-release-py | |
381 | dh_testdir | |
382 | touch docs/lgpl.txt | |
383 | cd wxPython \ | |
384 | && $(python_ver) ./setup.py build \ | |
385 | WX_CONFIG='$(wxconfig-dbg)' \ | |
386 | WXPORT=gtk2 \ | |
387 | UNICODE=1 \ | |
388 | FLAVOUR=$(addsuffix -,$(DEBIAN_WXFLAVOUR))dbg | |
389 | touch $@ | |
390 | ||
391 | ||
392 | configure-msw-shared-stamp: | |
393 | dh_testdir | |
394 | mkdir -p $(objdir_msw_shared) | |
395 | cd $(objdir_msw_shared) \ | |
396 | && ../configure --prefix=/usr/$(cross_host) \ | |
397 | --cache-file=$(config_cache_cross) \ | |
398 | --host=$(cross_host) \ | |
399 | --build=$(cross_build) \ | |
400 | --with-flavour=$(DEBIAN_WXFLAVOUR) | |
401 | touch $@ | |
402 | ||
403 | build-msw-shared-stamp: configure-msw-shared-stamp | |
404 | dh_testdir | |
405 | cd $(objdir_msw_shared) && $(FAST_MAKE) | |
406 | touch $@ | |
407 | ||
408 | configure-msw-static-stamp: | |
409 | dh_testdir | |
410 | mkdir -p $(objdir_msw_static) | |
411 | cd $(objdir_msw_static) \ | |
412 | && ../configure --prefix=/usr/$(cross_host) \ | |
413 | --cache-file=$(config_cache_cross) \ | |
414 | --host=$(cross_host) \ | |
415 | --build=$(cross_build) \ | |
416 | --with-flavour=$(DEBIAN_WXFLAVOUR) \ | |
417 | --disable-shared | |
418 | touch $@ | |
419 | ||
420 | build-msw-static-stamp: configure-msw-static-stamp | |
421 | dh_testdir | |
422 | cd $(objdir_msw_static) && $(FAST_MAKE) | |
423 | touch $@ | |
424 | ||
425 | configure-msw-dbg-stamp: | |
426 | dh_testdir | |
427 | mkdir -p $(objdir_msw_dbg) | |
428 | cd $(objdir_msw_dbg) \ | |
429 | && ../configure --prefix=/usr/$(cross_host) \ | |
430 | --cache-file=$(config_cache_cross) \ | |
431 | --host=$(cross_host) \ | |
432 | --build=$(cross_build) \ | |
433 | --with-flavour=$(DEBIAN_WXFLAVOUR) \ | |
434 | --enable-debug | |
435 | touch $@ | |
436 | ||
437 | build-msw-dbg-stamp: configure-msw-dbg-stamp | |
438 | dh_testdir | |
439 | cd $(objdir_msw_dbg) && $(FAST_MAKE) | |
440 | touch $@ | |
441 | ||
442 | ||
443 | clean-py: | |
444 | cd wxPython && rm -rf licence build* docs/xml-raw wx/*.py | |
445 | ||
446 | # What to do about src/__version__.py ??? | |
447 | ||
448 | ||
449 | # We do the equivalent of this above by removing build, unfortunately | |
450 | # its not enough by itself to get the tree properly clean again. | |
451 | # && ./setup.py clean | |
452 | ||
453 | clean: debian/control clean-py | |
454 | dh_testdir | |
455 | dh_testroot | |
456 | ||
457 | rm -rf config_deb.cache config_deb_cross.cache *-stamp $(objdirs) | |
458 | rm -f docs/lgpl.txt | |
459 | rm -f $(objdir_i18n)/*.mo | |
460 | ||
461 | dh_clean | |
462 | rm -f debian/$(package_gtk_lib).* | |
463 | rm -f debian/$(package_gtk_dev).* | |
464 | rm -f debian/$(package_gtk_dbg).* | |
465 | rm -f debian/$(package_gtk_py_lib).* | |
466 | rm -f debian/$(package_gtk_py).* | |
467 | rm -f debian/$(package_common).* | |
468 | rm -f debian/$(package_headers).* | |
469 | rm -f debian/$(package_i18n).* | |
470 | rm -f debian/$(package_doc).* | |
471 | rm -f debian/$(package_examples).* | |
472 | rm -f debian/$(package_gtk_dbg_py).* | |
473 | rm -f debian/$(package_msw_dev).* | |
474 | rm -f debian/$(package_msw_dbg).* | |
475 | rm -f debian/lintian-override | |
476 | ||
477 | install_arch: build_arch $(install_all_arch) | |
478 | ||
479 | install: build_all $(install_all_native) | |
480 | ||
481 | install-gtk-shared-stamp: build-gtk-shared-stamp build-gtk-shared-contrib-stamp | |
482 | dh_testdir | |
483 | mkdir -p $(objdir_gtk_install) | |
484 | cd $(objdir_gtk_shared) \ | |
485 | && $(MAKE) install prefix=`pwd`/../$(objdir_gtk_install) | |
486 | cd $(objdir_gtk_shared)/contrib/src \ | |
487 | && $(MAKE) install prefix=`pwd`/../../../$(objdir_gtk_install) | |
488 | touch $@ | |
489 | ||
490 | install-gtk-lib: DH_OPTIONS=-p$(package_gtk_lib) | |
491 | install-gtk-lib: install-gtk-shared-stamp | |
492 | dh_testdir | |
493 | dh_testroot | |
494 | dh_clean -k | |
495 | dh_installdirs | |
496 | dh_install $(objdir_gtk_install)/lib/libwx_*.so.* usr/lib | |
497 | ||
498 | install-gtk-dev: DH_OPTIONS=-p$(package_gtk_dev) | |
499 | install-gtk-dev: build-gtk-static-stamp build-gtk-static-contrib-stamp install-gtk-shared-stamp | |
500 | dh_testdir | |
501 | dh_testroot | |
502 | dh_clean -k | |
503 | dh_installdirs | |
504 | dh_install $(objdir_gtk_install)/lib/libwx_*.so usr/lib | |
505 | dh_install $(objdir_gtk_install)/lib/wx/include usr/lib/wx | |
506 | dh_install $(objdir_gtk_install)/lib/wx/config/gtk* usr/lib/wx/config | |
507 | dh_install $(objdir_gtk_static)/lib/libwx*.a usr/lib | |
508 | dh_install $(objdir_gtk_static)/lib/wx/include usr/lib/wx | |
509 | dh_install $(objdir_gtk_static)/lib/wx/config/gtk* usr/lib/wx/config | |
510 | ||
511 | install-gtk-dbg: DH_OPTIONS=-p$(package_gtk_dbg) | |
512 | install-gtk-dbg: build-gtk-debug-stamp build-gtk-debug-contrib-stamp | |
513 | dh_testdir | |
514 | dh_testroot | |
515 | dh_clean -k | |
516 | dh_installdirs usr/share/lintian/overrides | |
517 | dh_install $(objdir_gtk_debug)/lib/libwx_* usr/lib | |
518 | dh_install $(objdir_gtk_debug)/lib/wx/include usr/lib/wx | |
519 | dh_install $(objdir_gtk_debug)/lib/wx/config/gtk* usr/lib/wx/config | |
520 | cp debian/lintian-override debian/$(package_gtk_dbg)/usr/share/lintian/overrides/$(package_gtk_dbg) | |
521 | ||
522 | ||
523 | install-gtk-py-lib: DH_OPTIONS=-p$(package_gtk_py_lib) | |
524 | install-gtk-py-lib: build-gtk-py-stamp | |
525 | dh_testdir | |
526 | dh_testroot | |
527 | dh_clean -k | |
528 | dh_installdirs | |
529 | cd wxPython \ | |
530 | && $(python_ver) ./setup.py install \ | |
531 | --prefix=`pwd`/../debian/$(package_gtk_py_lib)/usr \ | |
532 | WX_CONFIG='$(wxconfig)' \ | |
533 | WXPORT=gtk2 \ | |
534 | UNICODE=1 \ | |
535 | FLAVOUR=$(DEBIAN_WXFLAVOUR) | |
536 | ||
537 | find debian/$(package_gtk_py_lib)/$(pydir) -name '*.py?' -exec rm '{}' ';' | |
538 | ||
539 | # This is rather bogus, its included in the main copyright file now though. | |
540 | rm -f debian/$(package_gtk_py_lib)/$(wxpydir)/wx/tools/XRCed/license.txt | |
541 | ||
542 | install-gtk-py: DH_OPTIONS=-p$(package_gtk_py) | |
543 | install-gtk-py: install-gtk-py-lib | |
544 | dh_testdir | |
545 | dh_testroot | |
546 | dh_clean -k | |
547 | dh_installdirs | |
548 | ||
549 | dh_movefiles --sourcedir=debian/$(package_gtk_py_lib) \ | |
550 | usr/bin \ | |
551 | $(pydir)/{wxversion.py,wx.pth} | |
552 | rm -r debian/$(package_gtk_py_lib)/usr/bin | |
553 | ||
554 | dh_installman debian/wxPython-tools.1 | |
555 | dh_link usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2py.1 \ | |
556 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2xpm.1 \ | |
557 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2png.1 \ | |
558 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pycrust.1 \ | |
559 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyshell.1 \ | |
560 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/xrced.1 \ | |
561 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/helpviewer.1 \ | |
562 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyalacarte.1 \ | |
563 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyalamode.1 \ | |
564 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pywrap.1 \ | |
565 | usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pywxrc.1 | |
566 | ||
567 | ||
568 | install-common: DH_OPTIONS=-p$(package_common) | |
569 | install-common: install-gtk-shared-stamp | |
570 | dh_testdir | |
571 | dh_testroot | |
572 | dh_clean -k | |
573 | dh_installdirs | |
574 | ||
575 | dh_install $(objdir_gtk_install)/share/aclocal usr/share | |
576 | dh_installman debian/wx-config.1 | |
577 | ||
578 | dh_install $(objdir_gtk_shared)/utils/wxrc/wxrc usr/bin | |
579 | # dh_install $(objdir_gtk_shared)/contrib/utils/wxrcedit/wxrcedit usr/bin | |
580 | ||
581 | dh_installman debian/wxrc-tools.1 | |
582 | dh_link usr/share/man/man1/wxrc-tools.1 usr/share/man/man1/wxrc.1 | |
583 | # dh_link usr/share/man/man1/wxrc-tools.1 usr/share/man/man1/wxrcedit.1 | |
584 | ||
585 | ||
586 | install-headers: DH_OPTIONS=-p$(package_headers) | |
587 | install-headers: install-gtk-shared-stamp | |
588 | dh_testdir | |
589 | dh_testroot | |
590 | dh_clean -k | |
591 | dh_installdirs | |
592 | ||
593 | # The only way to be really sure we get the univ headers correct is to install | |
594 | # them. Do that in a scratch dirs, and move the gtk ones last, so at least | |
595 | # they win in the result of any uncaught conflict. | |
596 | ||
597 | # cd $(objdir_gtk_univ) \ | |
598 | # && $(MAKE) install prefix=`pwd`/../$(objdir_univ_install)/usr | |
599 | ||
600 | # dh_movefiles --sourcedir=$(objdir_univ_install) | |
601 | dh_install $(objdir_gtk_install)/include usr | |
602 | ||
603 | install-i18n: DH_OPTIONS=-p$(package_i18n) | |
604 | install-i18n: build-i18n-stamp install-gtk-shared-stamp | |
605 | dh_testdir | |
606 | dh_testroot | |
607 | dh_clean -k | |
608 | dh_installdirs | |
609 | dh_install $(objdir_gtk_install)/share/locale usr/share | |
610 | ||
611 | install-doc: DH_OPTIONS=-p$(package_doc) | |
612 | install-doc: build-doc-stamp | |
613 | dh_testdir | |
614 | dh_testroot | |
615 | dh_clean -k | |
616 | dh_installdirs | |
617 | ||
618 | install-examples: DH_OPTIONS=-p$(package_examples) | |
619 | install-examples: build-examples-stamp | |
620 | dh_testdir | |
621 | dh_testroot | |
622 | dh_clean -k | |
623 | dh_installdirs | |
624 | ||
625 | install-gtk-dbg-py: DH_OPTIONS=-p$(package_gtk_dbg_py) | |
626 | install-gtk-dbg-py: build-gtk-dbg-py-stamp | |
627 | dh_testdir | |
628 | dh_testroot | |
629 | dh_clean -k | |
630 | dh_installdirs | |
631 | cd wxPython \ | |
632 | && $(python_ver) ./setup.py install \ | |
633 | --prefix=`pwd`/../debian/$(package_gtk_dbg_py)/usr \ | |
634 | WX_CONFIG='$(wxconfig-dbg)' \ | |
635 | WXPORT=gtk2 \ | |
636 | UNICODE=1 \ | |
637 | FLAVOUR=$(addsuffix -,$(DEBIAN_WXFLAVOUR))dbg | |
638 | ||
639 | find debian/$(package_gtk_dbg_py)/$(pydir) -name '*.py?' -exec rm '{}' ';' | |
640 | rm -rf usr/bin $(pydir)/{wxversion.py,wx.pth} | |
641 | ||
642 | # This is rather bogus, its included in the main copyright file now though. | |
643 | rm -f debian/$(package_gtk_dbg_py)/$(wxpydir)/wx/tools/XRCed/license.txt | |
644 | ||
645 | ||
646 | install-msw-dev: DH_OPTIONS=-p$(package_msw_dev) | |
647 | install-msw-dev: build-msw-shared-stamp build-msw-static-stamp | |
648 | dh_testdir | |
649 | dh_testroot | |
650 | dh_clean -k | |
651 | dh_installdirs | |
652 | dh_install $(objdir_msw_shared)/lib/*.dll* usr/$(cross_host)/lib | |
653 | dh_install $(objdir_msw_shared)/lib/wx/include usr/$(cross_host)/lib/wx | |
654 | dh_install $(objdir_msw_shared)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config | |
655 | dh_install $(objdir_msw_static)/lib/*.a usr/$(cross_host)/lib | |
656 | dh_install $(objdir_msw_static)/lib/wx/include usr/$(cross_host)/lib/wx | |
657 | dh_install $(objdir_msw_static)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config | |
658 | $(cross_host)-strip --strip-debug debian/$(package_msw_dev)/usr/$(cross_host)/lib/*.a | |
659 | ||
660 | @# As a special case for the cross packages, we link their config | |
661 | @# under /usr as well as under the normal cross prefix. This way | |
662 | @# --prefix=/usr/$(cross_host) and --prefix=/usr --host=$(cross_host) | |
663 | @# will have a congruent effect on wx-config. | |
664 | @( for f in `ls -1 debian/$(package_msw_dev)/usr/$(cross_host)/lib/wx/config`; do \ | |
665 | all_cfg="$${all_cfg} usr/$(cross_host)/lib/wx/config/$$f usr/lib/wx/config/$$f"; \ | |
666 | echo "linking cross config /usr/$(cross_host)/lib/wx/config/$$f"; \ | |
667 | done; \ | |
668 | dh_link $${all_cfg}; \ | |
669 | ) | |
670 | ||
671 | install-msw-dbg: DH_OPTIONS=-p$(package_msw_dbg) | |
672 | install-msw-dbg: build-msw-dbg-stamp | |
673 | dh_testdir | |
674 | dh_testroot | |
675 | dh_clean -k | |
676 | dh_installdirs | |
677 | dh_install $(objdir_msw_dbg)/lib/*.dll* usr/$(cross_host)/lib | |
678 | dh_install $(objdir_msw_dbg)/lib/wx/include usr/$(cross_host)/lib/wx | |
679 | dh_install $(objdir_msw_dbg)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config | |
680 | # No static lib, they're freakin' huge! | |
681 | #$(cross_host)-strip --strip-debug debian/$(package_msw_dbg)/usr/$(cross_host)/lib/*.a | |
682 | ||
683 | @( for f in `ls -1 debian/$(package_msw_dbg)/usr/$(cross_host)/lib/wx/config`; do \ | |
684 | all_cfg="$${all_cfg} usr/$(cross_host)/lib/wx/config/$$f usr/lib/wx/config/$$f"; \ | |
685 | echo "linking cross config /usr/$(cross_host)/lib/wx/config/$$f"; \ | |
686 | done; \ | |
687 | dh_link $${all_cfg}; \ | |
688 | ) | |
689 | ||
690 | install-headers-msw: DH_OPTIONS=-p$(package_headers_msw) | |
691 | install-headers-msw: | |
692 | dh_testdir | |
693 | dh_testroot | |
694 | dh_clean -k | |
695 | ||
696 | cd $(objdir_msw_shared) \ | |
697 | && $(MAKE) install prefix=`pwd`/../$(objdir_msw_install) | |
698 | ||
699 | # Symlink all the headers that will be installed by the main -headers | |
700 | # package to where the cross compiler will expect them. | |
701 | @( for f in `ls -1 $(objdir_msw_install)/include/wx-$(release)/wx`; do \ | |
702 | all_h="$${all_h} usr/include/wx-$(release)/wx/$$f usr/$(cross_host)/include/wx-$(release)/wx/$$f"; \ | |
703 | echo "linking header /usr/include/wx-$(release)/wx/$$f"; \ | |
704 | done; \ | |
705 | dh_link $${all_h}; \ | |
706 | ) | |
707 | ||
708 | # But install this lot for real. | |
709 | rm -f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx-$(release)/wx/msw | |
710 | dh_install $(objdir_msw_install)/include/wx-$(release)/wx/msw usr/$(cross_host)/include/wx-$(release)/wx | |
711 | ||
712 | ||
713 | binary-common: | |
714 | dh_testdir | |
715 | dh_testroot | |
716 | dh_installdocs | |
717 | dh_installchangelogs | |
718 | dh_installexamples | |
719 | dh_installmenu | |
720 | dh_link | |
721 | ||
722 | @# Don't strip debug libs at all, and strip cross libs elsewhere | |
723 | @# with the cross host tools until dh_strip gets smarter. | |
724 | dh_strip -N$(package_gtk_dbg) -N$(package_msw_dev) -N$(package_msw_dbg) | |
725 | ||
726 | dh_compress | |
727 | dh_fixperms | |
728 | ||
729 | @# Don't do this for the dbg-py special build because dh_makeshlibs | |
730 | @# will crap out if it is called with no packages to act on. | |
731 | @if [ "x$(DH_OPTIONS)" != "-p$(package_gtk_dbg_py)" ]; then \ | |
732 | echo "dh_makeshlibs -N$(package_gtk_py) -V"; \ | |
733 | dh_makeshlibs -N$(package_gtk_py) -V; \ | |
734 | fi | |
735 | ||
736 | dh_installdeb | |
737 | dh_shlibdeps -ldebian/$(package_gtk_lib)/usr/lib:debian/$(package_gtk_dbg)/usr/lib | |
738 | dh_gencontrol | |
739 | dh_md5sums | |
740 | dh_builddeb | |
741 | ||
742 | # Build architecture-independent files here. | |
743 | # Note that you currently can't build the indep packages without first | |
744 | # building the arch specific package files needed to create them. | |
745 | binary-indep: build_all install | |
746 | $(MAKE) -f debian/rules \ | |
747 | DH_OPTIONS="-i -N$(package_gtk_dbg_py) -N$(package_msw_dev) -N$(package_msw_dbg) -N$(package_headers_msw)" \ | |
748 | binary-common | |
749 | ||
750 | # Build just the architecture-dependent files here. | |
751 | binary-arch: build_arch install_arch | |
752 | $(MAKE) -f debian/rules \ | |
753 | DH_OPTIONS="-a -N$(package_gtk_dbg_py) -N$(package_msw_dev) -N$(package_msw_dbg) -N$(package_headers_msw)" \ | |
754 | binary-common | |
755 | ||
756 | # Build all packages target. | |
757 | binary: binary-arch binary-indep | |
758 | ||
759 | # This is a special target for building the wxMSW-cross packages. | |
760 | # It's not currently called during the official package build run | |
761 | # but may be run separately to build the extra packages. | |
762 | # There is an implied build dep on the mingw32 cross compiler | |
763 | # that is not in the control file. | |
764 | binary-cross: control-files-stamp $(install_all_cross) | |
765 | $(MAKE) -f debian/rules \ | |
766 | DH_OPTIONS="-p$(package_msw_dev) -p$(package_msw_dbg) -p$(package_headers_msw)" \ | |
767 | binary-common | |
768 | ||
769 | ||
770 | # Build wxPython against libwxgtk-dbg. This package will conflict | |
771 | # with the release build one, but may be useful to some people. | |
772 | binary-dbg-py: control-files-stamp install-gtk-dbg-py | |
773 | $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg_py)" binary-common | |
774 | ||
775 | ||
776 | ############################################################################ | |
777 | # | |
778 | # Some rules to build a subset of the complete list of packages that can be | |
779 | # built from CVS. Beware that packages produced with these rules may *NOT* | |
780 | # be compatible with packages built using the 'binary' target or even with | |
781 | # Debian policy. Do not distribute packages built with these rules, they | |
782 | # are currently useful for rapid in-house testing by developers only. | |
783 | ||
784 | # libwxgtk shared lib package | |
785 | binary-gtk: control-files-stamp install-gtk-lib install-headers | |
786 | $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_lib) -p$(package_headers)" binary-common | |
787 | ||
788 | binary-gtk-dev: control-files-stamp install-gtk-dev install-headers | |
789 | $(MAKE) -f debian/rules \ | |
790 | DH_OPTIONS="-p$(package_gtk_lib) -p$(package_gtk_dev) -p$(package_headers)" \ | |
791 | binary-common | |
792 | ||
793 | binary-gtk-dbg: control-files-stamp install-gtk-dbg install-headers | |
794 | $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg) -p$(package_headers)" binary-common | |
795 | ||
796 | ||
797 | # docs package | |
798 | binary-doc: control-files-stamp install-doc | |
799 | $(MAKE) -f debian/rules DH_OPTIONS=-p$(package_doc) binary-common | |
800 | ||
801 | binary-fast:control-files-stamp install-gtk-dbg install-msw-dev install-headers install-headers-msw | |
802 | $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg) -p$(package_msw_dev) -p$(package_headers) -p$(package_headers_msw)" binary-common | |
803 | ||
804 | ||
805 | .PHONY: build build_all build_arch \ | |
806 | clean clean-py purge-release-py purge-dbg-py \ | |
807 | binary-indep binary-arch binary binary-common \ | |
808 | binary-gtk binary-gtk-dev binary-gtk-dbg binary-doc binary-cross \ | |
809 | install install_arch install-gtk-lib install-gtk-dev \ | |
810 | install-gtk-dbg \ | |
811 | install-gtk-py install-gtk-py-lib install-gtk-dbg-py \ | |
812 | install-common install-headers install-i18n install-doc \ | |
813 | install-examples install-msw-dev install-msw-dbg install-headers-msw | |
814 |