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