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