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