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