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