]> git.saurik.com Git - wxWidgets.git/blob - wxGTK.spec
Allow to customize wxGrid column auto-sizing.
[wxWidgets.git] / wxGTK.spec
1 %define _prefix /usr
2 %define ver 2.9.5
3 %define ver2 2.9
4 %define rel 1
5 # version for package name according to OpenSuse policy:
6 # http://en.opensuse.org/openSUSE:Shared_library_packaging_policy
7 %define sver 2_9-5
8
9 # Configurable settings (use --with(out) {unicode,gtk2} on rpmbuild cmd line):
10 %define unicode 1
11 %{?_with_unicode: %{expand: %%define unicode 1}}
12 %{?_without_unicode: %{expand: %%define unicode 0}}
13
14 %define gtk2 1
15 %{?_with_gtk2: %{expand: %%define gtk2 1}}
16 %{?_without_gtk2: %{expand: %%define gtk2 0}}
17
18 # "buildname" needs to be e.g. gtk2ud for debug builds
19 %if %{gtk2}
20 %define gtkver 2
21 %define portname gtk2
22 %if %{unicode}
23 %define buildname gtk2u
24 %else
25 %define buildname gtk2
26 %endif
27 %else
28 %define gtkver 1.2
29 %define portname gtk
30 %define buildname gtk
31 %endif
32
33 %if %{unicode}
34 %define name wx-%{portname}-unicode
35 %define wxconfig %{portname}-unicode-%{ver2}
36 %define wxconfigstatic %{portname}-unicode-static-%{ver2}
37 %define wxconfiglink wx%{portname}u-%{ver2}-config
38 %else
39 %define name wx-%{portname}-ansi
40 %define wxconfig %{portname}-ansi-%{ver2}
41 %define wxconfigstatic %{portname}-ansi-static-%{ver2}
42 %define wxconfiglink wx%{portname}-%{ver2}-config
43 %endif
44
45 %if %{unicode}
46 %define wxbasename wx-base-unicode
47 %define wxbaseconfig base-unicode-%{ver2}
48 %define wxbaseconfiglink wxbaseu-%{ver2}-config
49 %else
50 %define wxbasename wx-base-ansi
51 %define wxbaseconfig base-ansi-%{ver2}
52 %define wxbaseconfiglink wxbase-%{ver2}-config
53 %endif
54
55 %if 0%{?suse_version}
56 # avoiding shlib-policy-name-error: Your package contains a single shared
57 # library but is not named after its SONAME.
58 %define glname libwx_%{buildname}_gl-%{sver}
59 %else
60 %define glname %{name}-gl
61 %endif
62
63 Summary: The GTK+ %{gtkver} port of the wxWidgets library
64 Name: %{name}
65 Version: %{ver}
66 Release: %{rel}
67 License: wxWindows Licence
68 Group: System/Libraries
69 Source: wxWidgets-%{ver}.tar.bz2
70 URL: http://www.wxwidgets.org
71 Prefix: %{_prefix}
72 BuildRoot: %{_tmppath}/%{name}-root
73 Requires: %{wxbasename} = %{ver}
74 %if %{portname} == gtk2
75 BuildRequires: gtk2-devel
76 %else
77 BuildRequires: gtk+-devel >= 1.2.0
78 %endif
79
80 BuildRequires: zlib-devel, libjpeg-devel, libpng-devel, libtiff-devel
81 # on RedHat 5 default GCC 4.1.2 crashes during compilation
82 %if 0%{?rhel} == 5
83 BuildRequires: gcc44-c++
84 %else
85 BuildRequires: gcc-c++
86 %endif
87
88 %if 0%{?suse_version}
89 BuildRequires: libexpat-devel, Mesa-devel, xorg-x11-libSM-devel
90 BuildRequires: gstreamer-0_10-devel, gstreamer-0_10-plugins-base-devel
91 %else
92 %if 0%{?mandriva_version}
93 BuildRequires: libexpat-devel, libmesaglu-devel, libsm-devel
94 # For now disabling mediactrl
95 # FIXME: How to resolve OBS Mandriva dependecies for these?
96 #BuildRequires: libgstreamer-devel, libgstreamer-plugins-base-devel
97 %else
98 BuildRequires: expat-devel, libGLU-devel, libSM-devel
99 BuildRequires: gstreamer-devel, gstreamer-plugins-base-devel
100 %endif
101 %endif
102
103 # all packages providing an implementation of wxWidgets library (regardless of
104 # the toolkit used) should provide the (virtual) wxwin package, this makes it
105 # possible to require wxwin instead of requiring "wxgtk or wxmotif or wxuniv..."
106 Provides: wxwin = %{version}
107 Provides: wxGTK = %{version}
108
109 %description
110 wxWidgets is a free C++ library for cross-platform GUI development.
111 With wxWidgets, you can create applications for different GUIs (GTK+,
112 Motif, MS Windows, MacOS X, Windows CE, GPE) from the same source code.
113
114 %package -n wx-i18n
115 Summary: The translations for the wxWidgets library
116 Group: System/Libraries
117
118 %description -n wx-i18n
119 The translations files for the wxWidgets library.
120
121 %package devel
122 Summary: The GTK+ %{gtkver} port of the wxWidgets library
123 Group: Development/Libraries
124 Requires: %{name} = %{ver}
125 Requires: %{glname} = %{ver}
126 Requires: %{wxbasename}-devel = %{ver}
127 Provides: wxGTK-devel = %{version}
128
129 %description devel
130 The GTK+ %{gtkver} port of the wxWidgets library, header files.
131
132 %package -n %{glname}
133 Summary: The GTK+ %{gtkver} port of the wxWidgets library, OpenGL add-on
134 Group: System/Libraries
135 Requires: %{name} = %{ver}
136 Provides: wxGTK-gl = %{version}
137
138 %description -n %{glname}
139 OpenGL add-on library for wxGTK, the GTK+ %{gtkver} port of the wxWidgets library.
140
141 %package -n %{wxbasename}
142 Summary: wxBase library - non-GUI support classes of the wxWidgets toolkit
143 Group: Development/Libraries
144 Provides: wxBase = %{version}
145
146 %description -n %{wxbasename}
147 wxBase is a collection of C++ classes providing basic data structures (strings,
148 lists, arrays), portable wrappers around many OS-specific funstions (file
149 operations, time/date manipulations, threads, processes, sockets, shared
150 library loading) as well as other utility classes (streams, archive and
151 compression). wxBase currently supports Win32, most Unix variants (Linux,
152 FreeBSD, Solaris, HP-UX) and MacOS X (Carbon and Mach-0).
153
154 %package -n %{wxbasename}-devel
155 Summary: wxBase library, header files
156 Group: Development/Libraries
157 Provides: wxBase-devel = %{version}
158
159 %description -n %{wxbasename}-devel
160 wxBase library - non-GUI support classes of the wxWidgets toolkit,
161 header files.
162
163 %prep
164 %setup -q -n wxWidgets-%{ver}
165
166 %build
167
168 %if 0%{?rhel} == 5
169 export CC=gcc44
170 export CXX=g++44
171 %endif
172 # if it's not set OpenSuse warns: "compiled without RPM_OPT_FLAGS"
173 export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
174 export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
175
176 mkdir obj-shared
177 cd obj-shared
178 ../configure --prefix=%{_prefix} --libdir=%{_libdir} --disable-rpath \
179 %if ! %{gtk2}
180 --with-gtk=1 \
181 %else
182 --with-gtk=2 \
183 %endif
184 %if %{unicode}
185 --enable-unicode \
186 %else
187 --disable-unicode \
188 %endif
189 %if ! 0%{?mandriva_version}
190 --enable-mediactrl \
191 %endif
192 --with-opengl
193 make %{?_smp_mflags}
194
195 cd ..
196
197 mkdir obj-static
198 cd obj-static
199 ../configure --prefix=%{_prefix} --libdir=%{_libdir} --disable-rpath \
200 %if ! %{gtk2}
201 --with-gtk=1 \
202 %else
203 --with-gtk=2 \
204 %endif
205 --disable-shared \
206 %if %{unicode}
207 --enable-unicode \
208 %else
209 --disable-unicode \
210 %endif
211 %if ! 0%{?mandriva_version}
212 --enable-mediactrl \
213 %endif
214 --with-opengl
215 make %{?_smp_mflags}
216
217 cd ..
218
219 make -C locale allmo
220
221 %install
222 rm -rf $RPM_BUILD_ROOT
223 (cd obj-static; make DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} install)
224 (cd obj-shared; make DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} install)
225
226 # --- wxBase headers list begins here ---
227 cat <<EOF >wxbase-headers.files
228 wx/afterstd.h
229 wx/any.h
230 wx/anystr.h
231 wx/app.h
232 wx/apptrait.h
233 wx/archive.h
234 wx/arrimpl.cpp
235 wx/arrstr.h
236 wx/atomic.h
237 wx/base64.h
238 wx/beforestd.h
239 wx/buffer.h
240 wx/build.h
241 wx/chartype.h
242 wx/checkeddelete.h
243 wx/chkconf.h
244 wx/clntdata.h
245 wx/cmdargs.h
246 wx/cmdline.h
247 wx/confbase.h
248 wx/config.h
249 wx/convauto.h
250 wx/containr.h
251 wx/cpp.h
252 wx/crt.h
253 wx/datetime.h
254 wx/datstrm.h
255 wx/dde.h
256 wx/debug.h
257 wx/defs.h
258 wx/dir.h
259 wx/dlimpexp.h
260 wx/dlist.h
261 wx/dynarray.h
262 wx/dynlib.h
263 wx/dynload.h
264 wx/encconv.h
265 wx/event.h
266 wx/eventfilter.h
267 wx/evtloop.h
268 wx/except.h
269 wx/features.h
270 wx/flags.h
271 wx/ffile.h
272 wx/file.h
273 wx/fileconf.h
274 wx/filefn.h
275 wx/filename.h
276 wx/filesys.h
277 wx/fontenc.h
278 wx/fontmap.h
279 wx/fs_arc.h
280 wx/fs_filter.h
281 wx/fs_mem.h
282 wx/fs_zip.h
283 wx/hash.h
284 wx/hashmap.h
285 wx/hashset.h
286 wx/html/forcelnk.h
287 wx/iconloc.h
288 wx/init.h
289 wx/intl.h
290 wx/iosfwrap.h
291 wx/ioswrap.h
292 wx/ipc.h
293 wx/ipcbase.h
294 wx/kbdstate.h
295 wx/language.h
296 wx/link.h
297 wx/list.h
298 wx/listimpl.cpp
299 wx/log.h
300 wx/longlong.h
301 wx/math.h
302 wx/memconf.h
303 wx/memory.h
304 wx/memtext.h
305 wx/mimetype.h
306 wx/module.h
307 wx/mousestate.h
308 wx/msgout.h
309 wx/msgqueue.h
310 wx/mstream.h
311 wx/numformatter.h
312 wx/object.h
313 wx/platform.h
314 wx/platinfo.h
315 wx/power.h
316 wx/process.h
317 wx/ptr_scpd.h
318 wx/ptr_shrd.h
319 wx/recguard.h
320 wx/regex.h
321 wx/rtti.h
322 wx/scopedarray.h
323 wx/scopedptr.h
324 wx/scopeguard.h
325 wx/sharedptr.h
326 wx/snglinst.h
327 wx/sstream.h
328 wx/stack.h
329 wx/stackwalk.h
330 wx/stdpaths.h
331 wx/stdstream.h
332 wx/stockitem.h
333 wx/stopwatch.h
334 wx/strconv.h
335 wx/stream.h
336 wx/string.h
337 wx/stringimpl.h
338 wx/stringops.h
339 wx/strvararg.h
340 wx/sysopt.h
341 wx/tarstrm.h
342 wx/textbuf.h
343 wx/textfile.h
344 wx/thread.h
345 wx/thrimpl.cpp
346 wx/time.h
347 wx/timer.h
348 wx/tls.h
349 wx/tokenzr.h
350 wx/tracker.h
351 wx/translation.h
352 wx/txtstrm.h
353 wx/typeinfo.h
354 wx/types.h
355 wx/unichar.h
356 wx/uri.h
357 wx/ustring.h
358 wx/utils.h
359 wx/variant.h
360 wx/vector.h
361 wx/version.h
362 wx/versioninfo.h
363 wx/volume.h
364 wx/weakref.h
365 wx/wfstream.h
366 wx/wx.h
367 wx/wxchar.h
368 wx/wxcrt.h
369 wx/wxcrtbase.h
370 wx/wxcrtvararg.h
371 wx/wxprec.h
372 wx/xlocale.h
373 wx/xti.h
374 wx/xti2.h
375 wx/xtistrm.h
376 wx/xtictor.h
377 wx/xtihandler.h
378 wx/xtiprop.h
379 wx/xtitypes.h
380 wx/zipstrm.h
381 wx/zstream.h
382 wx/meta/convertible.h
383 wx/meta/if.h
384 wx/meta/implicitconversion.h
385 wx/meta/int2type.h
386 wx/meta/movable.h
387 wx/meta/pod.h
388 wx/meta/removeref.h
389 wx/fswatcher.h
390 wx/generic/fswatcher.h
391 wx/unix/app.h
392 wx/unix/apptbase.h
393 wx/unix/apptrait.h
394 wx/unix/chkconf.h
395 wx/unix/evtloop.h
396 wx/unix/evtloopsrc.h
397 wx/unix/pipe.h
398 wx/unix/stdpaths.h
399 wx/unix/stackwalk.h
400 wx/unix/tls.h
401 wx/unix/fswatcher_kqueue.h
402 wx/unix/execute.h
403 wx/unix/mimetype.h
404 wx/unix/fswatcher_inotify.h
405 wx/fs_inet.h
406 wx/protocol/file.h
407 wx/protocol/ftp.h
408 wx/protocol/http.h
409 wx/protocol/log.h
410 wx/protocol/protocol.h
411 wx/sckaddr.h
412 wx/sckipc.h
413 wx/sckstrm.h
414 wx/socket.h
415 wx/url.h
416 wx/xml/xml.h
417 wx/xtixml.h
418 EOF
419 # --- wxBase headers list ends here ---
420
421 # --- wxBase headers list with paths ---
422 sed -e 's@^@%{_includedir}/wx-%{ver2}/@' wxbase-headers.files > wxbase-headers.paths
423
424
425 # temporarily remove base headers
426 mkdir $RPM_BUILD_ROOT/_save_dir
427 cp -r $RPM_BUILD_ROOT%{_includedir}/wx-%{ver2} $RPM_BUILD_ROOT/_save_dir
428 for f in `cat wxbase-headers.files` ; do
429 rm -f $RPM_BUILD_ROOT%{_includedir}/wx-%{ver2}/$f
430 done
431 # list of all core headers:
432 find $RPM_BUILD_ROOT%{_includedir}/wx-%{ver2} -type f | sed -e "s,$RPM_BUILD_ROOT,,g" >core-headers.files
433 # move base headers (actually all headers) back again
434 cp -f -r $RPM_BUILD_ROOT/_save_dir/* $RPM_BUILD_ROOT%{_includedir}
435 rm -rf $RPM_BUILD_ROOT/_save_dir
436
437 # utils:
438 (cd obj-shared/utils/wxrc; make DESTDIR=$RPM_BUILD_ROOT prefix=%{_prefix} install)
439
440 # wx-config link is created during package installation, remove it for now
441 rm -f $RPM_BUILD_ROOT%{_bindir}/wx-config
442
443 %clean
444 rm -rf $RPM_BUILD_ROOT
445
446 %post
447 /sbin/ldconfig
448
449 %postun
450 /sbin/ldconfig
451
452 %post devel
453 # link wx-config when you install RPM.
454 %if %{unicode}
455 ln -sf %{_libdir}/wx/config/%{wxconfig} %{_bindir}/wx-config
456 %endif
457 # link wx-config with explicit name.
458 ln -sf %{_libdir}/wx/config/%{wxconfig} %{_bindir}/%{wxconfiglink}
459 /sbin/ldconfig
460
461 %postun devel
462 /sbin/ldconfig
463
464 %preun devel
465 %if %{unicode}
466 rm -f %{_bindir}/wx-config
467 %endif
468 rm -f %{_bindir}/%{wxconfiglink}
469
470 %post -n %{wxbasename}
471 /sbin/ldconfig
472
473 %postun -n %{wxbasename}
474 /sbin/ldconfig
475
476 %post -n %{wxbasename}-devel
477 # link wx-config with explicit name.
478 ln -sf %{_libdir}/wx/config/%{wxbaseconfig} %{_bindir}/%{wxbaseconfiglink}
479 /sbin/ldconfig
480
481 %postun -n %{wxbasename}-devel
482 /sbin/ldconfig
483
484 %preun -n %{wxbasename}-devel
485 rm -f %{_bindir}/%{wxbaseconfiglink}
486
487 %post -n %{glname}
488 /sbin/ldconfig
489
490 %postun -n %{glname}
491 /sbin/ldconfig
492
493 %files
494 %defattr(-,root,root)
495 #doc COPYING.LIB *.txt
496 %{_libdir}/libwx_%{buildname}_adv-%{ver2}.so.*
497 %{_libdir}/libwx_%{buildname}_aui-%{ver2}.so.*
498 %{_libdir}/libwx_%{buildname}_core-%{ver2}.so.*
499 %{_libdir}/libwx_%{buildname}_html-%{ver2}.so.*
500 %if ! 0%{?mandriva_version}
501 %{_libdir}/libwx_%{buildname}_media-%{ver2}.so.*
502 %endif
503 %{_libdir}/libwx_%{buildname}_propgrid-%{ver2}.so.*
504 %{_libdir}/libwx_%{buildname}_qa-%{ver2}.so.*
505 %{_libdir}/libwx_%{buildname}_ribbon-%{ver2}.so.*
506 %{_libdir}/libwx_%{buildname}_richtext-%{ver2}.so.*
507 %{_libdir}/libwx_%{buildname}_stc-%{ver2}.so.*
508 %{_libdir}/libwx_%{buildname}_xrc-%{ver2}.so.*
509
510 %files -n wx-i18n
511 %defattr(-,root,root)
512 %{_datadir}/locale/*/LC_MESSAGES/*.mo
513
514 %files devel -f core-headers.files
515 %defattr(-,root,root)
516 %dir %{_includedir}/wx-%{ver2}/wx/aui
517 %dir %{_includedir}/wx-%{ver2}/wx/gtk
518 %dir %{_includedir}/wx-%{ver2}/wx/gtk/gnome
519 %dir %{_includedir}/wx-%{ver2}/wx/gtk/hildon
520 %dir %{_includedir}/wx-%{ver2}/wx/persist
521 %dir %{_includedir}/wx-%{ver2}/wx/propgrid
522 %dir %{_includedir}/wx-%{ver2}/wx/ribbon
523 %dir %{_includedir}/wx-%{ver2}/wx/richtext
524 %dir %{_includedir}/wx-%{ver2}/wx/stc
525 %dir %{_includedir}/wx-%{ver2}/wx/unix
526 %dir %{_includedir}/wx-%{ver2}/wx/xrc
527 # shared libs
528 %{_libdir}/libwx_%{buildname}_adv-%{ver2}.so
529 %{_libdir}/libwx_%{buildname}_aui-%{ver2}.so
530 %{_libdir}/libwx_%{buildname}_core-%{ver2}.so
531 %{_libdir}/libwx_%{buildname}_gl-%{ver2}.so
532 %{_libdir}/libwx_%{buildname}_html-%{ver2}.so
533 %if ! 0%{?mandriva_version}
534 %{_libdir}/libwx_%{buildname}_media-%{ver2}.so
535 %endif
536 %{_libdir}/libwx_%{buildname}_propgrid-%{ver2}.so
537 %{_libdir}/libwx_%{buildname}_qa-%{ver2}.so
538 %{_libdir}/libwx_%{buildname}_ribbon-%{ver2}.so
539 %{_libdir}/libwx_%{buildname}_richtext-%{ver2}.so
540 %{_libdir}/libwx_%{buildname}_stc-%{ver2}.so
541 %{_libdir}/libwx_%{buildname}_xrc-%{ver2}.so
542 # static libs
543 %{_libdir}/libwx_%{buildname}_adv-%{ver2}.a
544 %{_libdir}/libwx_%{buildname}_aui-%{ver2}.a
545 %{_libdir}/libwx_%{buildname}_core-%{ver2}.a
546 %{_libdir}/libwx_%{buildname}_gl-%{ver2}.a
547 %{_libdir}/libwx_%{buildname}_html-%{ver2}.a
548 %if ! 0%{?mandriva_version}
549 %{_libdir}/libwx_%{buildname}_media-%{ver2}.a
550 %endif
551 %{_libdir}/libwx_%{buildname}_propgrid-%{ver2}.a
552 %{_libdir}/libwx_%{buildname}_qa-%{ver2}.a
553 %{_libdir}/libwx_%{buildname}_ribbon-%{ver2}.a
554 %{_libdir}/libwx_%{buildname}_richtext-%{ver2}.a
555 %{_libdir}/libwx_%{buildname}_stc-%{ver2}.a
556 %{_libdir}/libwx_%{buildname}_xrc-%{ver2}.a
557 %dir %{_libdir}/wx
558 %dir %{_libdir}/wx/config
559 %dir %{_libdir}/wx/include
560 %dir %{_libdir}/wx/include/%{wxconfig}
561 %dir %{_libdir}/wx/include/%{wxconfig}/wx
562 %dir %{_libdir}/wx/include/%{wxconfigstatic}
563 %dir %{_libdir}/wx/include/%{wxconfigstatic}/wx
564 %{_libdir}/wx/config/%{wxconfig}
565 %{_libdir}/wx/include/%{wxconfig}/wx/setup.h
566 %{_libdir}/wx/config/%{wxconfigstatic}
567 %{_libdir}/wx/include/%{wxconfigstatic}/wx/setup.h
568 %{_bindir}/wxrc*
569
570 %files -n %{wxbasename}
571 %defattr(-,root,root)
572 %{_libdir}/libwx_base*-%{ver2}.so.*
573
574 %files -n %{wxbasename}-devel -f wxbase-headers.paths
575 %defattr (-,root,root)
576 %dir %{_includedir}/wx-%{ver2}
577 %dir %{_includedir}/wx-%{ver2}/wx
578 %dir %{_includedir}/wx-%{ver2}/wx/generic
579 %dir %{_includedir}/wx-%{ver2}/wx/html
580 %dir %{_includedir}/wx-%{ver2}/wx/meta
581 %dir %{_includedir}/wx-%{ver2}/wx/protocol
582 %dir %{_includedir}/wx-%{ver2}/wx/unix
583 %dir %{_includedir}/wx-%{ver2}/wx/xml
584 %dir %{_datadir}/bakefile/presets
585 %{_libdir}/libwx_base*-%{ver2}.so
586 %{_libdir}/libwx_base*-%{ver2}.a
587 %if %{unicode}
588 %{_libdir}/libwxregexu-%{ver2}.a
589 %endif
590 %{_libdir}/libwxscintilla-%{ver2}.a
591 %dir %{_libdir}/wx
592 %dir %{_datadir}/bakefile
593 %dir %{_datadir}/bakefile/presets
594 %{_datadir}/aclocal/*.m4
595 %{_datadir}/bakefile/presets/*
596
597 %files -n %{glname}
598 %defattr(-,root,root)
599 %{_libdir}/libwx_%{buildname}_gl-%{ver2}.so.*