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