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