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