Fix wxGTK compilation.
[wxWidgets.git] / wxGTK.spec
1 %define pref /usr
2 %define ver 2.5.3
3 %define ver2 2.5
4 %define rel 1
5
6 # Configurable settings (use --with(out) {unicode,gtk2} on rpmbuild cmd line):
7 %define unicode 0
8 %{?_with_unicode: %{expand: %%define unicode 1}}
9 %{?_without_unicode: %{expand: %%define unicode 0}}
10
11 %define gtk2 0
12 %{?_with_gtk2: %{expand: %%define gtk2 1}}
13 %{?_without_gtk2: %{expand: %%define gtk2 0}}
14
15 %if %{gtk2}
16 %define gtkver 2
17 %define portname gtk2
18 %else
19 %define gtkver 1.2
20 %define portname gtk
21 %endif
22
23 %if %{unicode}
24 %define name wx-%{portname}-unicode
25 %define wxbasename wx-base-unicode
26 %else
27 %define name wx-%{portname}
28 %define wxbasename wx-base
29 %endif
30
31 %if %{unicode}
32 %define wxconfigname wx%{portname}u-%{ver2}-config
33 %else
34 %define wxconfigname wx%{portname}-%{ver2}-config
35 %endif
36
37 Name: %{name}
38 Summary: The GTK+ %{gtkver} port of the wxWindows library
39 Version: %{ver}
40 Release: %{rel}
41 License: wxWindows Licence
42 Group: X11/Libraries
43 Source: wxGTK-%{ver}.tar.bz2
44 URL: http://www.wxwindows.org
45 Packager: Vadim Zeitlin <vadim@wxwindows.org>
46 Prefix: %{pref}
47 BuildRoot: /var/tmp/%{name}-root
48
49 # all packages providing an implementation of wxWindows library (regardless of
50 # the toolkit used) should provide the (virtual) wxwin package, this makes it
51 # possible to require wxwin instead of requiring "wxgtk or wxmotif or wxuniv..."
52 Provides: wxwin
53 Provides: wxGTK
54
55 # in addition, we should provide libwx_gtk as automatic generator only notices
56 # libwx_gtk-%{ver}-%{rel}
57 Provides: libwx_gtk.so
58 Provides: libwx_gtk-%{ver2}.so
59
60 Requires: %{wxbasename} = %{ver}
61
62 %description
63 wxWindows is a free C++ library for cross-platform GUI development.
64 With wxWindows, you can create applications for different GUIs (GTK+,
65 Motif/LessTif, MS Windows, Mac) from the same source code.
66
67 %package devel
68 Summary: The GTK+ %{gtkver} port of the wxWindows library
69 Group: X11/Libraries
70 Requires: %{name} = %{ver}
71 Requires: %{wxbasename}-devel = %{ver}
72 Provides: wxGTK-devel
73
74 %description devel
75 Header files for wxGTK, the GTK+ %{gtkver} port of the wxWindows library.
76
77 %package gl
78 Summary: The GTK+ %{gtkver} port of the wxWindows library, OpenGL add-on.
79 Group: X11/Libraries
80 Requires: %{name} = %{ver}
81
82 %description gl
83 OpenGL add-on library for wxGTK, the GTK+ %{gtkver} port of the wxWindows library.
84
85 %package static
86 Summary: wxGTK static libraries
87 Group: Development/Libraries
88 Requires: %{wxbasename}-static
89
90 %description static
91 Static libraries for wxGTK. You need them if you want to link statically against wxGTK.
92
93 %package contrib
94 Summary: The GTK+ %{gtkver} port of the wxWindows library, contributed libraries.
95 Group: X11/Libraries
96 Requires: %{name} = %{ver}
97
98 %description contrib
99 Contributed libraries for wxGTK, the GTK+ %{gtkver} port of the wxWindows library.
100
101 %package contrib-devel
102 Summary: The GTK+ %{gtkver} port of the wxWindows library
103 Group: X11/Libraries
104 Requires: %{name}-contrib = %{ver}
105 Requires: %{name}-devel = %{ver}
106
107 %description contrib-devel
108 Header files for contributed libraries for wxGTK, the GTK+ %{gtkver} port of the wxWindows library.
109
110 %prep
111 %setup -q -n wxGTK-%{ver}
112
113 %build
114 if [ "$SMP" != "" ]; then
115 export MAKE="make -j$SMP"
116 else
117 export MAKE="make"
118 fi
119
120 mkdir obj-shared
121 cd obj-shared
122 ../configure --prefix=%{pref} \
123 %if %{unicode}
124 --enable-unicode \
125 %else
126 --with-odbc \
127 %endif
128 %if %{gtk2}
129 --enable-gtk2 \
130 %endif
131 --with-opengl
132 $MAKE
133 cd contrib/src
134 $MAKE
135 cd ../../..
136
137 mkdir obj-static
138 cd obj-static
139 ../configure --prefix=%{pref} --disable-shared \
140 %if %{unicode}
141 --enable-unicode \
142 %else
143 --with-odbc \
144 %endif
145 %if %{gtk2}
146 --enable-gtk2 \
147 %endif
148 --with-opengl
149 $MAKE
150 cd ..
151
152 %install
153 rm -rf $RPM_BUILD_ROOT
154 (cd obj-static; make prefix=$RPM_BUILD_ROOT%{pref} install)
155 (cd obj-shared; make prefix=$RPM_BUILD_ROOT%{pref} install)
156
157 # Remove headers that are part of wx-base-devel:
158
159 # --- wxBase headers list begins here ---
160 cat <<EOF >wxbase-headers-list
161 wx/afterstd.h
162 wx/app.h
163 wx/apptrait.h
164 wx/archive.h
165 wx/arrimpl.cpp
166 wx/arrstr.h
167 wx/beforestd.h
168 wx/buffer.h
169 wx/build.h
170 wx/chkconf.h
171 wx/clntdata.h
172 wx/cmdline.h
173 wx/confbase.h
174 wx/config.h
175 wx/containr.h
176 wx/datetime.h
177 wx/datetime.inl
178 wx/datstrm.h
179 wx/dde.h
180 wx/debug.h
181 wx/defs.h
182 wx/dir.h
183 wx/dlimpexp.h
184 wx/dynarray.h
185 wx/dynlib.h
186 wx/dynload.h
187 wx/encconv.h
188 wx/event.h
189 wx/except.h
190 wx/features.h
191 wx/ffile.h
192 wx/file.h
193 wx/fileconf.h
194 wx/filefn.h
195 wx/filename.h
196 wx/filesys.h
197 wx/fontenc.h
198 wx/fontmap.h
199 wx/fs_mem.h
200 wx/fs_zip.h
201 wx/hash.h
202 wx/hashmap.h
203 wx/hashset.h
204 wx/iconloc.h
205 wx/init.h
206 wx/intl.h
207 wx/iosfwrap.h
208 wx/ioswrap.h
209 wx/ipc.h
210 wx/ipcbase.h
211 wx/isql.h
212 wx/isqlext.h
213 wx/list.h
214 wx/listimpl.cpp
215 wx/log.h
216 wx/longlong.h
217 wx/math.h
218 wx/memconf.h
219 wx/memory.h
220 wx/memtext.h
221 wx/mimetype.h
222 wx/module.h
223 wx/msgout.h
224 wx/msgout.h
225 wx/mstream.h
226 wx/object.h
227 wx/platform.h
228 wx/process.h
229 wx/ptr_scpd.h
230 wx/regex.h
231 wx/scopeguard.h
232 wx/snglinst.h
233 wx/sstream.h
234 wx/stack.h
235 wx/stdpaths.h
236 wx/stockitem.h
237 wx/stopwatch.h
238 wx/strconv.h
239 wx/stream.h
240 wx/string.h
241 wx/sysopt.h
242 wx/textbuf.h
243 wx/textfile.h
244 wx/thread.h
245 wx/thrimpl.cpp
246 wx/timer.h
247 wx/tokenzr.h
248 wx/txtstrm.h
249 wx/types.h
250 wx/uri.h
251 wx/utils.h
252 wx/variant.h
253 wx/vector.h
254 wx/version.h
255 wx/volume.h
256 wx/wfstream.h
257 wx/wx.h
258 wx/wxchar.h
259 wx/wxprec.h
260 wx/xti.h
261 wx/xtistrm.h
262 wx/zipstrm.h
263 wx/zstream.h
264 wx/msw/apptrait.h
265 wx/msw/apptbase.h
266 wx/msw/chkconf.h
267 wx/msw/crashrpt.h
268 wx/msw/dde.h
269 wx/msw/gccpriv.h
270 wx/msw/mimetype.h
271 wx/msw/winundef.h
272 wx/msw/wrapcctl.h
273 wx/msw/wrapwin.h
274 wx/fs_inet.h
275 wx/gsocket.h
276 wx/protocol/file.h
277 wx/protocol/ftp.h
278 wx/protocol/http.h
279 wx/protocol/protocol.h
280 wx/sckaddr.h
281 wx/sckipc.h
282 wx/sckstrm.h
283 wx/socket.h
284 wx/url.h
285 wx/msw/gsockmsw.h
286 wx/xml/xml.h
287 wx/xtixml.h
288 wx/db.h
289 wx/dbkeyg.h
290 wx/dbtable.h
291 EOF
292 # --- wxBase headers list ends here ---
293 for f in `cat wxbase-headers-list` ; do
294 rm -f $RPM_BUILD_ROOT%{_includedir}/wx-*/$f
295 done
296
297 # list of all core headers:
298 find $RPM_BUILD_ROOT/usr/include/wx -type f | sed -e "s,$RPM_BUILD_ROOT,,g" >core-headers.files
299
300 # contrib stuff:
301 (cd obj-shared/contrib/src; make prefix=$RPM_BUILD_ROOT%{pref} install)
302 (cd obj-shared/contrib/utils/wxrc; make prefix=$RPM_BUILD_ROOT%{pref} install)
303
304 # remove wxBase files so that RPM doesn't complain about unpackaged files:
305 rm -f $RPM_BUILD_ROOT%{_libdir}/libwx_base*
306 rm -f $RPM_BUILD_ROOT%{_datadir}/aclocal/*
307 rm -f $RPM_BUILD_ROOT%{_datadir}/locale/*/*/*
308
309 %clean
310 rm -rf $RPM_BUILD_ROOT
311
312 %post
313 /sbin/ldconfig
314
315 %postun
316 /sbin/ldconfig
317
318 %post gl
319 /sbin/ldconfig
320
321 %postun gl
322 /sbin/ldconfig
323
324
325 %files
326 %defattr(-,root,root)
327 %doc COPYING.LIB *.txt
328 %dir %{_datadir}/wx
329 %{_datadir}/wx/*
330 %{_libdir}/libwx_%{portname}*_core*.so.*
331 %{_libdir}/libwx_%{portname}*_html*.so.*
332 %{_libdir}/libwx_%{portname}*_adv*.so.*
333 %if !%{unicode}
334 %{_libdir}/libwx_%{portname}*_dbgrid*.so.*
335 %endif
336
337 %files devel -f core-headers.files
338 %defattr(-,root,root)
339 %{_libdir}/libwx_%{portname}*_core*.so
340 %{_libdir}/libwx_%{portname}*_html*.so
341 %{_libdir}/libwx_%{portname}*_adv*.so
342 %if !%{unicode}
343 %{_libdir}/libwx_%{portname}*_dbgrid*.so
344 %endif
345 %{_libdir}/libwx_%{portname}*_gl*.so
346 %dir %{_libdir}/wx
347 %{_libdir}/wx/*
348 %{_bindir}/%{wxconfigname}
349
350 %files gl
351 %defattr(-,root,root)
352 %{_libdir}/libwx_%{portname}*_gl*.so.*
353
354 %files static
355 %defattr (-,root,root)
356 %{_libdir}/libwx_gtk*.a
357
358 %files contrib
359 %defattr(-,root,root)
360 %{_libdir}/libwx_%{portname}*_animate*.so.*
361 %{_libdir}/libwx_%{portname}*_deprecated*.so.*
362 %{_libdir}/libwx_%{portname}*_fl*.so.*
363 %{_libdir}/libwx_%{portname}*_gizmos*.so.*
364 %{_libdir}/libwx_%{portname}*_mmedia*.so.*
365 %{_libdir}/libwx_%{portname}*_ogl*.so.*
366 %{_libdir}/libwx_%{portname}*_plot*.so.*
367 %{_libdir}/libwx_%{portname}*_stc*.so.*
368 %{_libdir}/libwx_%{portname}*_svg*.so.*
369 %{_libdir}/libwx_%{portname}*_xrc*.so.*
370
371 %files contrib-devel
372 %defattr(-,root,root)
373 %{_bindir}/wxrc
374 %dir %{_includedir}/wx-*/wx/animate
375 %{_includedir}/wx-*/wx/animate/*
376 %{_libdir}/libwx_%{portname}*_animate*.so
377
378 %dir %{_includedir}/wx-*/wx/deprecated
379 %{_includedir}/wx-*/wx/deprecated/*
380 %{_libdir}/libwx_%{portname}*_deprecated*.so
381
382 %dir %{_includedir}/wx-*/wx/fl
383 %{_includedir}/wx-*/wx/fl/*
384 %{_libdir}/libwx_%{portname}*_fl*.so
385
386 %dir %{_includedir}/wx-*/wx/gizmos
387 %{_includedir}/wx-*/wx/gizmos/*
388 %{_libdir}/libwx_%{portname}*_gizmos*.so
389
390 %dir %{_includedir}/wx-*/wx/mmedia
391 %{_includedir}/wx-*/wx/mmedia/*
392 %{_libdir}/libwx_%{portname}*_mmedia*.so
393
394 %dir %{_includedir}/wx-*/wx/ogl
395 %{_includedir}/wx-*/wx/ogl/*
396 %{_libdir}/libwx_%{portname}*_ogl*.so
397
398 %dir %{_includedir}/wx-*/wx/plot
399 %{_includedir}/wx-*/wx/plot/*
400 %{_libdir}/libwx_%{portname}*_plot*.so
401
402 %dir %{_includedir}/wx-*/wx/stc
403 %{_includedir}/wx-*/wx/stc/*
404 %{_libdir}/libwx_%{portname}*_stc*.so
405
406 %dir %{_includedir}/wx-*/wx/svg
407 %{_includedir}/wx-*/wx/svg/*
408 %{_libdir}/libwx_%{portname}*_svg*.so
409
410 %dir %{_includedir}/wx-*/wx/xrc
411 %{_includedir}/wx-*/wx/xrc/*
412 %{_libdir}/libwx_%{portname}*_xrc*.so