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