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