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