]> git.saurik.com Git - wxWidgets.git/blob - debian/rules
Changed wxFont, wxPen, wxBrush to not implicitly use the wxTheXXXList
[wxWidgets.git] / debian / rules
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 :-)
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_COMPAT=2
11 export DH_OPTIONS
12
13 release:=$(shell dpkg-parsechangelog | sed -n 's/^Source: wxwindows//p')
14 python_dir:=python$(shell python -c "import sys;print sys.version[:3]")
15
16 # Packages to build:
17 package_wxbase_lib=libwxbase$(release)
18 package_wxbase_dev=libwxbase$(release)-dev
19 package_wxbase_dbg=libwxbase$(release)-dbg
20 package_gtk_lib=libwxgtk$(release)
21 package_gtk_dev=libwxgtk$(release)-dev
22 package_gtk_dbg=libwxgtk$(release)-dbg
23 package_gtk_py=libwxgtk$(release)-python
24 package_gtk_contrib=libwxgtk$(release)-contrib
25 package_gtk_contrib_dev=libwxgtk$(release)-contrib-dev
26 package_headers=wxwin$(release)-headers
27 package_i18n=wxwin$(release)-i18n
28 package_doc=wxwin$(release)-doc
29 package_examples=wxwin$(release)-examples
30
31 # Build directories:
32 objdir_wxbase_shared=objs_wxbase_sh
33 objdir_wxbase_static=objs_wxbase_st
34 objdir_wxbase_debug=objs_wxbase_d
35 objdir_gtk_shared=objs_gtk_sh
36 objdir_gtk_static=objs_gtk_st
37 objdir_gtk_debug=objs_gtk_d
38 objdir_doc_cruft=objs_doc_con
39 objdir_doc=docs/wxWindows-manual.html
40 objdir_examples=docs/examples
41 objdir_i18n=locale
42 objdirs=$(objdir_wxbase_shared) $(objdir_wxbase_static) $(objdir_wxbase_debug) \
43 $(objdir_gtk_shared) $(objdir_gtk_static) $(objdir_gtk_debug) \
44 $(objdir_doc) $(objdir_examples)
45
46 # Build stamps:
47 build_arch_stamps=build-wxbase-shared-stamp build-wxbase-static-stamp \
48 build-wxbase-debug-stamp build-gtk-shared-stamp \
49 build-gtk-static-stamp build-gtk-debug-stamp \
50 build-contrib-shared-stamp build-contrib-static-stamp \
51 build-gtk-py-stamp
52
53 build_indep_stamps=build-examples-stamp build-doc-stamp build-i18n-stamp
54
55 build_stamps=$(build_arch_stamps) $(build_indep_stamps)
56
57 # Install targets:
58 install_all_arch=install-wxbase-lib install-wxbase-dev install-wxbase-dbg \
59 install-gtk-lib install-gtk-dev install-gtk-dbg \
60 install-gtk-contrib install-gtk-contrib-dev install-gtk-py \
61 install-headers
62
63 install_all_indep=install-i18n install-doc install-examples
64
65 install_all=$(install_all_arch) $(install_all_indep)
66
67
68 # The Rules:
69
70 debian/control: debian/control.in
71 sed -e 's/=V/$(release)/g' < debian/control.in > debian/control
72
73 debian/wxwin-doc.doc-base: debian/wxwin-doc.doc-base.in
74 sed -e 's/=V/$(release)/g' < debian/wxwin-doc.doc-base.in > debian/wxwin-doc.doc-base
75
76 control-files-stamp: debian/control debian/wxwin-doc.doc-base
77 dh_testdir
78 @for f in dirs postinst; do \
79 echo "generating control file $(package_wxbase_lib).$$f"; \
80 cp debian/libwxbase.$$f debian/$(package_wxbase_lib).$$f; \
81 done;
82 @for f in dirs files links postinst prerm; do \
83 echo "generating control file $(package_wxbase_dev).$$f"; \
84 cp debian/libwxbase-dev.$$f debian/$(package_wxbase_dev).$$f; \
85 done;
86 @for f in dirs links postinst prerm; do \
87 echo "generating control file $(package_wxbase_dbg).$$f"; \
88 cp debian/libwxbase-dbg.$$f debian/$(package_wxbase_dbg).$$f; \
89 done;
90 @for f in dirs postinst; do \
91 echo "generating control file $(package_gtk_lib).$$f"; \
92 cp debian/libwxgtk.$$f debian/$(package_gtk_lib).$$f; \
93 done;
94 @for f in dirs files links postinst prerm; do \
95 echo "generating control file $(package_gtk_dev).$$f"; \
96 cp debian/libwxgtk-dev.$$f debian/$(package_gtk_dev).$$f; \
97 done;
98 @for f in dirs links postinst prerm; do \
99 echo "generating control file $(package_gtk_dbg).$$f"; \
100 cp debian/libwxgtk-dbg.$$f debian/$(package_gtk_dbg).$$f; \
101 done;
102 @for f in dirs docs files postinst prerm; do \
103 echo "generating control file $(package_gtk_py).$$f"; \
104 sed -e 's/=PY/$(python_dir)/g;s/=V/$(release)/g' < debian/libwxgtk-python.$$f \
105 > debian/$(package_gtk_py).$$f; \
106 done;
107 @for f in dirs postinst; do \
108 echo "generating control file $(package_gtk_contrib).$$f"; \
109 cp debian/libwxgtk-contrib.$$f debian/$(package_gtk_contrib).$$f; \
110 done;
111 @for f in dirs files; do \
112 echo "generating control file $(package_gtk_contrib_dev).$$f"; \
113 cp debian/libwxgtk-contrib-dev.$$f debian/$(package_gtk_contrib_dev).$$f; \
114 done;
115 @for f in dirs files; do \
116 echo "generating control file $(package_headers).$$f"; \
117 cp debian/wxwin-headers.$$f debian/$(package_headers).$$f; \
118 done;
119 @for f in dirs files; do \
120 echo "generating control file $(package_i18n).$$f"; \
121 cp debian/wxwin-i18n.$$f debian/$(package_i18n).$$f; \
122 done;
123 @for f in dirs docs doc-base; do \
124 echo "generating control file $(package_doc).$$f"; \
125 cp debian/wxwin-doc.$$f debian/$(package_doc).$$f; \
126 done;
127 @for f in examples; do \
128 echo "generating control file $(package_examples).$$f"; \
129 cp debian/wxwin-examples.$$f debian/$(package_examples).$$f; \
130 done;
131 touch $@
132
133 build_arch: control-files-stamp $(build_arch_stamps)
134
135 build: control-files-stamp $(build_stamps)
136
137 build-wxbase-shared-stamp:
138 dh_testdir
139 mkdir $(objdir_wxbase_shared)
140 cd $(objdir_wxbase_shared) \
141 && ../configure --prefix=/usr \
142 --cache-file=../config_deb.cache \
143 --disable-gui \
144 --enable-burnt_name \
145 --with-zlib=sys \
146 && $(MAKE)
147 touch $@
148
149 build-wxbase-static-stamp:
150 dh_testdir
151 mkdir $(objdir_wxbase_static)
152 cd $(objdir_wxbase_static) \
153 && ../configure --prefix=/usr \
154 --cache-file=../config_deb.cache \
155 --disable-gui \
156 --disable-shared \
157 --with-zlib=sys \
158 && $(MAKE)
159 touch $@
160
161 build-wxbase-debug-stamp:
162 dh_testdir
163 mkdir $(objdir_wxbase_debug)
164 cd $(objdir_wxbase_debug) \
165 && ../configure --prefix=/usr \
166 --cache-file=../config_deb.cache \
167 --disable-gui \
168 --enable-debug \
169 --enable-burnt_name \
170 --with-zlib=sys \
171 && $(MAKE)
172 touch $@
173
174 build-gtk-shared-stamp:
175 dh_testdir
176 mkdir $(objdir_gtk_shared)
177 cd $(objdir_gtk_shared) \
178 && ../configure --prefix=/usr \
179 --cache-file=../config_deb.cache \
180 --with-gtk \
181 --with-opengl \
182 --enable-burnt_name \
183 --with-zlib=sys \
184 --with-libjpeg=sys \
185 --with-libpng=sys \
186 --with-libtiff=sys \
187 && $(MAKE)
188 touch $@
189
190 build-gtk-static-stamp:
191 dh_testdir
192 mkdir $(objdir_gtk_static)
193 cd $(objdir_gtk_static) \
194 && ../configure --prefix=/usr \
195 --cache-file=../config_deb.cache \
196 --with-gtk \
197 --with-opengl \
198 --disable-shared \
199 --with-zlib=sys \
200 --with-libjpeg=sys \
201 --with-libpng=sys \
202 --with-libtiff=sys \
203 && $(MAKE)
204 touch $@
205
206 build-gtk-debug-stamp:
207 dh_testdir
208 mkdir $(objdir_gtk_debug)
209 cd $(objdir_gtk_debug) \
210 && ../configure --prefix=/usr \
211 --cache-file=../config_deb.cache \
212 --with-gtk \
213 --with-opengl \
214 --enable-debug \
215 --enable-burnt_name \
216 --with-zlib=sys \
217 --with-libjpeg=sys \
218 --with-libpng=sys \
219 --with-libtiff=sys \
220 && $(MAKE)
221 touch $@
222
223 build-contrib-shared-stamp: build-gtk-shared-stamp
224 dh_testdir
225 cd $(objdir_gtk_shared)/contrib/src \
226 && $(MAKE)
227 touch $@
228
229 build-contrib-static-stamp: build-gtk-static-stamp
230 dh_testdir
231 cd $(objdir_gtk_static)/contrib/src \
232 && $(MAKE)
233 touch $@
234
235 build-gtk-py-stamp: build-gtk-shared-stamp
236 dh_testdir
237 touch docs/lgpl.txt
238 cd wxPython \
239 && ./setup.py build IN_CVS_TREE=1
240 touch $@
241
242 build-doc-stamp: build-gtk-shared-stamp
243 dh_testdir
244 cd $(objdir_gtk_shared)/utils/tex2rtf/src \
245 && $(MAKE)
246 mkdir $(objdir_doc)
247 mkdir $(objdir_doc_cruft)
248 cd $(objdir_doc_cruft) \
249 && LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib \
250 ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \
251 ../docs/latex/wx/manual.tex ../$(objdir_doc)/wxwin.htm -twice -html
252 cp docs/latex/wx/*.gif $(objdir_doc)
253 rm -rf $(objdir_doc_cruft)
254 rm -f $(objdir_doc)/wxwin.con $(objdir_doc)/wxwin.hh* \
255 $(objdir_doc)/wxwin.htx $(objdir_doc)/wxwin.ref
256 touch $@
257
258 build-examples-stamp:
259 dh_testdir
260 mkdir $(objdir_examples)
261 cp -a samples $(objdir_examples)
262 cp -a demos $(objdir_examples)
263 cp -a wxPython/demo $(objdir_examples)/wxPython
264 @for d in $(objdir_examples)/demos $(objdir_examples)/samples; do \
265 (cd $$d \
266 && mv Makefile.in Makefile \
267 && rm -f configure* \
268 && find -name 'Makefile.in' -exec rm -f '{}' ';' \
269 && for f in $$(find -type d); do \
270 if [ -f $$f/makefile.unx ]; then \
271 mv $$f/makefile.unx $$f/Makefile; \
272 fi; \
273 done) \
274 done;
275 touch $@
276
277 build-i18n-stamp: build-gtk-shared-stamp
278 dh_testdir
279 cd $(objdir_i18n) \
280 && $(MAKE) allmo
281 touch $@
282
283 clean: debian/control
284 dh_testdir
285 dh_testroot
286 rm -rf config_deb.cache control-files-stamp $(build_stamps) $(objdirs)
287 rm -f docs/lgpl.txt
288 cd wxPython && ./setup.py clean
289 dh_clean
290 rm -f debian/$(package_wxbase_lib).*
291 rm -f debian/$(package_wxbase_dev).*
292 rm -f debian/$(package_wxbase_dbg).*
293 rm -f debian/$(package_gtk_lib).*
294 rm -f debian/$(package_gtk_dev).*
295 rm -f debian/$(package_gtk_dbg).*
296 rm -f debian/$(package_gtk_py).*
297 rm -f debian/$(package_gtk_contrib).*
298 rm -f debian/$(package_gtk_contrib_dev).*
299 rm -f debian/$(package_headers).*
300 rm -f debian/$(package_i18n).*
301 rm -f debian/$(package_doc).*
302 rm -f debian/$(package_examples).*
303
304 install_arch: build_arch $(install_all_arch)
305
306 install: build $(install_all)
307
308 install-wxbase-lib: DH_OPTIONS=-p$(package_wxbase_lib)
309 install-wxbase-lib: build-wxbase-shared-stamp
310 dh_testdir
311 dh_testroot
312 dh_clean -k
313 dh_installdirs
314 cp -a $(objdir_wxbase_shared)/lib/* debian/$(package_wxbase_lib)/usr/lib
315 cp $(objdir_wxbase_shared)/wxbase-config debian/$(package_wxbase_lib)/usr/bin/
316
317 install-wxbase-dev: DH_OPTIONS=-p$(package_wxbase_dev)
318 install-wxbase-dev: build-wxbase-static-stamp install-wxbase-lib
319 dh_testdir
320 dh_testroot
321 dh_clean -k
322 dh_installdirs
323 dh_movefiles --sourcedir=debian/$(package_wxbase_lib)
324 cp $(objdir_wxbase_static)/lib/*.a debian/$(package_wxbase_dev)/usr/lib
325
326 install-wxbase-dbg: DH_OPTIONS=-p$(package_wxbase_dbg)
327 install-wxbase-dbg: build-wxbase-debug-stamp
328 dh_testdir
329 dh_testroot
330 dh_clean -k
331 dh_installdirs
332 cp -a $(objdir_wxbase_debug)/lib/* debian/$(package_wxbase_dbg)/usr/lib
333 cp $(objdir_wxbase_debug)/wxbased-config debian/$(package_wxbase_dbg)/usr/bin/
334 cp debian/lintian-override debian/$(package_wxbase_dbg)/usr/share/lintian/overrides/$(package_wxbase_dbg)
335
336 install-gtk-lib: DH_OPTIONS=-p$(package_gtk_lib)
337 install-gtk-lib: build-gtk-shared-stamp
338 dh_testdir
339 dh_testroot
340 dh_clean -k
341 dh_installdirs
342 cd $(objdir_gtk_shared) \
343 && $(MAKE) install prefix=`pwd`/../debian/$(package_gtk_lib)/usr
344 rm -f debian/$(package_gtk_lib)/usr/bin/wx-config
345
346 install-gtk-dev: DH_OPTIONS=-p$(package_gtk_dev)
347 install-gtk-dev: build-gtk-static-stamp install-gtk-lib
348 dh_testdir
349 dh_testroot
350 dh_clean -k
351 dh_installdirs
352 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
353 cp $(objdir_gtk_static)/lib/libwx_gtk*.a debian/$(package_gtk_dev)/usr/lib
354
355 install-gtk-dbg: DH_OPTIONS=-p$(package_gtk_dbg)
356 install-gtk-dbg: build-gtk-debug-stamp
357 dh_testdir
358 dh_testroot
359 dh_clean -k
360 dh_installdirs
361 cp -a $(objdir_gtk_debug)/lib/* debian/$(package_gtk_dbg)/usr/lib
362 cp $(objdir_gtk_debug)/wxgtkd-config debian/$(package_gtk_dbg)/usr/bin/
363 cp debian/lintian-override debian/$(package_gtk_dbg)/usr/share/lintian/overrides/$(package_gtk_dbg)
364
365 install-gtk-contrib: DH_OPTIONS=-p$(package_gtk_contrib)
366 install-gtk-contrib: build-contrib-shared-stamp
367 dh_testdir
368 dh_testroot
369 dh_clean -k
370 dh_installdirs
371 cd $(objdir_gtk_shared)/contrib/src \
372 && $(MAKE) install prefix=`pwd`/../../../debian/$(package_gtk_contrib)/usr
373
374 install-gtk-contrib-dev: DH_OPTIONS=-p$(package_gtk_contrib_dev)
375 install-gtk-contrib-dev: build-contrib-static-stamp install-gtk-dev
376 dh_testdir
377 dh_testroot
378 dh_clean -k
379 dh_installdirs
380 dh_movefiles --sourcedir=debian/$(package_gtk_contrib)
381 cp $(objdir_gtk_static)/lib/*.a debian/$(package_gtk_contrib_dev)/usr/lib
382 rm -f debian/$(package_gtk_contrib_dev)/usr/lib/libwx_gtk*.a
383
384 install-gtk-py: DH_OPTIONS=-p$(package_gtk_py)
385 install-gtk-py: build-gtk-py-stamp
386 dh_testdir
387 dh_testroot
388 dh_clean -k
389 dh_installdirs
390 cd wxPython \
391 && ./setup.py install --prefix=`pwd`/../debian/$(package_gtk_py)/usr
392 find debian/$(package_gtk_py)/usr/lib/$(python_dir)/site-packages/wxPython \
393 -name '*.py?' -exec rm '{}' ';'
394
395 install-headers: DH_OPTIONS=-p$(package_headers)
396 install-headers: install-gtk-lib
397 dh_testdir
398 dh_testroot
399 dh_clean -k
400 dh_installdirs
401 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
402 dh_installmanpages \
403 ansi2knr.1 \
404 jpegtran.1 \
405 libpng.3 \
406 libpngpf.3 \
407 zlib.3 \
408 png.5
409
410 install-i18n: DH_OPTIONS=-p$(package_i18n)
411 install-i18n: build-i18n-stamp install-gtk-lib
412 dh_testdir
413 dh_testroot
414 dh_clean -k
415 dh_installdirs
416 dh_movefiles --sourcedir=debian/$(package_gtk_lib)
417
418 install-doc: DH_OPTIONS=-p$(package_doc)
419 install-doc: build-doc-stamp
420 dh_testdir
421 dh_testroot
422 dh_clean -k
423 dh_installdirs
424
425 install-examples: DH_OPTIONS=-p$(package_examples)
426 install-examples: build-examples-stamp
427 dh_testdir
428 dh_testroot
429 dh_clean -k
430 dh_installdirs
431
432 binary-common:
433 dh_testversion 1.1.17
434 dh_testdir
435 dh_testroot
436 dh_installdocs
437 dh_installchangelogs
438 dh_installexamples
439 dh_link
440 dh_strip -N$(package_gtk_dbg) -N$(package_wxbase_dbg)
441 dh_compress
442 dh_fixperms
443 dh_makeshlibs -N$(package_gtk_py)
444 dh_installdeb
445 dh_shlibdeps -ldebian/$(package_gtk_lib)/usr/lib
446 dh_gencontrol
447 dh_md5sums
448 dh_builddeb
449
450 # Build architecture-independent files here.
451 # Note that you currently can't build the indep packages without first
452 # building the arch specific package files needed to create them.
453 binary-indep: build install
454 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
455
456 # Build just the architecture-dependent files here.
457 binary-arch: build_arch install_arch
458 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
459
460 # Build all packages target.
461 binary: binary-arch binary-indep
462
463
464 ############################################################################
465 #
466 # Some rules to build a subset of the complete list of packages that can be
467 # built from CVS. Beware that packages produced with these rules may *NOT*
468 # be compatible with packages built using the 'binary' target or even with
469 # Debian policy. Do not distribute packages built with these rules, they
470 # are currently useful for rapid in-house testing by developers only.
471
472 # libwxgtk shared lib package
473 binary-gtk: control-files-stamp install-gtk-lib install-headers
474 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_lib) -p$(package_headers)" binary-common
475
476 binary-gtk-dev: control-files-stamp install-gtk-dev install-headers
477 $(MAKE) -f debian/rules \
478 DH_OPTIONS="-p$(package_gtk_lib) -p$(package_gtk_dev) -p$(package_headers)" \
479 binary-common
480
481 binary-gtk-dbg: control-files-stamp install-gtk-dbg install-headers
482 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_gtk_dbg) -p$(package_headers)" binary-common
483
484 # libwxbase shared lib package
485 binary-wxbase: control-files-stamp install-wxbase-lib install-headers
486 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_wxbase_lib) -p$(package_headers)" binary-common
487
488 binary-wxbase-dev: control-files-stamp install-wxbase-dev install-headers
489 $(MAKE) -f debian/rules \
490 DH_OPTIONS="-p$(package_wxbase_lib) -p$(package_wxbase_dev) -p$(package_headers)" \
491 binary-common
492
493 binary-wxbase-dbg: control-files-stamp install-wxbase-dbg install-headers
494 $(MAKE) -f debian/rules DH_OPTIONS="-p$(package_wxbase_dbg) -p$(package_headers)" binary-common
495
496 # docs package
497 binary-doc: control-files-stamp install-doc
498 $(MAKE) -f debian/rules DH_OPTIONS=-p$(package_doc) binary-common
499
500
501 .PHONY: build build_arch clean binary-indep binary-arch binary binary-common \
502 binary-gtk binary-gtk-dev binary-gtk-dbg binary-wxbase binary-wxbase-dev \
503 binary-wxbase-dbg binary-doc install install_arch install-wxbase-lib \
504 install-wxbase-dev install-wxbase-dbg install-gtk-lib install-gtk-dev \
505 install-gtk-dbg install-gtk-contrib install-gtk-contrib-dev \
506 install-gtk-py install-headers install-i18n install-doc install-examples
507