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