]> git.saurik.com Git - wxWidgets.git/blob - debian/rules
Fix portibility bug.
[wxWidgets.git] / debian / rules
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 CONCURRENCY_LEVEL
13
14 # A user who knows what they want, that's like gold...
15 # respect their precious opinion of how much blue smoke to use.
16 JOB_COUNT := $(CONCURRENCY_LEVEL)
17
18 else ifdef DISTCC_HOSTS
19
20 # Otherwise, if they have a cluster, try to put it to good use.
21 JOB_COUNT := $(shell set $${DISTCC_HOSTS} > /dev/null 2>&1 ; echo $$\#)
22
23 # Not much faster, but it might keep you warm in winter...
24 #JOB_COUNT := $(shell set $${DISTCC_HOSTS} > /dev/null 2>&1 ; echo $$(($$\# + $$\#)))
25
26 endif
27
28 ifdef JOB_COUNT
29 FAST_MAKE = $(MAKE) -j $(JOB_COUNT)
30 else
31 FAST_MAKE = $(MAKE)
32 endif
33
34 -include debian/python-version
35
36
37 # If another source package is to supply the common binary packages
38 # for a particular Debian release, then define this variable to indicate
39 # the $(release) that is expected to provide it. Do not define it at
40 # all if this is to be the default (or only) wx source package for the
41 # target release.
42 #
43 # for etch:
44 #DEBIAN_WX_DEFAULT_VERSION = 2.6
45
46
47 # This will extract a flavour out of the name of the source directory
48 # and flavour the packages and binaries with it. 'Official' builds
49 # should use a source dir of the form wxwidgets$RELEASE-$VERSION.
50 # Flavoured builds may use wxwidgets$RELEASE-$FLAVOUR-$VERSION, where
51 # any descriptive alphanumeric name will do for FLAVOUR. This will
52 # allow a custom build to be installed alongside the mainline ones
53 # without conflict. You will also need to make a corresponding
54 # changelog entry for your flavour source package using:
55 # wxwidget$RELEASE-$FLAVOUR ($VERSION) to satify dpkg-source and
56 # to correctly set the release below.
57 DEBIAN_WXFLAVOUR := $(shell pwd | sed -e 's@.*/wxwidgets[0-9.]\+-\?\(.*\)-[0-9.]\+-\?.*@\1@')
58
59 release := $(shell dpkg-parsechangelog | sed -n 's/^Source: wxwidgets//p' | sed 's/-ansi//')
60
61 # This is broken completely now by bakefiles changes. Until we add
62 # some hocus pocus to the main tree, to export these values from it
63 # again, we approximate its behaviour (fairly precisely fwiw) to
64 # specify $soversion below. Re-automate if incompatible changes
65 # result in it actually changing.
66 #soversion := $(shell grep '^WX_CURRENT=' configure.in | sed 's/WX_CURRENT=\([0-9]\+\).*/\1/')
67 soversion := 0
68 sorelease := $(release:%-$(DEBIAN_WXFLAVOUR)=%)-$(soversion)$(addprefix -,$(DEBIAN_WXFLAVOUR))
69
70 # In some places we use the full version number, including the micro version,
71 # for the development releases (which can be incompatible for the same major
72 # and minor version) but just the major.minor for the stable releases (which
73 # are supposed to be compatible), this variable contains the appropriate value
74 ifeq ($(shell echo `echo $(release) | sed 's/.\+\.\(.\+\)/\1/'`%2 | bc),1)
75 # development release
76 compatible_release := $(release).$(soversion)
77 else
78 compatible_release := $(release)
79 endif
80
81 # Base value for alternative priorities.
82 alt_prio := $(subst .,,$(release))
83
84 pytoolkit := gtk2
85 pydir := usr/lib/$(python_ver)/site-packages
86 wxpydir := $(pydir)/wx-$(compatible_release)-$(pytoolkit)
87
88 cross_host := i586-mingw32msvc
89 cross_build := $(shell ./config.guess)
90
91 config_cache = ../config_deb.cache
92 config_cache_cross = ../config_deb_cross.cache
93
94
95 # build options
96 COMMON_CONFIGURE_OPTIONS = \
97 --prefix=/usr \
98 --cache-file=$(config_cache) \
99 --with-flavour=$(DEBIAN_WXFLAVOUR) \
100 --with-zlib=sys \
101 --disable-reserved_virtual \
102
103 BASE_CONFIGURE_OPTIONS = $(COMMON_CONFIGURE_OPTIONS) \
104 --disable-gui \
105
106 GTK_CONFIGURE_OPTIONS = $(COMMON_CONFIGURE_OPTIONS) \
107 --with-gtk \
108 --with-gnomeprint \
109 --enable-mediactrl \
110 --enable-sound \
111 --with-sdl \
112 --enable-display \
113 --enable-geometry \
114 --enable-graphics_ctx \
115 --with-libjpeg=sys \
116 --with-libpng=sys \
117 --with-libtiff=sys \
118
119
120 PY_WX_CONFIG_OPTIONS = --version=$(release) --toolkit=$(pytoolkit) --static=no
121
122 WX_UNICODE := 1
123 WX_OPENGL := 1
124
125 ifeq ($(WX_UNICODE),1)
126 COMMON_CONFIGURE_OPTIONS += --enable-unicode
127 PY_WX_CONFIG_OPTIONS += --unicode
128 PY_UNICODE="UNICODE=1"
129 wxpydir := $(pydir)/wx-$(compatible_release)-$(pytoolkit)-unicode
130
131 # for compatibility with the existing 2.6 packages, we don't use "u" in
132 # the Unicode (default) package names
133 unicode_suffix :=
134 else
135 # but we do need to use something for non-Unicode packages to distinguish
136 # them
137 unicode_suffix := -ansi
138 endif
139
140 ifeq ($(WX_OPENGL),1)
141 GTK_CONFIGURE_OPTIONS += --with-opengl
142 else
143 GTK_CONFIGURE_OPTIONS += --without-opengl
144 endif
145
146 # Packages to build:
147 package_wxbase_lib := libwxbase$(sorelease)$(unicode_suffix)
148 package_wxbase_dev := libwxbase$(release)$(unicode_suffix)-dev
149 package_wxbase_dbg := libwxbase$(release)$(unicode_suffix)-dbg
150
151 package_gtk_lib := libwxgtk$(sorelease)$(unicode_suffix)
152 package_gtk_dev := libwxgtk$(release)$(unicode_suffix)-dev
153 package_gtk_dbg := libwxgtk$(release)$(unicode_suffix)-dbg
154
155
156
157
158 package_gtk_py_lib := python-wxgtk$(release)$(unicode_suffix)
159 package_gtk_py_ver = python-wxversion
160 package_gtk_py_tools = python-wxtools
161 package_gtk_py_addons = python-wxaddons
162
163 package_headers := wx$(release)-headers
164 package_i18n := wx$(release)-i18n
165 package_doc := wx$(release)-doc
166 package_examples := wx$(release)-examples
167 package_common = wx-common
168
169 # The packages listed here are common to all wx versions, and may be provided
170 # by another source package if more than one is in the release simultaneously.
171 common_packages := $(package_common) $(package_gtk_py_ver) $(package_gtk_py_tools) $(package_gtk_py_addons)
172
173
174 package_gtk_dbg_py := python-wxgtk$(release)$(unicode_suffix)-dbg
175
176
177
178 package_msw_dev := libwxmsw$(release)$(unicode_suffix)-dev
179 package_msw_dbg := libwxmsw$(release)$(unicode_suffix)-dbg
180 package_headers_msw := wx$(release)-headers-msw
181
182 # The packages listed here will not be built by default.
183 extra_packages := $(package_gtk_dbg_py) \
184 $(package_msw_dev) $(package_msw_dbg) $(package_headers_msw)
185
186 ifdef DEBIAN_WX_DEFAULT_VERSION
187
188 extra_packages += $(common_packages)
189
190 endif
191
192
193 # Build directories:
194 objdir_wxbase_shared = objs_wxbase_sh
195 objdir_wxbase_debug = objs_wxbase_d
196 objdir_gtk_shared = objs_gtk_sh
197 objdir_gtk_debug = objs_gtk_d
198 objdir_gtk_install = objs_gtk_install
199 objdir_doc_cruft = objs_doc_con
200 objdir_doc = docs/wx-manual.html
201 objdir_examples = docs/examples
202 objdir_i18n = locale
203
204 objdir_msw_shared = objs_msw_sh
205 objdir_msw_static = objs_msw_st
206 objdir_msw_dbg = objs_msw_d
207 objdir_msw_install = objs_msw_install
208
209 objdirs := $(objdir_wxbase_shared) $(objdir_wxbase_debug) \
210 $(objdir_gtk_shared) $(objdir_gtk_debug) $(objdir_gtk_install) \
211 $(objdir_doc_cruft) $(objdir_doc) $(objdir_examples) \
212 $(objdir_msw_shared) $(objdir_msw_static) $(objdir_msw_dbg) \
213 $(objdir_msw_install)
214
215 # note that the i18n package is actually arch indep (once built)
216 # but must be built (and installed) during the arch any phase as
217 # it's pulled out of the wxGTK shared lib package.
218 #
219 # similarly some of the wxpython packages are arch indep too, but
220 # all files for it are installed during the arch any phase.
221
222
223 # Build stamps:
224 build_arch_stamps = build-wxbase-shared-stamp build-wxbase-debug-stamp \
225 build-gtk-shared-stamp build-gtk-shared-contrib-stamp \
226 build-gtk-debug-stamp build-gtk-debug-contrib-stamp \
227 build-i18n-stamp build-gtk-py-stamp
228
229 build_indep_stamps = build-examples-stamp build-doc-stamp
230
231 build_cross_stamps = build-msw-shared-stamp build-msw-static-stamp build-msw-dbg-stamp
232
233 build_stamps_native := $(build_arch_stamps) $(build_indep_stamps)
234
235 build_stamps := $(build_stamps_native) $(build_cross_stamps)
236
237
238 # Install targets:
239 install_all_arch = install-wxbase-lib install-wxbase-dev install-wxbase-dbg \
240 install-gtk-lib install-gtk-dev install-gtk-dbg \
241 install-headers install-i18n \
242 install-gtk-py
243
244 ifndef DEBIAN_WX_DEFAULT_VERSION
245
246 install_all_arch += install-common
247
248 endif
249
250 install_all_indep = install-examples install-doc
251
252 install_all_cross = install-msw-dev install-msw-dbg install-headers-msw
253
254 install_all_native := $(install_all_arch) $(install_all_indep)
255
256 install_all := $(install_all_native) $(install_all_cross)
257
258
259 # wxPython uses this to build in-tree
260 wxconfig := $(shell pwd)/$(objdir_gtk_shared)/wx-config --no_rpath
261 wxconfig-dbg := $(shell pwd)/$(objdir_gtk_debug)/wx-config --no_rpath
262
263 # and this after it is installed.
264 py_wxconfig := wx-config $(PY_WX_CONFIG_OPTIONS) --debug=no
265 pyd_wxconfig := wx-config $(PY_WX_CONFIG_OPTIONS) --debug
266
267
268 #contrib_libs := $(subst CVS,,$(notdir $(wildcard contrib/include/wx/*)))
269
270
271 # The Rules:
272
273 debian/python-version:
274 echo python_ver := python$(shell python -c "import sys;print sys.version[:3]") > $@
275
276 debian/control: $(addprefix debian/,control.in python-version)
277 sed -e 's/=V/$(release)/g;s/=SOV/$(sorelease)/g;s/=PY/$(python_ver)/g;s/=U/$(unicode_suffix)/g'\
278 < debian/control.in > debian/control
279
280 control-files-stamp: debian/control
281 dh_testdir
282 @for f in postinst prerm; do \
283 echo "generating control file $(package_wxbase_dev).$$f"; \
284 sed -e 's/=V/$(release)/g; '\
285 ' s/=PRIO/$(alt_prio)/g' \
286 < debian/libwxbase-dev.$$f \
287 > debian/$(package_wxbase_dev).$$f; \
288 done;
289 @for f in postinst prerm; do \
290 echo "generating control file $(package_wxbase_dbg).$$f"; \
291 sed -e 's/=V/$(release)/g; '\
292 ' s/=PRIO/$(alt_prio)/g' \
293 < debian/libwxbase-dbg.$$f \
294 > debian/$(package_wxbase_dbg).$$f; \
295 done;
296 @for f in postinst prerm; do \
297 echo "generating control file $(package_gtk_dev).$$f"; \
298 sed -e 's/=V/$(release)/g; '\
299 ' s/=PRIO/$(alt_prio)/g' \
300 < debian/libwxgtk-dev.$$f \
301 > debian/$(package_gtk_dev).$$f; \
302 done;
303 @for f in postinst prerm; do \
304 echo "generating control file $(package_gtk_dbg).$$f"; \
305 sed -e 's/=V/$(release)/g; '\
306 ' s/=PRIO/$(alt_prio)/g' \
307 < debian/libwxgtk-dbg.$$f \
308 > debian/$(package_gtk_dbg).$$f; \
309 done;
310 @for f in docs postinst prerm; do \
311 echo "generating control file $(package_gtk_py_lib).$$f"; \
312 sed -e 's/=PY/$(python_ver)/g; '\
313 ' s|=WXPYDIR|$(wxpydir)|g; '\
314 ' s/=V/$(release)/g; '\
315 ' s/=PRIO/$(alt_prio)/g' \
316 < debian/python-wxgtk.$$f \
317 > debian/$(package_gtk_py_lib).$$f; \
318 done;
319 @for f in postinst prerm; do \
320 echo "generating control file $(package_gtk_dbg_py).$$f"; \
321 sed -e 's/=PY/$(python_ver)/g; '\
322 ' s/=V/$(release)/g; '\
323 ' s/=PRIO/$(alt_prio)/g' \
324 < debian/python-wxgtk-dbg.$$f \
325 > debian/$(package_gtk_dbg_py).$$f; \
326 done;
327 @echo "generating control file $(package_gtk_dbg_py).docs";
328 @cp debian/python-wxgtk.docs debian/$(package_gtk_dbg_py).docs;
329 @for f in docs doc-base; do \
330 echo "generating control file $(package_doc).$$f"; \
331 sed -e 's/=V/$(release)/g' < debian/wx-doc.$$f \
332 > debian/$(package_doc).$$f; \
333 done;
334 @for f in examples; do \
335 echo "generating control file $(package_examples).$$f"; \
336 cp debian/wx-examples.$$f debian/$(package_examples).$$f; \
337 done;
338 @for f in postinst prerm; do \
339 echo "generating control file $(package_msw_dev).$$f"; \
340 sed -e 's/=V/$(release)/g; '\
341 ' s/=H/$(cross_host)/g; '\
342 ' s/=PRIO/$(alt_prio)/g' \
343 < debian/libwxmsw-dev.$$f \
344 > debian/$(package_msw_dev).$$f; \
345 done;
346 @for f in postinst prerm; do \
347 echo "generating control file $(package_msw_dbg).$$f"; \
348 sed -e 's/=V/$(release)/g; '\
349 ' s/=H/$(cross_host)/g; '\
350 ' s/=PRIO/$(alt_prio)/g' \
351 < debian/libwxmsw-dbg.$$f \
352 > debian/$(package_msw_dbg).$$f; \
353 done;
354 # @echo "generating control file $(package_common).menu"; \
355 # sed -e 's/=V/$(release)/g' < debian/wx-common.menu \
356 # > debian/$(package_common).menu;
357 @echo "generating control file lintian-override"; \
358 sed -e 's/=V/$(release)/g; '\
359 ' s/=SOV/$(sorelease)/g' \
360 < debian/lintian-override.in \
361 > debian/lintian-override; \
362 touch $@
363
364 build_arch: control-files-stamp $(build_arch_stamps)
365 build_all: control-files-stamp $(build_stamps_native)
366
367 # Really we should probably do nothing here until we know which
368 # binary target is being called, but alpha builds were exploding
369 # (compiler segfaults) in random places when building under fakeroot
370 # from the binary-arch target. Build all -arch files here then, and
371 # let the -indep stuff fend for itself later.
372
373 build: build_arch
374
375
376 # The wx2.6 build system makes us run around in circles to get a separate
377 # libwxbase. We need to configure it here in order to get the correct
378 # config files to use it alone, but there is no point building it as the
379 # wxgtk build is going to do that again anyway. We'll move the relevant
380 # files out when that is done.
381
382 configure-wxbase-shared-stamp:
383 dh_testdir
384 mkdir -p $(objdir_wxbase_shared)
385 cd $(objdir_wxbase_shared) \
386 && ../configure $(BASE_CONFIGURE_OPTIONS)
387 touch $@
388
389 build-wxbase-shared-stamp: configure-wxbase-shared-stamp
390 dh_testdir
391 # Nothing to build here, move along...
392 #cd $(objdir_wxbase_shared) && $(FAST_MAKE)
393 touch $@
394
395 configure-wxbase-debug-stamp:
396 dh_testdir
397 mkdir -p $(objdir_wxbase_debug)
398 cd $(objdir_wxbase_debug) \
399 && ../configure $(BASE_CONFIGURE_OPTIONS) --enable-debug
400 touch $@
401
402 build-wxbase-debug-stamp: configure-wxbase-debug-stamp
403 dh_testdir
404 # Nothing to build here, move along...
405 #cd $(objdir_wxbase_debug) && $(FAST_MAKE)
406 touch $@
407
408 configure-gtk-shared-stamp:
409 dh_testdir
410 mkdir -p $(objdir_gtk_shared)
411 cd $(objdir_gtk_shared) \
412 && ../configure $(GTK_CONFIGURE_OPTIONS)
413 touch $@
414
415 build-gtk-shared-stamp: configure-gtk-shared-stamp
416 dh_testdir
417 cd $(objdir_gtk_shared) && $(FAST_MAKE)
418 touch $@
419
420
421 configure-gtk-debug-stamp:
422 dh_testdir
423 mkdir -p $(objdir_gtk_debug)
424 cd $(objdir_gtk_debug) \
425 && ../configure $(GTK_CONFIGURE_OPTIONS) --enable-debug
426 touch $@
427
428 build-gtk-debug-stamp: configure-gtk-debug-stamp
429 dh_testdir
430 cd $(objdir_gtk_debug) && $(FAST_MAKE)
431 touch $@
432
433
434 build-gtk-shared-contrib-stamp: build-gtk-shared-stamp
435 dh_testdir
436 cd $(objdir_gtk_shared)/contrib/src && $(FAST_MAKE)
437 cd $(objdir_gtk_shared)/utils/wxrc && $(FAST_MAKE)
438 touch $@
439
440
441 build-gtk-debug-contrib-stamp: build-gtk-debug-stamp
442 dh_testdir
443 cd $(objdir_gtk_debug)/contrib/src && $(FAST_MAKE)
444 touch $@
445
446
447 purge-dbg-py:
448 @if [ ! -e build-gtk-py-stamp ]; then \
449 $(MAKE) -f debian/rules clean-py; \
450 fi
451 $(RM) build-gtk-dbg-py-stamp
452
453 build-gtk-py-stamp: build-gtk-shared-stamp purge-dbg-py
454 dh_testdir
455 touch docs/lgpl.txt
456 cd wxPython \
457 && $(python_ver) ./setup.py build \
458 WX_CONFIG='$(wxconfig)' \
459 WXPORT=$(pytoolkit) \
460 $(PY_UNICODE) \
461 FLAVOUR=$(DEBIAN_WXFLAVOUR)
462 touch $@
463
464 build-doc-stamp: build-gtk-shared-stamp
465 dh_testdir
466 mkdir $(objdir_doc);
467 # the tarball may already have the generated docs in it
468 if [ ! -e docs/html/wx/index.html ]; then \
469 cd $(objdir_gtk_shared)/utils/tex2rtf/src && $(FAST_MAKE); \
470 rm -rf $(objdir_doc); \
471 rm -rf $(objdir_doc_cruft); \
472 mkdir $(objdir_doc_cruft); \
473 cd $(objdir_doc_cruft); \
474 LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib:$(LD_LIBRARY_PATH) \
475 ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \
476 ../docs/latex/wx/manual.tex \
477 ../$(objdir_doc)/wx$(release)-manual.html \
478 -twice -html; \
479 cp docs/latex/wx/*.gif $(objdir_doc); \
480 rm -rf $(objdir_doc_cruft); \
481 rm -f $(objdir_doc)/wx$(release)-manual.{con,hh*,htx,ref}; \
482 else \
483 cp docs/html/wx/* $(objdir_doc); \
484 mv $(objdir_doc)/index.html $(objdir_doc)/wx-$(release)-manual_contents.html; \
485 fi
486 touch $@
487
488 build-examples-stamp: build-gtk-shared-stamp
489 dh_testdir
490 mkdir -p $(objdir_examples)
491
492 # copy all samples and the Makefile generated for libwxgtk.
493 cp -a samples $(objdir_examples)
494 rm -f $(objdir_examples)/samples/Makefile
495 cp -a $(objdir_gtk_shared)/samples/Makefile $(objdir_examples)/samples
496
497 cd $(objdir_examples)/samples \
498 && find -name 'Makefile.in' -exec rm -f '{}' ';' \
499 && for d in $$(find -type d); do \
500 if [ -f $$d/makefile.unx ]; then \
501 mv $$d/makefile.unx $$d/Makefile; \
502 fi; \
503 done \
504
505 cp -a wxPython/demo $(objdir_examples)/wxPython
506
507 echo "generating install_examples.sh script";
508 sed -e 's/=V/$(release)/g' < debian/unpack_examples.sh.in \
509 > debian/unpack_examples.sh
510 chmod 755 debian/unpack_examples.sh
511
512 touch $@
513
514 build-i18n-stamp: build-gtk-shared-stamp
515 dh_testdir
516
517 # touch .po files first, since if they are not already up
518 # to date then _now_ is not the time to fix it.
519 # That should have been been done before cvs was tagged.
520 cd $(objdir_i18n) \
521 && touch *.po \
522 && $(MAKE) allmo
523 touch $@
524
525 purge-release-py:
526 @if [ ! -e build-gtk-dbg-py-stamp ]; then \
527 $(MAKE) -f debian/rules clean-py; \
528 fi
529 $(RM) build-gtk-py-stamp
530
531 build-gtk-dbg-py-stamp: build-gtk-debug-stamp purge-release-py
532 dh_testdir
533 touch docs/lgpl.txt
534 cd wxPython \
535 && $(python_ver) ./setup.py build \
536 WX_CONFIG='$(wxconfig-dbg)' \
537 WXPORT=$(pytoolkit) \
538 $(PY_UNICODE) \
539 FLAVOUR=$(addsuffix -,$(DEBIAN_WXFLAVOUR))dbg
540 touch $@
541
542
543 configure-msw-shared-stamp:
544 dh_testdir
545 mkdir -p $(objdir_msw_shared)
546 cd $(objdir_msw_shared) \
547 && ../configure --prefix=/usr/$(cross_host) \
548 --cache-file=$(config_cache_cross) \
549 --host=$(cross_host) \
550 --build=$(cross_build) \
551 --with-flavour=$(DEBIAN_WXFLAVOUR)
552 touch $@
553
554 build-msw-shared-stamp: configure-msw-shared-stamp
555 dh_testdir
556 cd $(objdir_msw_shared) && $(FAST_MAKE)
557 touch $@
558
559 configure-msw-static-stamp:
560 dh_testdir
561 mkdir -p $(objdir_msw_static)
562 cd $(objdir_msw_static) \
563 && ../configure --prefix=/usr/$(cross_host) \
564 --cache-file=$(config_cache_cross) \
565 --host=$(cross_host) \
566 --build=$(cross_build) \
567 --with-flavour=$(DEBIAN_WXFLAVOUR) \
568 --disable-shared
569 touch $@
570
571 build-msw-static-stamp: configure-msw-static-stamp
572 dh_testdir
573 cd $(objdir_msw_static) && $(FAST_MAKE)
574 touch $@
575
576 configure-msw-dbg-stamp:
577 dh_testdir
578 mkdir -p $(objdir_msw_dbg)
579 cd $(objdir_msw_dbg) \
580 && ../configure --prefix=/usr/$(cross_host) \
581 --cache-file=$(config_cache_cross) \
582 --host=$(cross_host) \
583 --build=$(cross_build) \
584 --with-flavour=$(DEBIAN_WXFLAVOUR) \
585 --enable-debug
586 touch $@
587
588 build-msw-dbg-stamp: configure-msw-dbg-stamp
589 dh_testdir
590 cd $(objdir_msw_dbg) && $(FAST_MAKE)
591 touch $@
592
593
594 clean-py:
595 cd wxPython && rm -rf licence build* docs/xml-raw wx/*.py
596
597 # What to do about src/__version__.py ???
598
599
600 # We do the equivalent of this above by removing build, unfortunately
601 # its not enough by itself to get the tree properly clean again.
602 # && ./setup.py clean
603
604 clean: debian/control clean-py
605 dh_testdir
606 dh_testroot
607
608 rm -rf config_deb.cache config_deb_cross.cache *-stamp $(objdirs)
609 rm -f docs/lgpl.txt
610 rm -f $(objdir_i18n)/*.mo
611
612 dh_clean
613 rm -f debian/$(package_wxbase_lib).*
614 rm -f debian/$(package_wxbase_dev).*
615 rm -f debian/$(package_wxbase_dbg).*
616 rm -f debian/$(package_gtk_lib).*
617 rm -f debian/$(package_gtk_dev).*
618 rm -f debian/$(package_gtk_dbg).*
619 rm -f debian/$(package_gtk_py_lib).*
620 rm -f debian/$(package_headers).*
621 rm -f debian/$(package_i18n).*
622 rm -f debian/$(package_doc).*
623 rm -f debian/$(package_examples).*
624 rm -f debian/$(package_gtk_dbg_py).*
625 rm -f debian/$(package_msw_dev).*
626 rm -f debian/$(package_msw_dbg).*
627 rm -f debian/lintian-override
628 rm -f debian/unpack_examples.sh
629
630 install_arch: build_arch $(install_all_arch)
631
632 install: build_all $(install_all_native)
633
634
635 install-wxbase-lib: DH_OPTIONS=-p$(package_wxbase_lib)
636 install-wxbase-lib: build-wxbase-shared-stamp install-gtk-shared-stamp
637 dh_testdir
638 dh_testroot
639 dh_clean -k
640 @# No, this is not a typo, we steal these libs from the gtk build.
641 dh_install $(objdir_gtk_install)/lib/libwx_base*.so.* usr/lib
642 dh_installdirs usr/share/lintian/overrides
643 cp debian/lintian-override debian/$(package_wxbase_lib)/usr/share/lintian/overrides/$(package_wxbase_lib)
644
645 install-wxbase-dev: DH_OPTIONS=-p$(package_wxbase_dev)
646 install-wxbase-dev: build-wxbase-shared-stamp install-gtk-shared-stamp
647 dh_testdir
648 dh_testroot
649 dh_clean -k
650 @# No, this is not a typo, we steal these libs from the gtk build.
651 dh_install $(objdir_gtk_install)/lib/libwx_base*.so usr/lib
652 dh_install $(objdir_wxbase_shared)/lib/wx/include usr/lib/wx
653 dh_install $(objdir_wxbase_shared)/lib/wx/config/base* usr/lib/wx/config
654
655 install-wxbase-dbg: DH_OPTIONS=-p$(package_wxbase_dbg)
656 install-wxbase-dbg: build-wxbase-debug-stamp
657 dh_testdir
658 dh_testroot
659 dh_clean -k
660 @# No, this is not a typo, we steal these libs from the gtk debug build.
661 dh_install $(objdir_gtk_debug)/lib/libwx_base* usr/lib
662 dh_install $(objdir_wxbase_debug)/lib/wx/include usr/lib/wx
663 dh_install $(objdir_wxbase_debug)/lib/wx/config/base* usr/lib/wx/config
664 dh_installdirs usr/share/lintian/overrides
665 cp debian/lintian-override debian/$(package_wxbase_dbg)/usr/share/lintian/overrides/$(package_wxbase_dbg)
666
667 install-gtk-shared-stamp: build-gtk-shared-stamp build-gtk-shared-contrib-stamp
668 dh_testdir
669 mkdir -p $(objdir_gtk_install)
670 cd $(objdir_gtk_shared) \
671 && $(MAKE) install prefix=`pwd`/../$(objdir_gtk_install)
672 cd $(objdir_gtk_shared)/contrib/src \
673 && $(MAKE) install prefix=`pwd`/../../../$(objdir_gtk_install)
674 touch $@
675
676 install-gtk-lib: DH_OPTIONS=-p$(package_gtk_lib)
677 install-gtk-lib: install-gtk-shared-stamp
678 dh_testdir
679 dh_testroot
680 dh_clean -k
681 dh_install $(objdir_gtk_install)/lib/libwx_gtk*.so.* usr/lib
682 dh_installdirs usr/share/lintian/overrides
683 cp debian/lintian-override debian/$(package_gtk_lib)/usr/share/lintian/overrides/$(package_gtk_lib)
684
685 install-gtk-dev: DH_OPTIONS=-p$(package_gtk_dev)
686 install-gtk-dev: install-gtk-shared-stamp
687 dh_testdir
688 dh_testroot
689 dh_clean -k
690 dh_install $(objdir_gtk_install)/lib/libwx_gtk*.so usr/lib
691 dh_install $(objdir_gtk_install)/lib/wx/include usr/lib/wx
692 dh_install $(objdir_gtk_install)/lib/wx/config/gtk* usr/lib/wx/config
693
694 install-gtk-dbg: DH_OPTIONS=-p$(package_gtk_dbg)
695 install-gtk-dbg: build-gtk-debug-stamp build-gtk-debug-contrib-stamp
696 dh_testdir
697 dh_testroot
698 dh_clean -k
699 dh_install $(objdir_gtk_debug)/lib/libwx_gtk* usr/lib
700 dh_install $(objdir_gtk_debug)/lib/wx/include usr/lib/wx
701 dh_install $(objdir_gtk_debug)/lib/wx/config/gtk* usr/lib/wx/config
702 dh_installdirs usr/share/lintian/overrides
703 cp debian/lintian-override debian/$(package_gtk_dbg)/usr/share/lintian/overrides/$(package_gtk_dbg)
704
705
706 install-gtk-py-lib: DH_OPTIONS=-p$(package_gtk_py_lib)
707 install-gtk-py-lib: build-gtk-py-stamp
708 dh_testdir
709 dh_testroot
710 dh_clean -k
711 dh_installdirs usr/lib/wx/python
712 cd wxPython \
713 && $(python_ver) ./setup.py install \
714 --prefix=`pwd`/../debian/$(package_gtk_py_lib)/usr \
715 WX_CONFIG='$(wxconfig)' \
716 SYS_WX_CONFIG='$(py_wxconfig)' \
717 WXPORT=$(pytoolkit) \
718 $(PY_UNICODE) \
719 FLAVOUR=$(DEBIAN_WXFLAVOUR)
720
721 mv debian/$(package_gtk_py_lib)/$(pydir)/wx.pth \
722 debian/$(package_gtk_py_lib)/usr/lib/wx/python/wx$(release).pth
723
724 find debian/$(package_gtk_py_lib)/$(pydir) -name '*.py?' -exec rm '{}' ';'
725
726 # This is rather bogus, its included in the main copyright file now though.
727 rm -f debian/$(package_gtk_py_lib)/$(wxpydir)/wx/tools/XRCed/license.txt
728
729 install-gtk-py-ver: DH_OPTIONS=-p$(package_gtk_py_ver)
730 install-gtk-py-ver: install-gtk-py-lib
731 dh_testdir
732 dh_testroot
733 dh_clean -k
734
735 ifndef DEBIAN_WX_DEFAULT_VERSION
736
737 dh_movefiles --sourcedir=debian/$(package_gtk_py_lib) $(pydir)/wxversion.py
738 else
739 rm debian/$(package_gtk_py_lib)/$(pydir)/wxversion.py
740 endif
741
742
743
744 install-gtk-py-tools: DH_OPTIONS=-p$(package_gtk_py_tools)
745 install-gtk-py-tools: install-gtk-py-ver
746 dh_testdir
747 dh_testroot
748 dh_clean -k
749
750 ifndef DEBIAN_WX_DEFAULT_VERSION
751
752 dh_movefiles --sourcedir=debian/$(package_gtk_py_lib) usr/bin
753
754 dh_installman debian/wxPython-tools.1
755 dh_link usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2py.1 \
756 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2xpm.1 \
757 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/img2png.1 \
758 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pycrust.1 \
759 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyshell.1 \
760 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/xrced.1 \
761 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/helpviewer.1 \
762 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyalacarte.1 \
763 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pyalamode.1 \
764 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pywrap.1 \
765 usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pywxrc.1
766
767 dh_installdirs usr/share/lintian/overrides
768 cp debian/lintian-override debian/$(package_gtk_py_tools)/usr/share/lintian/overrides/$(package_gtk_py_tools)
769 endif
770 mkdir -p debian/$(package_gtk_py_tools)/usr/share/pixmaps
771 mkdir -p debian/$(package_gtk_py_tools)/usr/share/applications
772
773 cp wxPython/wx/py/PyCrust_32.png debian/$(package_gtk_py_tools)/usr/share/pixmaps/pycrust.png
774 cp wxPython/wx/py/PyCrust_32.png debian/$(package_gtk_py_tools)/usr/share/pixmaps/pyshell.png
775 cp wxPython/wx/tools/XRCed/XRCed_32.png debian/$(package_gtk_py_tools)/usr/share/pixmaps/xrced.png
776 cp debian/pycrust.desktop debian/$(package_gtk_py_tools)/usr/share/applications
777 cp debian/pyshell.desktop debian/$(package_gtk_py_tools)/usr/share/applications
778 cp debian/xrced.desktop debian/$(package_gtk_py_tools)/usr/share/applications
779
780 rm -r debian/$(package_gtk_py_lib)/usr/bin
781
782 install-gtk-py-addons: DH_OPTIONS=-p$(package_gtk_py_addons)
783 install-gtk-py-addons: install-gtk-py-tools
784 dh_testdir
785 dh_testroot
786 dh_clean -k
787 ifndef DEBIAN_WX_DEFAULT_VERSION
788
789 dh_movefiles --sourcedir=debian/$(package_gtk_py_lib) $(pydir)/wxaddons
790 else
791 rm -r debian/$(package_gtk_py_lib)/$(pydir)/wxaddons
792 endif
793
794
795 install-gtk-py: install-gtk-py-addons
796
797
798 install-common: DH_OPTIONS=-p$(package_common)
799 install-common: install-gtk-shared-stamp
800 dh_testdir
801 dh_testroot
802 dh_clean -k
803
804 dh_install $(objdir_gtk_install)/share/bakefile/presets usr/share/bakefile
805 dh_install $(objdir_gtk_install)/share/bakefile/presets/wx*.bkl usr/share/bakefile/presets
806
807 dh_install $(objdir_gtk_install)/share/aclocal usr/share
808 dh_installman debian/wx-config.1
809
810 dh_install $(objdir_gtk_shared)/utils/wxrc/wxrc usr/bin
811 dh_installman debian/wxrc-tools.1
812 dh_link usr/share/man/man1/wxrc-tools.1 usr/share/man/man1/wxrc.1
813
814
815 install-headers: DH_OPTIONS=-p$(package_headers)
816 install-headers: install-gtk-shared-stamp
817 dh_testdir
818 dh_testroot
819 dh_clean -k
820
821 # The only way to be really sure we get the univ headers correct is to install
822 # them. Do that in a scratch dirs, and move the gtk ones last, so at least
823 # they win in the result of any uncaught conflict.
824
825 # cd $(objdir_gtk_univ) \
826 # && $(MAKE) install prefix=`pwd`/../$(objdir_univ_install)/usr
827
828 # dh_movefiles --sourcedir=$(objdir_univ_install)
829 dh_install $(objdir_gtk_install)/include usr
830
831 install-i18n: DH_OPTIONS=-p$(package_i18n)
832 install-i18n: build-i18n-stamp install-gtk-shared-stamp
833 dh_testdir
834 dh_testroot
835 dh_clean -k
836 dh_install $(objdir_gtk_install)/share/locale usr/share
837
838 install-doc: DH_OPTIONS=-p$(package_doc)
839 install-doc: build-doc-stamp
840 dh_testdir
841 dh_testroot
842 dh_clean -k
843
844 @# Link this monstrosity with an overly obfuscated name
845 @# to something that both people and browsers can expect to find.
846 dh_link usr/share/doc/$(package_doc)/wx-manual.html/wx-$(release)-manual_contents.html \
847 usr/share/doc/$(package_doc)/wx-manual.html/index.html
848
849 install-examples: DH_OPTIONS=-p$(package_examples)
850 install-examples: build-examples-stamp
851 dh_testdir
852 dh_testroot
853 dh_clean -k
854
855 install-gtk-dbg-py: DH_OPTIONS=-p$(package_gtk_dbg_py)
856 install-gtk-dbg-py: build-gtk-dbg-py-stamp
857 dh_testdir
858 dh_testroot
859 dh_clean -k
860 dh_installdirs usr/lib/wx/python
861 cd wxPython \
862 && $(python_ver) ./setup.py install \
863 --prefix=`pwd`/../debian/$(package_gtk_dbg_py)/usr \
864 WX_CONFIG='$(wxconfig-dbg)' \
865 SYS_WX_CONFIG='$(pyd_wxconfig)' \
866 WXPORT=$(pytoolkit) \
867 $(PY_UNICODE) \
868 FLAVOUR=$(addsuffix -,$(DEBIAN_WXFLAVOUR))dbg
869
870 mv debian/$(package_gtk_py_lib)/$(pydir)/wx.pth \
871 debian/$(package_gtk_py_lib)/usr/lib/wx/python/wx$(release)-dbg.pth
872
873 find debian/$(package_gtk_dbg_py)/$(pydir) -name '*.py?' -exec rm '{}' ';'
874 rm -rf usr/bin $(pydir)/{wxversion.py,wx.pth}
875
876 # This is rather bogus, its included in the main copyright file now though.
877 rm -f debian/$(package_gtk_dbg_py)/$(wxpydir)/wx/tools/XRCed/license.txt
878
879
880 install-msw-dev: DH_OPTIONS=-p$(package_msw_dev)
881 install-msw-dev: build-msw-shared-stamp build-msw-static-stamp
882 dh_testdir
883 dh_testroot
884 dh_clean -k
885 dh_install $(objdir_msw_shared)/lib/*.dll* usr/$(cross_host)/lib
886 dh_install $(objdir_msw_shared)/lib/wx/include usr/$(cross_host)/lib/wx
887 dh_install $(objdir_msw_shared)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config
888 dh_install $(objdir_msw_static)/lib/*.a usr/$(cross_host)/lib
889 dh_install $(objdir_msw_static)/lib/wx/include usr/$(cross_host)/lib/wx
890 dh_install $(objdir_msw_static)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config
891 $(cross_host)-strip --strip-debug debian/$(package_msw_dev)/usr/$(cross_host)/lib/*.a
892
893 @# As a special case for the cross packages, we link their config
894 @# under /usr as well as under the normal cross prefix. This way
895 @# --prefix=/usr/$(cross_host) and --prefix=/usr --host=$(cross_host)
896 @# will have a congruent effect on wx-config.
897 @( for f in `ls -1 debian/$(package_msw_dev)/usr/$(cross_host)/lib/wx/config`; do \
898 all_cfg="$${all_cfg} usr/$(cross_host)/lib/wx/config/$$f usr/lib/wx/config/$$f"; \
899 echo "linking cross config /usr/$(cross_host)/lib/wx/config/$$f"; \
900 done; \
901 dh_link $${all_cfg}; \
902 )
903
904 install-msw-dbg: DH_OPTIONS=-p$(package_msw_dbg)
905 install-msw-dbg: build-msw-dbg-stamp
906 dh_testdir
907 dh_testroot
908 dh_clean -k
909 dh_install $(objdir_msw_dbg)/lib/*.dll* usr/$(cross_host)/lib
910 dh_install $(objdir_msw_dbg)/lib/wx/include usr/$(cross_host)/lib/wx
911 dh_install $(objdir_msw_dbg)/lib/wx/config/$(cross_host)* usr/$(cross_host)/lib/wx/config
912 # No static lib, they're freakin' huge!
913 #$(cross_host)-strip --strip-debug debian/$(package_msw_dbg)/usr/$(cross_host)/lib/*.a
914
915 @( for f in `ls -1 debian/$(package_msw_dbg)/usr/$(cross_host)/lib/wx/config`; do \
916 all_cfg="$${all_cfg} usr/$(cross_host)/lib/wx/config/$$f usr/lib/wx/config/$$f"; \
917 echo "linking cross config /usr/$(cross_host)/lib/wx/config/$$f"; \
918 done; \
919 dh_link $${all_cfg}; \
920 )
921
922 install-headers-msw: DH_OPTIONS=-p$(package_headers_msw)
923 install-headers-msw:
924 dh_testdir
925 dh_testroot
926 dh_clean -k
927
928 cd $(objdir_msw_shared) \
929 && $(MAKE) install prefix=`pwd`/../$(objdir_msw_install)
930
931 # Symlink all the headers that will be installed by the main -headers
932 # package to where the cross compiler will expect them.
933 @( for f in `ls -1 $(objdir_msw_install)/include/wx-$(release)/wx`; do \
934 all_h="$${all_h} usr/include/wx-$(release)/wx/$$f usr/$(cross_host)/include/wx-$(release)/wx/$$f"; \
935 echo "linking header /usr/include/wx-$(release)/wx/$$f"; \
936 done; \
937 dh_link $${all_h}; \
938 )
939
940 # But install this lot for real.
941 rm -f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx-$(release)/wx/msw
942 dh_install $(objdir_msw_install)/include/wx-$(release)/wx/msw usr/$(cross_host)/include/wx-$(release)/wx
943
944
945 binary-common:
946 dh_testdir
947 dh_testroot
948 dh_installdocs
949 dh_installchangelogs
950 dh_installexamples
951 dh_installmenu
952 dh_link
953
954 @# Don't strip debug libs at all, and strip cross libs elsewhere
955 @# with the cross host tools until dh_strip gets smarter.
956 dh_strip -N$(package_gtk_dbg) -N$(package_wxbase_dbg) \
957 -N$(package_msw_dev) -N$(package_msw_dbg)
958
959 dh_compress
960 dh_fixperms
961
962 @# Don't do this for the dbg-py special build because dh_makeshlibs
963 @# will crap out if it is called with no packages to act on.
964 @if [ "x$(DH_OPTIONS)" != "-p$(package_gtk_dbg_py)" ]; then \
965 echo "dh_makeshlibs -N$(package_gtk_py_lib) -V"; \
966 dh_makeshlibs -N$(package_gtk_py_lib) -V; \
967 fi
968
969 dh_installdeb
970 dh_shlibdeps -ldebian/$(package_wxbase_lib)/usr/lib:debian/$(package_wxbase_dbg)/usr/lib:debian/$(package_gtk_lib)/usr/lib:debian/$(package_gtk_dbg)/usr/lib
971 dh_gencontrol
972 dh_md5sums
973 dh_builddeb
974
975 # Build architecture-independent files here.
976 # Note that you currently can't build the indep packages without first
977 # building the arch specific package files needed to create them.
978 binary-indep: build_all install
979 $(MAKE) -f debian/rules \
980 DH_OPTIONS="-i $(addprefix -N,$(extra_packages))" \
981 binary-common
982
983 # Build just the architecture-dependent files here.
984 binary-arch: build_arch install_arch
985 $(MAKE) -f debian/rules \
986 DH_OPTIONS="-a $(addprefix -N,$(extra_packages))" \
987 binary-common
988
989 # Build all packages target.
990 binary: binary-arch binary-indep
991
992
993 # This is a special target for building the wxMSW-cross packages.
994 # It's not currently called during the official package build run
995 # but may be run separately to build the extra packages.
996 # There is an implied build dep on the mingw32 cross compiler
997 # that is not in the control file.
998 binary-cross: control-files-stamp $(install_all_cross)
999 $(MAKE) -f debian/rules \
1000 DH_OPTIONS="-p$(package_msw_dev) -p$(package_msw_dbg) -p$(package_headers_msw)" \
1001 binary-common
1002
1003
1004 # Build wxPython against libwxgtk-dbg. This package will conflict
1005 # with the release build one, but may be useful to some people.
1006 binary-dbg-py: control-files-stamp install-gtk-dbg-py
1007 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg_py)" binary-common
1008
1009
1010 ############################################################################
1011 #
1012 # Some rules to build a subset of the complete list of packages that can be
1013 # built from CVS. Beware that packages produced with these rules may *NOT*
1014 # be compatible with packages built using the 'binary' target or even with
1015 # Debian policy. Do not distribute packages built with these rules, they
1016 # are currently useful for rapid in-house testing by developers only.
1017
1018 DH_OPTIONS_GTK := -p$(package_wxbase_lib) -p$(package_gtk_lib) -p$(package_headers)
1019
1020 # libwxgtk shared lib package
1021 binary-gtk: control-files-stamp install-gtk-lib install-wxbase-lib install-headers
1022 $(MAKE) -f debian/rules DH_OPTIONS="$(DH_OPTIONS_GTK)" binary-common
1023
1024 binary-gtk-dev: control-files-stamp install-gtk-dev install-wxbase-dev install-headers
1025 $(MAKE) -f debian/rules \
1026 DH_OPTIONS="-p$(package_wxbase_dev) -p$(package_gtk_dev) $(DH_OPTIONS_GTK)" \
1027 binary-common
1028
1029 binary-gtk-dbg: control-files-stamp install-gtk-dbg install-wxbase-dbg install-headers
1030 $(MAKE) -f debian/rules \
1031 DH_OPTIONS="-p$(package_wxbase_dbg) -p$(package_gtk_dbg) -p$(package_headers)" \
1032 binary-common
1033
1034
1035 # docs package
1036 binary-doc: control-files-stamp install-doc
1037 $(MAKE) -f debian/rules DH_OPTIONS=-p$(package_doc) binary-common
1038
1039 binary-fast:control-files-stamp install-gtk-dbg install-msw-dev install-headers install-headers-msw
1040 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg) -p$(package_msw_dev) -p$(package_headers) -p$(package_headers_msw)" binary-common
1041
1042
1043 .PHONY: build build_all build_arch \
1044 clean clean-py purge-release-py purge-dbg-py \
1045 binary-indep binary-arch binary binary-common \
1046 binary-gtk binary-gtk-dev binary-gtk-dbg \
1047 binary-wxbase binary-wxbase-dev binary-wxbase-dbg \
1048 binary-doc binary-cross binary-dbg-py \
1049 install install_arch install-gtk-lib install-gtk-dev \
1050 install-gtk-dbg \
1051 install-gtk-py install-gtk-py-tools install-gtk-py-ver \
1052 install-gtk-py-lib install-gtk-dbg-py \
1053 install-common install-headers install-i18n install-doc \
1054 install-examples install-msw-dev install-msw-dbg install-headers-msw
1055