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