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