]> git.saurik.com Git - wxWidgets.git/blob - debian/rules
More framework fixes and fixes for building dlls.
[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 # (including a debhelper template, GNU copyright 1997 to 1999 by
7 # Joey Hess, and some ideas found in the ncurses rules file that
8 # I quite liked. Thanks!)
9
10 #export DH_VERBOSE=1
11 export DH_COMPAT=2
12
13 release:=$(shell dpkg-parsechangelog | sed -n 's/^Source: wxwindows//p')
14
15 # Packages to build:
16 package_wxbase_lib=libwxbase$(release)
17 package_wxbase_dev=libwxbase$(release)-dev
18 package_gtk_lib=libwxgtk$(release)
19 package_gtk_dev=libwxgtk$(release)-dev
20 package_gtk_py=libwxgtk$(release)-python
21 package_doc=wxwin$(release)-doc
22 package_examples=wxwin$(release)-examples
23
24 # Build directories:
25 objdir_wxbase_shared=objs_wxbase_sh
26 objdir_wxbase_static=objs_wxbase_st
27 objdir_gtk_shared=objs_gtk_sh
28 objdir_gtk_static=objs_gtk_st
29 objdir_doc_cruft=objs_doc_con
30 objdir_doc=docs/wxWindows-manual.html
31 objdir_examples=docs/examples
32 objdirs=$(objdir_wxbase_shared) $(objdir_wxbase_static) $(objdir_gtk_shared) \
33 $(objdir_gtk_static) $(objdir_doc) $(objdir_examples)
34
35 build_stamps=build-wxbase-shared-stamp build-wxbase-static-stamp \
36 build-gtk-shared-stamp build-gtk-static-stamp \
37 build-gtk-python-stamp build-examples-stamp build-doc-stamp
38
39 wxconfig:=$(shell pwd)/$(objdir_gtk_shared)/wx-config \
40 --prefix=$(shell pwd) \
41 --exec-prefix=$(shell pwd)/$(objdir_gtk_shared)
42
43
44 # The Rules:
45
46 debian/control: debian/control.in
47 sed -e 's/=V/$(release)/g' < debian/control.in > debian/control
48
49 debian/wxwin-doc.doc-base: debian/wxwin-doc.doc-base.in
50 sed -e 's/=V/$(release)/g' < debian/wxwin-doc.doc-base.in > debian/wxwin-doc.doc-base
51
52 build: debian/control debian/wxwin-doc.doc-base $(build_stamps)
53
54 build-wxbase-shared-stamp:
55 dh_testdir
56 mkdir $(objdir_wxbase_shared)
57 cd $(objdir_wxbase_shared) \
58 && ../configure --prefix=/usr --disable-gui --enable-burnt_name \
59 && $(MAKE)
60 touch $@
61
62 build-wxbase-static-stamp:
63 dh_testdir
64 mkdir $(objdir_wxbase_static)
65 cd $(objdir_wxbase_static) \
66 && ../configure --prefix=/usr --disable-gui --disable-shared \
67 && $(MAKE)
68 touch $@
69
70 build-gtk-shared-stamp:
71 dh_testdir
72 mkdir $(objdir_gtk_shared)
73 cd $(objdir_gtk_shared) \
74 && ../configure --prefix=/usr --with-gtk --enable-burnt_name --disable-newgrid \
75 && $(MAKE)
76 touch $@
77
78 build-gtk-static-stamp:
79 dh_testdir
80 mkdir $(objdir_gtk_static)
81 cd $(objdir_gtk_static) \
82 && ../configure --prefix=/usr --with-gtk --disable-shared \
83 && $(MAKE)
84 touch $@
85
86 build-gtk-python-stamp: build-gtk-shared-stamp
87 dh_testdir
88 cd utils/wxPython/src \
89 && touch gtk/*.cpp gtk/*.py \
90 && ../distrib/build.py -b WXDIR=../../.. WXCONFIG='$(wxconfig)'
91 cd utils/wxPython/modules/html \
92 && ../../distrib/build.py -b WXDIR=../../../.. WXCONFIG='$(wxconfig)'
93 cd utils/wxPython/modules/utils \
94 && ../../distrib/build.py -b WXDIR=../../../.. WXCONFIG='$(wxconfig)'
95 touch $@
96
97 build-doc-stamp: build-gtk-shared-stamp
98 dh_testdir
99 cd $(objdir_gtk_shared)/utils/tex2rtf/src \
100 && $(MAKE)
101 mkdir $(objdir_doc)
102 mkdir $(objdir_doc_cruft)
103 cd $(objdir_doc_cruft) \
104 && LD_LIBRARY_PATH=../$(objdir_gtk_shared)/lib \
105 ../$(objdir_gtk_shared)/utils/tex2rtf/src/tex2rtf \
106 ../docs/latex/wx/manual.tex ../$(objdir_doc)/wxwin.htm -twice -html
107 cp docs/latex/wx/*.gif $(objdir_doc)
108 rm -rf $(objdir_doc_cruft)
109 rm -f $(objdir_doc)/wxwin.con $(objdir_doc)/wxwin.hh* \
110 $(objdir_doc)/wxwin.htx $(objdir_doc)/wxwin.ref
111 touch $@
112
113 build-examples-stamp:
114 dh_testdir
115 mkdir $(objdir_examples)
116 cp -a samples $(objdir_examples)
117 cp -a demos $(objdir_examples)
118 cp -a utils/wxPython/demo $(objdir_examples)/wxPython
119 @for d in $(objdir_examples)/demos $(objdir_examples)/samples; do \
120 (cd $$d \
121 && mv Makefile.in Makefile \
122 && rm -f configure* \
123 && find -name 'Makefile.in' -exec rm -f '{}' ';' \
124 && for f in $$(find -type d); do \
125 if [ -f $$f/makefile.unx ]; then \
126 mv $$f/makefile.unx $$f/Makefile; \
127 fi; \
128 done) \
129 done;
130 touch $@
131
132 clean: debian/control
133 dh_testdir
134 dh_testroot
135 rm -rf $(build_stamps) $(objdirs)
136 -cd utils/wxPython/src && $(MAKE) clean
137 -cd utils/wxPython/modules/html && $(MAKE) clean
138 -cd utils/wxPython/modules/utils && $(MAKE) clean
139 dh_clean
140 rm -f debian/$(package_wxbase_lib).*
141 rm -f debian/$(package_wxbase_dev).*
142 rm -f debian/$(package_gtk_lib).*
143 rm -f debian/$(package_gtk_dev).*
144 rm -f debian/$(package_gtk_py).*
145 rm -f debian/$(package_doc).*
146 rm -f debian/$(package_examples).*
147
148 install: build
149 dh_testdir
150 dh_testroot
151 @for f in dirs docs files postinst; do \
152 echo "generating control file $(package_wxbase_lib).$$f"; \
153 cp debian/libwxbase.$$f debian/$(package_wxbase_lib).$$f; \
154 done;
155 @for f in dirs docs files links postinst prerm; do \
156 echo "generating control file $(package_wxbase_dev).$$f"; \
157 cp debian/libwxbase-dev.$$f debian/$(package_wxbase_dev).$$f; \
158 done;
159 @for f in dirs docs files postinst; do \
160 echo "generating control file $(package_gtk_lib).$$f"; \
161 cp debian/libwxgtk.$$f debian/$(package_gtk_lib).$$f; \
162 done;
163 @for f in dirs docs files links postinst prerm; do \
164 echo "generating control file $(package_gtk_dev).$$f"; \
165 cp debian/libwxgtk-dev.$$f debian/$(package_gtk_dev).$$f; \
166 done;
167 @for f in dirs docs files postinst prerm; do \
168 echo "generating control file $(package_gtk_py).$$f"; \
169 cp debian/libwxgtk-python.$$f debian/$(package_gtk_py).$$f; \
170 done;
171 @for f in dirs docs doc-base; do \
172 echo "generating control file $(package_doc).$$f"; \
173 cp debian/wxwin-doc.$$f debian/$(package_doc).$$f; \
174 done;
175 @for f in docs examples; do \
176 echo "generating control file $(package_examples).$$f"; \
177 cp debian/wxwin-examples.$$f debian/$(package_examples).$$f; \
178 done;
179 dh_clean -k
180 dh_installdirs
181 cd $(objdir_gtk_shared) \
182 && $(MAKE) install prefix=`pwd`/../debian/tmp/usr
183 rm -f debian/tmp/usr/bin/wx-config
184 cp $(objdir_gtk_static)/lib/*.a debian/tmp/usr/lib
185 cp -a $(objdir_wxbase_shared)/lib/* debian/tmp/usr/lib
186 cp $(objdir_wxbase_shared)/wxbase-config debian/tmp/usr/bin/
187 cp $(objdir_wxbase_static)/lib/*.a debian/tmp/usr/lib
188 cd utils/wxPython/src \
189 && ../distrib/build.py -i \
190 TARGETDIR=../../../debian/tmp/usr/lib/python1.5/site-packages/wxPython \
191 HELPERLIBDIR=../../../debian/tmp/usr/lib \
192 WXDIR=../../..
193 cd utils/wxPython/modules/html \
194 && ../../distrib/build.py -i \
195 TARGETDIR=../../../../debian/tmp/usr/lib/python1.5/site-packages/wxPython \
196 WXDIR=../../../..
197 cd utils/wxPython/modules/utils \
198 && ../../distrib/build.py -i \
199 TARGETDIR=../../../../debian/tmp/usr/lib/python1.5/site-packages/wxPython \
200 WXDIR=../../../..
201 rm -rf debian/tmp/usr/lib/python1.5/site-packages/wxPython/demo
202 find debian/tmp/usr/lib/python1.5/site-packages/wxPython \
203 -name '*.py?' -exec rm '{}' ';'
204 dh_movefiles
205
206
207 # Build architecture-independent files here.
208 binary-indep: build install
209 # nothing to do.
210
211 # Build architecture-dependent files here.
212 binary-arch: build install
213 dh_testdir
214 dh_testroot
215 dh_installdocs
216 dh_installmanpages -p$(package_gtk_dev) \
217 ansi2knr.1 \
218 jpegtran.1 \
219 libpng.3 \
220 libpngpf.3 \
221 zlib.3 \
222 png.5
223 dh_installchangelogs
224 dh_installexamples
225 dh_link
226 dh_strip
227 dh_compress
228 dh_fixperms
229 dh_makeshlibs
230 dh_installdeb
231 dh_shlibdeps -ldebian/$(package_gtk_lib)/usr/lib:debian/$(package_gtk_py)/usr/lib
232 dh_gencontrol
233 dh_md5sums
234 dh_builddeb
235
236 binary: binary-indep binary-arch
237 .PHONY: build clean binary-indep binary-arch binary install