]> git.saurik.com Git - wxWidgets.git/blame - debian/rules
Fixed new lintian warnings.
[wxWidgets.git] / debian / rules
CommitLineData
e4c4c1c6
RL
1#!/usr/bin/make -f
2# debian/rules file to build packages from wxWindows CVS source
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
10export DH_COMPAT=2
f6bcfd97 11export DH_OPTIONS
e4c4c1c6 12
e0a4aa8a 13release:=$(shell dpkg-parsechangelog | sed -n 's/^Source: wxwindows//p')
050207ec 14python_dir:=python$(shell python -c "import sys;print sys.version[:3]")
e4c4c1c6 15
3a922bb4
RL
16cross_host=i586-mingw32msvc
17cross_build=$(shell ./config.guess)
18
e0a4aa8a 19# Packages to build:
5c0e67b2
RL
20package_wxbase_lib=libwxbase$(release)
21package_wxbase_dev=libwxbase$(release)-dev
f6bcfd97 22package_wxbase_dbg=libwxbase$(release)-dbg
e4c4c1c6
RL
23package_gtk_lib=libwxgtk$(release)
24package_gtk_dev=libwxgtk$(release)-dev
f6bcfd97 25package_gtk_dbg=libwxgtk$(release)-dbg
e0a4aa8a 26package_gtk_py=libwxgtk$(release)-python
f6bcfd97
BP
27package_gtk_contrib=libwxgtk$(release)-contrib
28package_gtk_contrib_dev=libwxgtk$(release)-contrib-dev
29package_headers=wxwin$(release)-headers
3ca6a5f0 30package_i18n=wxwin$(release)-i18n
e0a4aa8a 31package_doc=wxwin$(release)-doc
5c0e67b2 32package_examples=wxwin$(release)-examples
e4c4c1c6 33
3a922bb4
RL
34package_wxbase_msw_dev=libwxbase-msw$(release)-dev
35package_msw_dev=libwxmsw$(release)-dev
36package_headers_msw=wxwin$(release)-headers-msw
37
e0a4aa8a 38# Build directories:
5c0e67b2
RL
39objdir_wxbase_shared=objs_wxbase_sh
40objdir_wxbase_static=objs_wxbase_st
f6bcfd97 41objdir_wxbase_debug=objs_wxbase_d
e4c4c1c6
RL
42objdir_gtk_shared=objs_gtk_sh
43objdir_gtk_static=objs_gtk_st
f6bcfd97 44objdir_gtk_debug=objs_gtk_d
e0a4aa8a
RL
45objdir_doc_cruft=objs_doc_con
46objdir_doc=docs/wxWindows-manual.html
5c0e67b2 47objdir_examples=docs/examples
3ca6a5f0 48objdir_i18n=locale
3a922bb4
RL
49
50objdir_wxbase_msw_static=objs_wxbase_msw_st
51objdir_msw_static=objs_msw_st
52
f6bcfd97
BP
53objdirs=$(objdir_wxbase_shared) $(objdir_wxbase_static) $(objdir_wxbase_debug) \
54 $(objdir_gtk_shared) $(objdir_gtk_static) $(objdir_gtk_debug) \
3a922bb4
RL
55 $(objdir_doc_cruft) $(objdir_doc) $(objdir_examples) \
56 $(objdir_wxbase_msw_static) $(objdir_msw_static)
e4c4c1c6 57
afa3e1ed
RL
58# note that the i18n package is actually arch indep (once built)
59# but must be built (and installed) during the arch any phase as
60# it's pulled out of the wxGtk shared lib package.
61
050207ec
RL
62# Build stamps:
63build_arch_stamps=build-wxbase-shared-stamp build-wxbase-static-stamp \
64 build-wxbase-debug-stamp build-gtk-shared-stamp \
65 build-gtk-static-stamp build-gtk-debug-stamp \
66 build-contrib-shared-stamp build-contrib-static-stamp \
afa3e1ed 67 build-gtk-py-stamp build-i18n-stamp
e4c4c1c6 68
afa3e1ed 69build_indep_stamps=build-examples-stamp build-doc-stamp
f6bcfd97 70
3a922bb4
RL
71build_cross_stamps=build-wxbase-msw-dev-stamp build-msw-dev-stamp
72
73build_stamps_native=$(build_arch_stamps) $(build_indep_stamps)
74
75build_stamps=$(build_stamps_native) $(build_cross_stamps)
050207ec
RL
76
77# Install targets:
78install_all_arch=install-wxbase-lib install-wxbase-dev install-wxbase-dbg \
79 install-gtk-lib install-gtk-dev install-gtk-dbg \
80 install-gtk-contrib install-gtk-contrib-dev install-gtk-py \
afa3e1ed 81 install-headers install-i18n
050207ec 82
afa3e1ed 83install_all_indep=install-examples install-doc
050207ec 84
3a922bb4
RL
85install_all_cross=install-wxbase-msw-dev install-msw-dev install-headers-msw
86
87install_all_native=$(install_all_arch) $(install_all_indep)
88
89install_all=$(install_all_native) $(install_all_cross)
e4c4c1c6
RL
90
91
afa3e1ed
RL
92wxconfig:=$(shell pwd)/$(objdir_gtk_shared)/wx-config \
93 --prefix=$(shell pwd) \
94 --exec-prefix=$(shell pwd)/$(objdir_gtk_shared)
95
96
e0a4aa8a
RL
97# The Rules:
98
e4c4c1c6
RL
99debian/control: debian/control.in
100 sed -e 's/=V/$(release)/g' < debian/control.in > debian/control
101
3a922bb4 102control-files-stamp: debian/control
f6bcfd97 103 dh_testdir
050207ec 104 @for f in dirs postinst; do \
f6bcfd97
BP
105 echo "generating control file $(package_wxbase_lib).$$f"; \
106 cp debian/libwxbase.$$f debian/$(package_wxbase_lib).$$f; \
107 done;
050207ec 108 @for f in dirs files links postinst prerm; do \
f6bcfd97 109 echo "generating control file $(package_wxbase_dev).$$f"; \
3a922bb4
RL
110 sed -e 's/=V/$(release)/g' < debian/libwxbase-dev.$$f \
111 > debian/$(package_wxbase_dev).$$f; \
f6bcfd97 112 done;
050207ec 113 @for f in dirs links postinst prerm; do \
f6bcfd97 114 echo "generating control file $(package_wxbase_dbg).$$f"; \
3a922bb4
RL
115 sed -e 's/=V/$(release)/g' < debian/libwxbase-dbg.$$f \
116 > debian/$(package_wxbase_dbg).$$f; \
f6bcfd97 117 done;
050207ec 118 @for f in dirs postinst; do \
f6bcfd97
BP
119 echo "generating control file $(package_gtk_lib).$$f"; \
120 cp debian/libwxgtk.$$f debian/$(package_gtk_lib).$$f; \
121 done;
050207ec 122 @for f in dirs files links postinst prerm; do \
f6bcfd97 123 echo "generating control file $(package_gtk_dev).$$f"; \
3a922bb4
RL
124 sed -e 's/=V/$(release)/g' < debian/libwxgtk-dev.$$f \
125 > debian/$(package_gtk_dev).$$f; \
f6bcfd97 126 done;
050207ec 127 @for f in dirs links postinst prerm; do \
f6bcfd97 128 echo "generating control file $(package_gtk_dbg).$$f"; \
3a922bb4
RL
129 sed -e 's/=V/$(release)/g' < debian/libwxgtk-dbg.$$f \
130 > debian/$(package_gtk_dbg).$$f; \
f6bcfd97
BP
131 done;
132 @for f in dirs docs files postinst prerm; do \
133 echo "generating control file $(package_gtk_py).$$f"; \
050207ec
RL
134 sed -e 's/=PY/$(python_dir)/g;s/=V/$(release)/g' < debian/libwxgtk-python.$$f \
135 > debian/$(package_gtk_py).$$f; \
f6bcfd97 136 done;
050207ec 137 @for f in dirs postinst; do \
f6bcfd97
BP
138 echo "generating control file $(package_gtk_contrib).$$f"; \
139 cp debian/libwxgtk-contrib.$$f debian/$(package_gtk_contrib).$$f; \
140 done;
050207ec 141 @for f in dirs files; do \
f6bcfd97
BP
142 echo "generating control file $(package_gtk_contrib_dev).$$f"; \
143 cp debian/libwxgtk-contrib-dev.$$f debian/$(package_gtk_contrib_dev).$$f; \
144 done;
050207ec 145 @for f in dirs files; do \
f6bcfd97
BP
146 echo "generating control file $(package_headers).$$f"; \
147 cp debian/wxwin-headers.$$f debian/$(package_headers).$$f; \
148 done;
050207ec 149 @for f in dirs files; do \
3ca6a5f0
BP
150 echo "generating control file $(package_i18n).$$f"; \
151 cp debian/wxwin-i18n.$$f debian/$(package_i18n).$$f; \
152 done;
f6bcfd97
BP
153 @for f in dirs docs doc-base; do \
154 echo "generating control file $(package_doc).$$f"; \
3a922bb4
RL
155 sed -e 's/=V/$(release)/g' < debian/wxwin-doc.$$f \
156 > debian/$(package_doc).$$f; \
f6bcfd97 157 done;
050207ec 158 @for f in examples; do \
f6bcfd97
BP
159 echo "generating control file $(package_examples).$$f"; \
160 cp debian/wxwin-examples.$$f debian/$(package_examples).$$f; \
161 done;
3a922bb4
RL
162 @for f in dirs links postinst prerm; do \
163 echo "generating control file $(package_wxbase_msw_dev).$$f"; \
164 sed -e 's/=V/$(release)/g;s/=H/$(cross_host)/g' < debian/libwxbase-msw-dev.$$f \
165 > debian/$(package_wxbase_msw_dev).$$f; \
166 done;
167 @for f in dirs links postinst prerm; do \
168 echo "generating control file $(package_msw_dev).$$f"; \
169 sed -e 's/=V/$(release)/g;s/=H/$(cross_host)/g' < debian/libwxmsw-dev.$$f \
170 > debian/$(package_msw_dev).$$f; \
171 done;
172 @for f in dirs; do \
173 echo "generating control file $(package_headers_msw).$$f"; \
174 sed -e 's/=H/$(cross_host)/g' < debian/wxwin-headers-msw.$$f \
175 > debian/$(package_headers_msw).$$f; \
176 done;
f6bcfd97
BP
177 touch $@
178
050207ec 179build_arch: control-files-stamp $(build_arch_stamps)
3a922bb4 180build_all: control-files-stamp $(build_stamps_native)
3abb92ce 181
3a922bb4
RL
182# Really we should probably do nothing here until we know which
183# binary target is being called, but alpha builds were exploding
184# (compiler segfaults) in random places when building under fakeroot
185# from the binary-arch target. Build all -arch files here then, and
186# let the -indep stuff fend for itself later.
187
188build: build_arch
050207ec 189
e4c4c1c6 190
5c0e67b2
RL
191build-wxbase-shared-stamp:
192 dh_testdir
3a922bb4 193 mkdir -p $(objdir_wxbase_shared)
5c0e67b2 194 cd $(objdir_wxbase_shared) \
f6bcfd97 195 && ../configure --prefix=/usr \
050207ec 196 --cache-file=../config_deb.cache \
f6bcfd97 197 --disable-gui \
3a922bb4 198 --enable-soname \
f6bcfd97 199 --with-zlib=sys \
5c0e67b2
RL
200 && $(MAKE)
201 touch $@
202
203build-wxbase-static-stamp:
204 dh_testdir
3a922bb4 205 mkdir -p $(objdir_wxbase_static)
5c0e67b2 206 cd $(objdir_wxbase_static) \
f6bcfd97 207 && ../configure --prefix=/usr \
050207ec 208 --cache-file=../config_deb.cache \
f6bcfd97
BP
209 --disable-gui \
210 --disable-shared \
211 --with-zlib=sys \
212 && $(MAKE)
213 touch $@
214
215build-wxbase-debug-stamp:
216 dh_testdir
3a922bb4 217 mkdir -p $(objdir_wxbase_debug)
f6bcfd97
BP
218 cd $(objdir_wxbase_debug) \
219 && ../configure --prefix=/usr \
050207ec 220 --cache-file=../config_deb.cache \
f6bcfd97
BP
221 --disable-gui \
222 --enable-debug \
3a922bb4 223 --enable-soname \
f6bcfd97 224 --with-zlib=sys \
5c0e67b2
RL
225 && $(MAKE)
226 touch $@
227
e4c4c1c6
RL
228build-gtk-shared-stamp:
229 dh_testdir
3a922bb4 230 mkdir -p $(objdir_gtk_shared)
e4c4c1c6 231 cd $(objdir_gtk_shared) \
f6bcfd97 232 && ../configure --prefix=/usr \
050207ec 233 --cache-file=../config_deb.cache \
f6bcfd97
BP
234 --with-gtk \
235 --with-opengl \
3a922bb4 236 --enable-soname \
f6bcfd97
BP
237 --with-zlib=sys \
238 --with-libjpeg=sys \
239 --with-libpng=sys \
240 --with-libtiff=sys \
e4c4c1c6
RL
241 && $(MAKE)
242 touch $@
243
244build-gtk-static-stamp:
245 dh_testdir
3a922bb4 246 mkdir -p $(objdir_gtk_static)
e4c4c1c6 247 cd $(objdir_gtk_static) \
f6bcfd97 248 && ../configure --prefix=/usr \
050207ec 249 --cache-file=../config_deb.cache \
f6bcfd97
BP
250 --with-gtk \
251 --with-opengl \
252 --disable-shared \
253 --with-zlib=sys \
254 --with-libjpeg=sys \
255 --with-libpng=sys \
256 --with-libtiff=sys \
e4c4c1c6
RL
257 && $(MAKE)
258 touch $@
259
f6bcfd97
BP
260build-gtk-debug-stamp:
261 dh_testdir
3a922bb4 262 mkdir -p $(objdir_gtk_debug)
f6bcfd97
BP
263 cd $(objdir_gtk_debug) \
264 && ../configure --prefix=/usr \
050207ec 265 --cache-file=../config_deb.cache \
f6bcfd97
BP
266 --with-gtk \
267 --with-opengl \
268 --enable-debug \
3a922bb4 269 --enable-soname \
f6bcfd97
BP
270 --with-zlib=sys \
271 --with-libjpeg=sys \
272 --with-libpng=sys \
273 --with-libtiff=sys \
274 && $(MAKE)
275 touch $@
276
277build-contrib-shared-stamp: build-gtk-shared-stamp
278 dh_testdir
050207ec
RL
279 cd $(objdir_gtk_shared)/contrib/src \
280 && $(MAKE)
f6bcfd97
BP
281 touch $@
282
283build-contrib-static-stamp: build-gtk-static-stamp
284 dh_testdir
050207ec
RL
285 cd $(objdir_gtk_static)/contrib/src \
286 && $(MAKE)
f6bcfd97
BP
287 touch $@
288
050207ec 289build-gtk-py-stamp: build-gtk-shared-stamp
e0a4aa8a 290 dh_testdir
050207ec
RL
291 touch docs/lgpl.txt
292 cd wxPython \
afa3e1ed 293 && ./setup.py build IN_CVS_TREE=1 WX_CONFIG='$(wxconfig)'
e0a4aa8a
RL
294 touch $@
295
f538864d
RL
296build-doc-stamp: build-gtk-shared-stamp
297 dh_testdir
298 cd $(objdir_gtk_shared)/utils/tex2rtf/src \
e0a4aa8a
RL
299 && $(MAKE)
300 mkdir $(objdir_doc)
301 mkdir $(objdir_doc_cruft)
302 cd $(objdir_doc_cruft) \
3a922bb4 303 && LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib:$(LD_LIBRARY_PATH) \
e0a4aa8a 304 ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \
5c0e67b2 305 ../docs/latex/wx/manual.tex ../$(objdir_doc)/wxwin.htm -twice -html
e0a4aa8a
RL
306 cp docs/latex/wx/*.gif $(objdir_doc)
307 rm -rf $(objdir_doc_cruft)
308 rm -f $(objdir_doc)/wxwin.con $(objdir_doc)/wxwin.hh* \
309 $(objdir_doc)/wxwin.htx $(objdir_doc)/wxwin.ref
f538864d
RL
310 touch $@
311
3a922bb4 312build-examples-stamp: build-gtk-shared-stamp
5c0e67b2 313 dh_testdir
3a922bb4
RL
314 mkdir -p $(objdir_examples)
315
316 # copy all samples and the Makefile generated for libwxgtk.
5c0e67b2 317 cp -a samples $(objdir_examples)
3a922bb4
RL
318 rm -f $(objdir_examples)/samples/Makefile
319 cp -a $(objdir_gtk_shared)/samples/Makefile $(objdir_examples)/samples
320
5c0e67b2 321 cp -a demos $(objdir_examples)
f6bcfd97 322 cp -a wxPython/demo $(objdir_examples)/wxPython
5c0e67b2
RL
323 @for d in $(objdir_examples)/demos $(objdir_examples)/samples; do \
324 (cd $$d \
325 && mv Makefile.in Makefile \
326 && rm -f configure* \
327 && find -name 'Makefile.in' -exec rm -f '{}' ';' \
328 && for f in $$(find -type d); do \
329 if [ -f $$f/makefile.unx ]; then \
330 mv $$f/makefile.unx $$f/Makefile; \
331 fi; \
332 done) \
333 done;
334 touch $@
335
3ca6a5f0
BP
336build-i18n-stamp: build-gtk-shared-stamp
337 dh_testdir
338 cd $(objdir_i18n) \
339 && $(MAKE) allmo
340 touch $@
341
3a922bb4
RL
342build-wxbase-msw-dev-stamp:
343 dh_testdir
344 mkdir -p $(objdir_wxbase_msw_static)
345 cd $(objdir_wxbase_msw_static) \
346 && ../configure --prefix=/usr/$(cross_host) \
347 --cache-file=../config_deb.cache \
348 --host=$(cross_host) \
349 --build=$(cross_build) \
350 --disable-gui \
351 --disable-shared \
352 && $(MAKE)
353 touch $@
354
355build-msw-dev-stamp:
356 dh_testdir
357 mkdir -p $(objdir_msw_static)
358 cd $(objdir_msw_static) \
359 && ../configure --prefix=/usr/$(cross_host) \
360 --cache-file=../config_deb.cache \
361 --host=$(cross_host) \
362 --build=$(cross_build) \
363 --with-mingw \
364 --disable-shared \
365 && $(MAKE)
366 touch $@
367
368
e4c4c1c6
RL
369clean: debian/control
370 dh_testdir
371 dh_testroot
050207ec
RL
372 rm -rf config_deb.cache control-files-stamp $(build_stamps) $(objdirs)
373 rm -f docs/lgpl.txt
374 cd wxPython && ./setup.py clean
e4c4c1c6 375 dh_clean
5c0e67b2
RL
376 rm -f debian/$(package_wxbase_lib).*
377 rm -f debian/$(package_wxbase_dev).*
f6bcfd97 378 rm -f debian/$(package_wxbase_dbg).*
f538864d
RL
379 rm -f debian/$(package_gtk_lib).*
380 rm -f debian/$(package_gtk_dev).*
f6bcfd97 381 rm -f debian/$(package_gtk_dbg).*
e0a4aa8a 382 rm -f debian/$(package_gtk_py).*
f6bcfd97
BP
383 rm -f debian/$(package_gtk_contrib).*
384 rm -f debian/$(package_gtk_contrib_dev).*
385 rm -f debian/$(package_headers).*
3ca6a5f0 386 rm -f debian/$(package_i18n).*
f538864d 387 rm -f debian/$(package_doc).*
5c0e67b2 388 rm -f debian/$(package_examples).*
3a922bb4
RL
389 rm -f debian/$(package_wxbase_msw_dev).*
390 rm -f debian/$(package_msw_dev).*
391 rm -f debian/$(package_headers_msw).*
e4c4c1c6 392
050207ec
RL
393install_arch: build_arch $(install_all_arch)
394
3a922bb4 395install: build_all $(install_all_native)
f6bcfd97
BP
396
397install-wxbase-lib: DH_OPTIONS=-p$(package_wxbase_lib)
398install-wxbase-lib: build-wxbase-shared-stamp
e0a4aa8a
RL
399 dh_testdir
400 dh_testroot
e4c4c1c6
RL
401 dh_clean -k
402 dh_installdirs
f6bcfd97 403 cp -a $(objdir_wxbase_shared)/lib/* debian/$(package_wxbase_lib)/usr/lib
3a922bb4 404 cp $(objdir_wxbase_shared)/wxbase-$(release)-config debian/$(package_wxbase_lib)/usr/bin/
f6bcfd97
BP
405
406install-wxbase-dev: DH_OPTIONS=-p$(package_wxbase_dev)
407install-wxbase-dev: build-wxbase-static-stamp install-wxbase-lib
408 dh_testdir
409 dh_testroot
410 dh_clean -k
411 dh_installdirs
412 dh_movefiles --sourcedir=debian/$(package_wxbase_lib)
413 cp $(objdir_wxbase_static)/lib/*.a debian/$(package_wxbase_dev)/usr/lib
414
415install-wxbase-dbg: DH_OPTIONS=-p$(package_wxbase_dbg)
416install-wxbase-dbg: build-wxbase-debug-stamp
417 dh_testdir
418 dh_testroot
419 dh_clean -k
420 dh_installdirs
421 cp -a $(objdir_wxbase_debug)/lib/* debian/$(package_wxbase_dbg)/usr/lib
3a922bb4 422 cp $(objdir_wxbase_debug)/wxbased-$(release)-config debian/$(package_wxbase_dbg)/usr/bin/
050207ec 423 cp debian/lintian-override debian/$(package_wxbase_dbg)/usr/share/lintian/overrides/$(package_wxbase_dbg)
f6bcfd97
BP
424
425install-gtk-lib: DH_OPTIONS=-p$(package_gtk_lib)
426install-gtk-lib: build-gtk-shared-stamp
427 dh_testdir
428 dh_testroot
429 dh_clean -k
430 dh_installdirs
e4c4c1c6 431 cd $(objdir_gtk_shared) \
f6bcfd97
BP
432 && $(MAKE) install prefix=`pwd`/../debian/$(package_gtk_lib)/usr
433 rm -f debian/$(package_gtk_lib)/usr/bin/wx-config
e4c4c1c6 434
f6bcfd97
BP
435install-gtk-dev: DH_OPTIONS=-p$(package_gtk_dev)
436install-gtk-dev: build-gtk-static-stamp install-gtk-lib
437 dh_testdir
438 dh_testroot
439 dh_clean -k
440 dh_installdirs
441 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
442 cp $(objdir_gtk_static)/lib/libwx_gtk*.a debian/$(package_gtk_dev)/usr/lib
e4c4c1c6 443
f6bcfd97
BP
444install-gtk-dbg: DH_OPTIONS=-p$(package_gtk_dbg)
445install-gtk-dbg: build-gtk-debug-stamp
446 dh_testdir
447 dh_testroot
448 dh_clean -k
449 dh_installdirs
450 cp -a $(objdir_gtk_debug)/lib/* debian/$(package_gtk_dbg)/usr/lib
3a922bb4 451 cp $(objdir_gtk_debug)/wxgtkd-$(release)-config debian/$(package_gtk_dbg)/usr/bin/
050207ec 452 cp debian/lintian-override debian/$(package_gtk_dbg)/usr/share/lintian/overrides/$(package_gtk_dbg)
e4c4c1c6 453
f6bcfd97
BP
454install-gtk-contrib: DH_OPTIONS=-p$(package_gtk_contrib)
455install-gtk-contrib: build-contrib-shared-stamp
e4c4c1c6
RL
456 dh_testdir
457 dh_testroot
f6bcfd97
BP
458 dh_clean -k
459 dh_installdirs
460 cd $(objdir_gtk_shared)/contrib/src \
461 && $(MAKE) install prefix=`pwd`/../../../debian/$(package_gtk_contrib)/usr
462
463install-gtk-contrib-dev: DH_OPTIONS=-p$(package_gtk_contrib_dev)
464install-gtk-contrib-dev: build-contrib-static-stamp install-gtk-dev
465 dh_testdir
466 dh_testroot
467 dh_clean -k
468 dh_installdirs
469 dh_movefiles --sourcedir=debian/$(package_gtk_contrib)
470 cp $(objdir_gtk_static)/lib/*.a debian/$(package_gtk_contrib_dev)/usr/lib
471 rm -f debian/$(package_gtk_contrib_dev)/usr/lib/libwx_gtk*.a
472
473install-gtk-py: DH_OPTIONS=-p$(package_gtk_py)
050207ec 474install-gtk-py: build-gtk-py-stamp
f6bcfd97
BP
475 dh_testdir
476 dh_testroot
477 dh_clean -k
478 dh_installdirs
050207ec
RL
479 cd wxPython \
480 && ./setup.py install --prefix=`pwd`/../debian/$(package_gtk_py)/usr
481 find debian/$(package_gtk_py)/usr/lib/$(python_dir)/site-packages/wxPython \
f6bcfd97
BP
482 -name '*.py?' -exec rm '{}' ';'
483
484install-headers: DH_OPTIONS=-p$(package_headers)
485install-headers: install-gtk-lib
486 dh_testdir
487 dh_testroot
488 dh_clean -k
489 dh_installdirs
490 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
491 dh_installmanpages \
e4c4c1c6
RL
492 ansi2knr.1 \
493 jpegtran.1 \
f6bcfd97 494 libpng.3 \
e4c4c1c6 495 libpngpf.3 \
f6bcfd97 496 zlib.3 \
e4c4c1c6 497 png.5
f6bcfd97 498
3ca6a5f0
BP
499install-i18n: DH_OPTIONS=-p$(package_i18n)
500install-i18n: build-i18n-stamp install-gtk-lib
501 dh_testdir
502 dh_testroot
503 dh_clean -k
504 dh_installdirs
505 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
506
f6bcfd97
BP
507install-doc: DH_OPTIONS=-p$(package_doc)
508install-doc: build-doc-stamp
509 dh_testdir
510 dh_testroot
511 dh_clean -k
512 dh_installdirs
513
514install-examples: DH_OPTIONS=-p$(package_examples)
515install-examples: build-examples-stamp
516 dh_testdir
517 dh_testroot
518 dh_clean -k
519 dh_installdirs
520
3a922bb4
RL
521install-wxbase-msw-dev: DH_OPTIONS=-p$(package_wxbase_msw_dev)
522install-wxbase-msw-dev: build-wxbase-msw-dev-stamp
523 dh_testdir
524 dh_testroot
525 dh_clean -k
526 dh_installdirs
527 cp -a $(objdir_wxbase_msw_static)/lib/* debian/$(package_wxbase_msw_dev)/usr/$(cross_host)/lib
528 cp $(objdir_wxbase_msw_static)/wxbase-$(release)-$(cross_host)-config debian/$(package_wxbase_msw_dev)/usr/bin/
529 $(cross_host)-strip --strip-debug debian/$(package_wxbase_msw_dev)/usr/$(cross_host)/lib/*.a
530
531install-msw-dev: DH_OPTIONS=-p$(package_msw_dev)
532install-msw-dev: build-msw-dev-stamp
533 dh_testdir
534 dh_testroot
535 dh_clean -k
536 dh_installdirs
537 cp -a $(objdir_msw_static)/lib/* debian/$(package_msw_dev)/usr/$(cross_host)/lib
538 cp $(objdir_msw_static)/wxmsw-$(release)-$(cross_host)-config debian/$(package_msw_dev)/usr/bin/
539 $(cross_host)-strip --strip-debug debian/$(package_msw_dev)/usr/$(cross_host)/lib/*.a
540
541install-headers-msw: DH_OPTIONS=-p$(package_headers_msw)
542install-headers-msw:
543 dh_testdir
544 dh_testroot
545 dh_clean -k
546 dh_installdirs
547 @# Symlink all the headers that will be installed by the main -headers
548 @# package to where the cross compiler will expect them.
549 @for f in `ls -1 include/wx`; do \
550 ln -s /usr/include/wx/$$f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx; \
551 echo "linking header /usr/include/wx/$$f"; \
552 done;
553 @# But install this lot for real.
554 rm -f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx/msw
555 cp -a include/wx/msw debian/$(package_headers_msw)/usr/$(cross_host)/include/wx
556 @# and remove this cruft(?)
557 rm -f debian/$(package_headers_msw)/usr/$(cross_host)/include/wx/treelay.h
558
559
f6bcfd97 560binary-common:
f6bcfd97
BP
561 dh_testdir
562 dh_testroot
563 dh_installdocs
5c0e67b2
RL
564 dh_installchangelogs
565 dh_installexamples
566 dh_link
3a922bb4
RL
567
568 @# Don't strip debug libs at all, and strip cross libs elsewhere
569 @# with the cross host tools until dh_strip gets smarter.
570 dh_strip -N$(package_gtk_dbg) -N$(package_wxbase_dbg) -N$(package_wxbase_msw_dev) -N$(package_msw_dev)
571
e4c4c1c6
RL
572 dh_compress
573 dh_fixperms
afa3e1ed 574 dh_makeshlibs -N$(package_gtk_py) -V
e4c4c1c6 575 dh_installdeb
050207ec 576 dh_shlibdeps -ldebian/$(package_gtk_lib)/usr/lib
e4c4c1c6
RL
577 dh_gencontrol
578 dh_md5sums
579 dh_builddeb
580
f6bcfd97 581# Build architecture-independent files here.
050207ec
RL
582# Note that you currently can't build the indep packages without first
583# building the arch specific package files needed to create them.
3abb92ce 584binary-indep: build_all install
3a922bb4
RL
585 $(MAKE) -f debian/rules \
586 DH_OPTIONS="-i -N$(package_wxbase_msw_dev) -N$(package_msw_dev) -N$(package_headers_msw)" \
587 binary-common
f6bcfd97 588
050207ec
RL
589# Build just the architecture-dependent files here.
590binary-arch: build_arch install_arch
3a922bb4
RL
591 $(MAKE) -f debian/rules \
592 DH_OPTIONS="-a -N$(package_wxbase_msw_dev) -N$(package_msw_dev) -N$(package_headers_msw)" \
593 binary-common
f6bcfd97
BP
594
595# Build all packages target.
596binary: binary-arch binary-indep
597
3a922bb4
RL
598# This is a special target for building the wxMSW-cross packages.
599# It's not currently called during the official package build run
600# but may be run separately to build the extra packages.
601# There is an implied build dep on the mingw32 cross compiler
602# that is not in the control file.
603binary-cross: control-files-stamp $(install_all_cross)
604 $(MAKE) -f debian/rules \
605 DH_OPTIONS="-p$(package_wxbase_msw_dev) -p$(package_msw_dev) -p$(package_headers_msw)" \
606 binary-common
607
f6bcfd97
BP
608
609############################################################################
610#
611# Some rules to build a subset of the complete list of packages that can be
612# built from CVS. Beware that packages produced with these rules may *NOT*
613# be compatible with packages built using the 'binary' target or even with
614# Debian policy. Do not distribute packages built with these rules, they
615# are currently useful for rapid in-house testing by developers only.
616
617# libwxgtk shared lib package
618binary-gtk: control-files-stamp install-gtk-lib install-headers
619 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_lib) -p$(package_headers)" binary-common
620
621binary-gtk-dev: control-files-stamp install-gtk-dev install-headers
622 $(MAKE) -f debian/rules \
623 DH_OPTIONS="-p$(package_gtk_lib) -p$(package_gtk_dev) -p$(package_headers)" \
624 binary-common
625
626binary-gtk-dbg: control-files-stamp install-gtk-dbg install-headers
627 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg) -p$(package_headers)" binary-common
628
629# libwxbase shared lib package
630binary-wxbase: control-files-stamp install-wxbase-lib install-headers
631 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_wxbase_lib) -p$(package_headers)" binary-common
632
633binary-wxbase-dev: control-files-stamp install-wxbase-dev install-headers
634 $(MAKE) -f debian/rules \
635 DH_OPTIONS="-p$(package_wxbase_lib) -p$(package_wxbase_dev) -p$(package_headers)" \
636 binary-common
637
638binary-wxbase-dbg: control-files-stamp install-wxbase-dbg install-headers
639 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_wxbase_dbg) -p$(package_headers)" binary-common
640
641# docs package
642binary-doc: control-files-stamp install-doc
643 $(MAKE) -f debian/rules DH_OPTIONS=-p$(package_doc) binary-common
644
645
3abb92ce 646.PHONY: build build_all build_arch clean binary-indep binary-arch binary binary-common \
050207ec 647 binary-gtk binary-gtk-dev binary-gtk-dbg binary-wxbase binary-wxbase-dev \
3a922bb4
RL
648 binary-wxbase-dbg binary-doc binary-cross \
649 install install_arch install-wxbase-lib \
050207ec
RL
650 install-wxbase-dev install-wxbase-dbg install-gtk-lib install-gtk-dev \
651 install-gtk-dbg install-gtk-contrib install-gtk-contrib-dev \
3a922bb4
RL
652 install-gtk-py install-headers install-i18n install-doc install-examples \
653 install-wxbase-msw-dev install-msw-dev install-headers-msw
f6bcfd97 654