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