2 # debian/rules file to build packages from wxWindows CVS source
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.
13 release
:=$(shell dpkg-parsechangelog | sed
-n
's/^Source: wxwindows//p')
14 python_dir
:=python
$(shell python
-c
"import sys;print sys.version[:3]")
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
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
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
)
46 # note that the i18n package is actually arch indep (once built)
47 # but must be built (and installed) during the arch any phase as
48 # it's pulled out of the wxGtk shared lib package.
51 build_arch_stamps
=build-wxbase-shared-stamp build-wxbase-static-stamp \
52 build-wxbase-debug-stamp build-gtk-shared-stamp \
53 build-gtk-static-stamp build-gtk-debug-stamp \
54 build-contrib-shared-stamp build-contrib-static-stamp \
55 build-gtk-py-stamp build-i18n-stamp
57 build_indep_stamps
=build-examples-stamp build-doc-stamp
59 build_stamps
=$(build_arch_stamps
) $(build_indep_stamps
)
62 install_all_arch
=install-wxbase-lib install-wxbase-dev install-wxbase-dbg \
63 install-gtk-lib install-gtk-dev install-gtk-dbg \
64 install-gtk-contrib install-gtk-contrib-dev install-gtk-py \
65 install-headers install-i18n
67 install_all_indep
=install-examples install-doc
69 install_all
=$(install_all_arch
) $(install_all_indep
)
72 wxconfig
:=$(shell pwd
)/$(objdir_gtk_shared
)/wx-config \
73 --prefix=$(shell pwd
) \
74 --exec-prefix
=$(shell pwd
)/$(objdir_gtk_shared
)
79 debian
/control
: debian
/control.in
80 sed
-e
's/=V/$(release)/g' < debian
/control.in
> debian
/control
82 debian
/wxwin-doc.doc-base
: debian
/wxwin-doc.doc-base.in
83 sed
-e
's/=V/$(release)/g' < debian
/wxwin-doc.doc-base.in
> debian
/wxwin-doc.doc-base
85 control-files-stamp
: debian
/control debian
/wxwin-doc.doc-base
87 @for f in dirs postinst
; do \
88 echo
"generating control file $(package_wxbase_lib).$$f"; \
89 cp debian
/libwxbase.
$$f debian
/$(package_wxbase_lib
).
$$f; \
91 @for f in dirs files links postinst prerm
; do \
92 echo
"generating control file $(package_wxbase_dev).$$f"; \
93 cp debian
/libwxbase-dev.
$$f debian
/$(package_wxbase_dev
).
$$f; \
95 @for f in dirs links postinst prerm
; do \
96 echo
"generating control file $(package_wxbase_dbg).$$f"; \
97 cp debian
/libwxbase-dbg.
$$f debian
/$(package_wxbase_dbg
).
$$f; \
99 @for f in dirs postinst
; do \
100 echo
"generating control file $(package_gtk_lib).$$f"; \
101 cp debian
/libwxgtk.
$$f debian
/$(package_gtk_lib
).
$$f; \
103 @for f in dirs files links postinst prerm
; do \
104 echo
"generating control file $(package_gtk_dev).$$f"; \
105 cp debian
/libwxgtk-dev.
$$f debian
/$(package_gtk_dev
).
$$f; \
107 @for f in dirs links postinst prerm
; do \
108 echo
"generating control file $(package_gtk_dbg).$$f"; \
109 cp debian
/libwxgtk-dbg.
$$f debian
/$(package_gtk_dbg
).
$$f; \
111 @for f in dirs docs files postinst prerm
; do \
112 echo
"generating control file $(package_gtk_py).$$f"; \
113 sed
-e
's/=PY/$(python_dir)/g;s/=V/$(release)/g' < debian
/libwxgtk-python.
$$f \
114 > debian
/$(package_gtk_py
).
$$f; \
116 @for f in dirs postinst
; do \
117 echo
"generating control file $(package_gtk_contrib).$$f"; \
118 cp debian
/libwxgtk-contrib.
$$f debian
/$(package_gtk_contrib
).
$$f; \
120 @for f in dirs files
; do \
121 echo
"generating control file $(package_gtk_contrib_dev).$$f"; \
122 cp debian
/libwxgtk-contrib-dev.
$$f debian
/$(package_gtk_contrib_dev
).
$$f; \
124 @for f in dirs files
; do \
125 echo
"generating control file $(package_headers).$$f"; \
126 cp debian
/wxwin-headers.
$$f debian
/$(package_headers
).
$$f; \
128 @for f in dirs files
; do \
129 echo
"generating control file $(package_i18n).$$f"; \
130 cp debian
/wxwin-i18n.
$$f debian
/$(package_i18n
).
$$f; \
132 @for f in dirs docs doc-base
; do \
133 echo
"generating control file $(package_doc).$$f"; \
134 cp debian
/wxwin-doc.
$$f debian
/$(package_doc
).
$$f; \
136 @for f in examples
; do \
137 echo
"generating control file $(package_examples).$$f"; \
138 cp debian
/wxwin-examples.
$$f debian
/$(package_examples
).
$$f; \
142 build_arch
: control-files-stamp
$(build_arch_stamps
)
144 build
: control-files-stamp
$(build_stamps
)
146 build-wxbase-shared-stamp
:
148 mkdir
$(objdir_wxbase_shared
)
149 cd
$(objdir_wxbase_shared
) \
150 && ..
/configure
--prefix=/usr \
151 --cache-file
=..
/config_deb.cache \
153 --enable-burnt_name \
158 build-wxbase-static-stamp
:
160 mkdir
$(objdir_wxbase_static
)
161 cd
$(objdir_wxbase_static
) \
162 && ..
/configure
--prefix=/usr \
163 --cache-file
=..
/config_deb.cache \
170 build-wxbase-debug-stamp
:
172 mkdir
$(objdir_wxbase_debug
)
173 cd
$(objdir_wxbase_debug
) \
174 && ..
/configure
--prefix=/usr \
175 --cache-file
=..
/config_deb.cache \
178 --enable-burnt_name \
183 build-gtk-shared-stamp
:
185 mkdir
$(objdir_gtk_shared
)
186 cd
$(objdir_gtk_shared
) \
187 && ..
/configure
--prefix=/usr \
188 --cache-file
=..
/config_deb.cache \
191 --enable-burnt_name \
199 build-gtk-static-stamp
:
201 mkdir
$(objdir_gtk_static
)
202 cd
$(objdir_gtk_static
) \
203 && ..
/configure
--prefix=/usr \
204 --cache-file
=..
/config_deb.cache \
215 build-gtk-debug-stamp
:
217 mkdir
$(objdir_gtk_debug
)
218 cd
$(objdir_gtk_debug
) \
219 && ..
/configure
--prefix=/usr \
220 --cache-file
=..
/config_deb.cache \
224 --enable-burnt_name \
232 build-contrib-shared-stamp
: build-gtk-shared-stamp
234 cd
$(objdir_gtk_shared
)/contrib
/src \
238 build-contrib-static-stamp
: build-gtk-static-stamp
240 cd
$(objdir_gtk_static
)/contrib
/src \
244 build-gtk-py-stamp
: build-gtk-shared-stamp
248 && .
/setup.py build IN_CVS_TREE
=1 WX_CONFIG
='$(wxconfig)'
251 build-doc-stamp
: build-gtk-shared-stamp
253 cd
$(objdir_gtk_shared
)/utils
/tex2rtf
/src \
256 mkdir
$(objdir_doc_cruft
)
257 cd
$(objdir_doc_cruft
) \
258 && LD_LIBRARY_PATH
=..
/$(objdir_gtk_shared
)/lib \
259 ..
/$(objdir_gtk_shared
)/utils
/tex2rtf
/src
/tex2rtf \
260 ..
/docs
/latex
/wx
/manual.
tex ..
/$(objdir_doc
)/wxwin.htm
-twice
-html
261 cp docs
/latex
/wx
/*.gif
$(objdir_doc
)
262 rm -rf
$(objdir_doc_cruft
)
263 rm -f
$(objdir_doc
)/wxwin.con
$(objdir_doc
)/wxwin.hh
* \
264 $(objdir_doc
)/wxwin.htx
$(objdir_doc
)/wxwin.ref
267 build-examples-stamp
:
269 mkdir
$(objdir_examples
)
270 cp
-a samples
$(objdir_examples
)
271 cp
-a demos
$(objdir_examples
)
272 cp
-a wxPython
/demo
$(objdir_examples
)/wxPython
273 @for d in
$(objdir_examples
)/demos
$(objdir_examples
)/samples
; do \
275 && mv Makefile.in Makefile \
276 && rm -f configure
* \
277 && find
-name
'Makefile.in' -exec
rm -f
'{}' ';' \
278 && for f in
$$(find
-type d
); do \
279 if
[ -f
$$f/makefile.unx
]; then \
280 mv
$$f/makefile.unx
$$f/Makefile
; \
286 build-i18n-stamp
: build-gtk-shared-stamp
292 clean: debian
/control
295 rm -rf config_deb.cache control-files-stamp
$(build_stamps
) $(objdirs
)
297 cd wxPython
&& .
/setup.py
clean
299 rm -f debian
/$(package_wxbase_lib
).
*
300 rm -f debian
/$(package_wxbase_dev
).
*
301 rm -f debian
/$(package_wxbase_dbg
).
*
302 rm -f debian
/$(package_gtk_lib
).
*
303 rm -f debian
/$(package_gtk_dev
).
*
304 rm -f debian
/$(package_gtk_dbg
).
*
305 rm -f debian
/$(package_gtk_py
).
*
306 rm -f debian
/$(package_gtk_contrib
).
*
307 rm -f debian
/$(package_gtk_contrib_dev
).
*
308 rm -f debian
/$(package_headers
).
*
309 rm -f debian
/$(package_i18n
).
*
310 rm -f debian
/$(package_doc
).
*
311 rm -f debian
/$(package_examples
).
*
313 install_arch
: build_arch
$(install_all_arch
)
315 install: build
$(install_all
)
317 install-wxbase-lib
: DH_OPTIONS
=-p
$(package_wxbase_lib
)
318 install-wxbase-lib
: build-wxbase-shared-stamp
323 cp
-a
$(objdir_wxbase_shared
)/lib
/* debian
/$(package_wxbase_lib
)/usr
/lib
324 cp
$(objdir_wxbase_shared
)/wxbase-config debian
/$(package_wxbase_lib
)/usr
/bin
/
326 install-wxbase-dev
: DH_OPTIONS
=-p
$(package_wxbase_dev
)
327 install-wxbase-dev
: build-wxbase-static-stamp install-wxbase-lib
332 dh_movefiles
--sourcedir
=debian
/$(package_wxbase_lib
)
333 cp
$(objdir_wxbase_static
)/lib
/*.a debian
/$(package_wxbase_dev
)/usr
/lib
335 install-wxbase-dbg
: DH_OPTIONS
=-p
$(package_wxbase_dbg
)
336 install-wxbase-dbg
: build-wxbase-debug-stamp
341 cp
-a
$(objdir_wxbase_debug
)/lib
/* debian
/$(package_wxbase_dbg
)/usr
/lib
342 cp
$(objdir_wxbase_debug
)/wxbased-config debian
/$(package_wxbase_dbg
)/usr
/bin
/
343 cp debian
/lintian-override debian
/$(package_wxbase_dbg
)/usr
/share
/lintian
/overrides
/$(package_wxbase_dbg
)
345 install-gtk-lib
: DH_OPTIONS
=-p
$(package_gtk_lib
)
346 install-gtk-lib
: build-gtk-shared-stamp
351 cd
$(objdir_gtk_shared
) \
352 && $(MAKE
) install prefix=`pwd`/..
/debian
/$(package_gtk_lib
)/usr
353 rm -f debian
/$(package_gtk_lib
)/usr
/bin
/wx-config
355 install-gtk-dev
: DH_OPTIONS
=-p
$(package_gtk_dev
)
356 install-gtk-dev
: build-gtk-static-stamp install-gtk-lib
361 dh_movefiles
--sourcedir
=debian
/$(package_gtk_lib
)
362 cp
$(objdir_gtk_static
)/lib
/libwx_gtk
*.a debian
/$(package_gtk_dev
)/usr
/lib
364 install-gtk-dbg
: DH_OPTIONS
=-p
$(package_gtk_dbg
)
365 install-gtk-dbg
: build-gtk-debug-stamp
370 cp
-a
$(objdir_gtk_debug
)/lib
/* debian
/$(package_gtk_dbg
)/usr
/lib
371 cp
$(objdir_gtk_debug
)/wxgtkd-config debian
/$(package_gtk_dbg
)/usr
/bin
/
372 cp debian
/lintian-override debian
/$(package_gtk_dbg
)/usr
/share
/lintian
/overrides
/$(package_gtk_dbg
)
374 install-gtk-contrib
: DH_OPTIONS
=-p
$(package_gtk_contrib
)
375 install-gtk-contrib
: build-contrib-shared-stamp
380 cd
$(objdir_gtk_shared
)/contrib
/src \
381 && $(MAKE
) install prefix=`pwd`/..
/..
/..
/debian
/$(package_gtk_contrib
)/usr
383 install-gtk-contrib-dev
: DH_OPTIONS
=-p
$(package_gtk_contrib_dev
)
384 install-gtk-contrib-dev
: build-contrib-static-stamp install-gtk-dev
389 dh_movefiles
--sourcedir
=debian
/$(package_gtk_contrib
)
390 cp
$(objdir_gtk_static
)/lib
/*.a debian
/$(package_gtk_contrib_dev
)/usr
/lib
391 rm -f debian
/$(package_gtk_contrib_dev
)/usr
/lib
/libwx_gtk
*.a
393 install-gtk-py
: DH_OPTIONS
=-p
$(package_gtk_py
)
394 install-gtk-py
: build-gtk-py-stamp
400 && .
/setup.py
install --prefix=`pwd`/..
/debian
/$(package_gtk_py
)/usr
401 find debian
/$(package_gtk_py
)/usr
/lib
/$(python_dir
)/site-packages
/wxPython \
402 -name
'*.py?' -exec
rm '{}' ';'
404 install-headers
: DH_OPTIONS
=-p
$(package_headers
)
405 install-headers
: install-gtk-lib
410 dh_movefiles
--sourcedir
=debian
/$(package_gtk_lib
)
419 install-i18n
: DH_OPTIONS
=-p
$(package_i18n
)
420 install-i18n
: build-i18n-stamp install-gtk-lib
425 dh_movefiles
--sourcedir
=debian
/$(package_gtk_lib
)
427 install-doc
: DH_OPTIONS
=-p
$(package_doc
)
428 install-doc
: build-doc-stamp
434 install-examples
: DH_OPTIONS
=-p
$(package_examples
)
435 install-examples
: build-examples-stamp
448 dh_strip
-N
$(package_gtk_dbg
) -N
$(package_wxbase_dbg
)
451 dh_makeshlibs
-N
$(package_gtk_py
) -V
453 dh_shlibdeps
-ldebian
/$(package_gtk_lib
)/usr
/lib
458 # Build architecture-independent files here.
459 # Note that you currently can't build the indep packages without first
460 # building the arch specific package files needed to create them.
461 binary-indep
: build
install
462 $(MAKE
) -f debian
/rules DH_OPTIONS
=-i binary-common
464 # Build just the architecture-dependent files here.
465 binary-arch
: build_arch install_arch
466 $(MAKE
) -f debian
/rules DH_OPTIONS
=-a binary-common
468 # Build all packages target.
469 binary
: binary-arch binary-indep
472 ############################################################################
474 # Some rules to build a subset of the complete list of packages that can be
475 # built from CVS. Beware that packages produced with these rules may *NOT*
476 # be compatible with packages built using the 'binary' target or even with
477 # Debian policy. Do not distribute packages built with these rules, they
478 # are currently useful for rapid in-house testing by developers only.
480 # libwxgtk shared lib package
481 binary-gtk
: control-files-stamp install-gtk-lib install-headers
482 $(MAKE
) -f debian
/rules DH_OPTIONS
="-p$(package_gtk_lib) -p$(package_headers)" binary-common
484 binary-gtk-dev
: control-files-stamp install-gtk-dev install-headers
485 $(MAKE
) -f debian
/rules \
486 DH_OPTIONS
="-p$(package_gtk_lib) -p$(package_gtk_dev) -p$(package_headers)" \
489 binary-gtk-dbg
: control-files-stamp install-gtk-dbg install-headers
490 $(MAKE
) -f debian
/rules DH_OPTIONS
="-p$(package_gtk_dbg) -p$(package_headers)" binary-common
492 # libwxbase shared lib package
493 binary-wxbase
: control-files-stamp install-wxbase-lib install-headers
494 $(MAKE
) -f debian
/rules DH_OPTIONS
="-p$(package_wxbase_lib) -p$(package_headers)" binary-common
496 binary-wxbase-dev
: control-files-stamp install-wxbase-dev install-headers
497 $(MAKE
) -f debian
/rules \
498 DH_OPTIONS
="-p$(package_wxbase_lib) -p$(package_wxbase_dev) -p$(package_headers)" \
501 binary-wxbase-dbg
: control-files-stamp install-wxbase-dbg install-headers
502 $(MAKE
) -f debian
/rules DH_OPTIONS
="-p$(package_wxbase_dbg) -p$(package_headers)" binary-common
505 binary-doc
: control-files-stamp install-doc
506 $(MAKE
) -f debian
/rules DH_OPTIONS
=-p
$(package_doc
) binary-common
509 .PHONY
: build build_arch
clean binary-indep binary-arch binary binary-common \
510 binary-gtk binary-gtk-dev binary-gtk-dbg binary-wxbase binary-wxbase-dev \
511 binary-wxbase-dbg binary-doc
install install_arch install-wxbase-lib \
512 install-wxbase-dev install-wxbase-dbg install-gtk-lib install-gtk-dev \
513 install-gtk-dbg install-gtk-contrib install-gtk-contrib-dev \
514 install-gtk-py install-headers install-i18n install-doc install-examples