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