]> git.saurik.com Git - wxWidgets.git/blob - wxGTK.spec
fix makefile (changed filelist)
[wxWidgets.git] / wxGTK.spec
1 %define pref /usr
2 %define ver 2.5.0
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 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
37 Name: %{name}
38 Summary: The GTK+ %{gtkver} port of the wxWindows library
39 Version: %{ver}
40 Release: %{rel}
41 License: wxWindows Licence
42 Group: X11/Libraries
43 Source: wxGTK-%{ver}.tar.bz2
44 URL: http://www.wxwindows.org
45 Packager: Vadim Zeitlin <vadim@wxwindows.org>
46 Prefix: %{pref}
47 BuildRoot: /var/tmp/%{name}-root
48
49 # all packages providing an implementation of wxWindows library (regardless of
50 # the toolkit used) should provide the (virtual) wxwin package, this makes it
51 # possible to require wxwin instead of requiring "wxgtk or wxmotif or wxuniv..."
52 Provides: wxwin
53 Provides: wxGTK
54
55 # in addition, we should provide libwx_gtk as automatic generator only notices
56 # libwx_gtk-%{ver}-%{rel}
57 Provides: libwx_gtk.so
58 Provides: libwx_gtk-%{ver2}.so
59
60 Requires: %{wxbasename} = %{ver}
61 BuildRequires: %{wxbasename}-devel = %{ver}
62
63 %description
64 wxWindows is a free C++ library for cross-platform GUI development.
65 With wxWindows, you can create applications for different GUIs (GTK+,
66 Motif/LessTif, MS Windows, Mac) from the same source code.
67
68 %package devel
69 Summary: The GTK+ %{gtkver} port of the wxWindows library
70 Group: X11/Libraries
71 Requires: %{name} = %{ver}
72 Requires: %{wxbasename}-devel = %{ver}
73 Provides: wxGTK-devel
74
75 %description devel
76 Header files for wxGTK, the GTK+ %{gtkver} port of the wxWindows library.
77
78 %package gl
79 Summary: The GTK+ %{gtkver} port of the wxWindows library, OpenGL add-on.
80 Group: X11/Libraries
81 Requires: %{name} = %{ver}
82
83 %description gl
84 OpenGL add-on library for wxGTK, the GTK+ %{gtkver} port of the wxWindows library.
85
86 %package static
87 Summary: wxGTK static libraries
88 Group: Development/Libraries
89 Requires: %{wxbasename}-static
90
91 %description static
92 Static libraries for wxGTK. You need them if you want to link statically against wxGTK.
93
94 %package contrib
95 Summary: The GTK+ %{gtkver} port of the wxWindows library, contributed libraries.
96 Group: X11/Libraries
97 Requires: %{name} = %{ver}
98
99 %description contrib
100 Contributed libraries for wxGTK, the GTK+ %{gtkver} port of the wxWindows library.
101
102 %package contrib-devel
103 Summary: The GTK+ %{gtkver} port of the wxWindows library
104 Group: X11/Libraries
105 Requires: %{name}-contrib = %{ver}
106 Requires: %{name}-devel = %{ver}
107
108 %description contrib-devel
109 Header files for contributed libraries for wxGTK, the GTK+ %{gtkver} port of the wxWindows library.
110
111 %prep
112 %setup -q -n wxGTK-%{ver}
113
114 %build
115 if [ "$SMP" != "" ]; then
116 export MAKE="make -j$SMP"
117 else
118 export MAKE="make"
119 fi
120
121 mkdir obj-shared
122 cd obj-shared
123 ../configure --prefix=%{pref} \
124 %if %{unicode}
125 --enable-unicode \
126 %else
127 --with-odbc \
128 %endif
129 %if %{gtk2}
130 --enable-gtk2 \
131 %endif
132 --with-opengl
133 $MAKE
134 cd contrib/src
135 $MAKE
136 cd ../../..
137
138 mkdir obj-static
139 cd obj-static
140 ../configure --prefix=%{pref} --disable-shared \
141 %if %{unicode}
142 --enable-unicode \
143 %else
144 --with-odbc \
145 %endif
146 %if %{gtk2}
147 --enable-gtk2 \
148 %endif
149 --with-opengl
150 $MAKE
151 cd ..
152
153 %install
154 rm -rf $RPM_BUILD_ROOT
155 (cd obj-static; make prefix=$RPM_BUILD_ROOT%{pref} install)
156 (cd obj-shared; make prefix=$RPM_BUILD_ROOT%{pref} install)
157
158 # Remove headers that are part of wx-base-devel:
159 (
160 cd $RPM_BUILD_ROOT
161 for f in `rpm -ql %{wxbasename}-devel | sed -e 's,\(.*\),.\1,g'` ; do
162 if test -f $f ; then rm -f $f ; fi
163 done
164 )
165
166 # list of all core headers:
167 find $RPM_BUILD_ROOT/usr/include/wx -type f | sed -e "s,$RPM_BUILD_ROOT,,g" >core-headers.files
168
169 # contrib stuff:
170 (cd obj-shared/contrib/src; make prefix=$RPM_BUILD_ROOT%{pref} install)
171 (cd obj-shared/contrib/utils/wxrc; make prefix=$RPM_BUILD_ROOT%{pref} install)
172
173 %clean
174 rm -rf $RPM_BUILD_ROOT
175
176 %post
177 /sbin/ldconfig
178
179 %postun
180 /sbin/ldconfig
181
182 %post gl
183 /sbin/ldconfig
184
185 %postun gl
186 /sbin/ldconfig
187
188 %post devel
189 # Install wx-config if there isn't any
190 if test ! -f %{_bindir}/wx-config ; then
191 ln -sf %{wxconfigname} %{_bindir}/wx-config
192 fi
193
194 %preun devel
195 # Remove wx-config if it points to this package
196 if test -f %{_bindir}/wx-config -a -f /usr/bin/md5sum ; then
197 SUM1=`md5sum %{_bindir}/%{wxconfigname} | cut -c 0-32`
198 SUM2=`md5sum %{_bindir}/wx-config | cut -c 0-32`
199 if test "x$SUM1" = "x$SUM2" ; then
200 rm -f %{_bindir}/wx-config
201 fi
202 fi
203
204
205 %files
206 %defattr(-,root,root)
207 %doc COPYING.LIB *.txt
208 %dir %{_datadir}/wx
209 %{_datadir}/wx/*
210 %{_libdir}/libwx_%{portname}*_core*.so.*
211 %{_libdir}/libwx_%{portname}*_html*.so.*
212 %{_libdir}/libwx_%{portname}*_adv*.so.*
213 %if !%{unicode}
214 %{_libdir}/libwx_%{portname}*_dbgrid*.so.*
215 %endif
216
217 %files devel -f core-headers.files
218 %defattr(-,root,root)
219 %{_libdir}/libwx_%{portname}*_core*.so
220 %{_libdir}/libwx_%{portname}*_html*.so
221 %{_libdir}/libwx_%{portname}*_adv*.so
222 %if !%{unicode}
223 %{_libdir}/libwx_%{portname}*_dbgrid*.so
224 %endif
225 %{_libdir}/libwx_%{portname}*_gl*.so
226 %dir %{_libdir}/wx
227 %{_libdir}/wx/*
228 %{_bindir}/%{wxconfigname}
229
230 %files gl
231 %defattr(-,root,root)
232 %{_libdir}/libwx_%{portname}*_gl*.so.*
233
234 %files static
235 %defattr (-,root,root)
236 %{_libdir}/libwx_gtk*.a
237
238 %files contrib
239 %defattr(-,root,root)
240 %{_libdir}/libwx_%{portname}*_animate*.so.*
241 %{_libdir}/libwx_%{portname}*_deprecated*.so.*
242 %{_libdir}/libwx_%{portname}*_fl*.so.*
243 %{_libdir}/libwx_%{portname}*_gizmos*.so.*
244 %{_libdir}/libwx_%{portname}*_mmedia*.so.*
245 %{_libdir}/libwx_%{portname}*_ogl*.so.*
246 %{_libdir}/libwx_%{portname}*_plot*.so.*
247 %{_libdir}/libwx_%{portname}*_stc*.so.*
248 %{_libdir}/libwx_%{portname}*_svg*.so.*
249 %{_libdir}/libwx_%{portname}*_xrc*.so.*
250
251 %files contrib-devel
252 %defattr(-,root,root)
253 %{_bindir}/wxrc
254 %dir %{_includedir}/wx/animate
255 %{_includedir}/wx/animate/*
256 %{_libdir}/libwx_%{portname}*_animate*.so
257
258 %dir %{_includedir}/wx/deprecated
259 %{_includedir}/wx/deprecated/*
260 %{_libdir}/libwx_%{portname}*_deprecated*.so
261
262 %dir %{_includedir}/wx/fl
263 %{_includedir}/wx/fl/*
264 %{_libdir}/libwx_%{portname}*_fl*.so
265
266 %dir %{_includedir}/wx/gizmos
267 %{_includedir}/wx/gizmos/*
268 %{_libdir}/libwx_%{portname}*_gizmos*.so
269
270 %dir %{_includedir}/wx/mmedia
271 %{_includedir}/wx/mmedia/*
272 %{_libdir}/libwx_%{portname}*_mmedia*.so
273
274 %dir %{_includedir}/wx/ogl
275 %{_includedir}/wx/ogl/*
276 %{_libdir}/libwx_%{portname}*_ogl*.so
277
278 %dir %{_includedir}/wx/plot
279 %{_includedir}/wx/plot/*
280 %{_libdir}/libwx_%{portname}*_plot*.so
281
282 %dir %{_includedir}/wx/stc
283 %{_includedir}/wx/stc/*
284 %{_libdir}/libwx_%{portname}*_stc*.so
285
286 %dir %{_includedir}/wx/svg
287 %{_includedir}/wx/svg/*
288 %{_libdir}/libwx_%{portname}*_svg*.so
289
290 %dir %{_includedir}/wx/xrc
291 %{_includedir}/wx/xrc/*
292 %{_libdir}/libwx_%{portname}*_xrc*.so