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