1 %define pref
%{_prefix}
2 %define python @PYTHON@
5 %define lcport @LCPORT@
6 %define unicode @UNICODE@
7 %define tarname @TARNAME@
8 %define version @VERSION@
11 %define wxpref
%{pref}/lib
/wxPython
12 %define name wxPython
%{port}-py%{pyver}
15 # Should the builtin image and etc. libs be used, or system libs?
16 # Distro specific RPMs should probably set this to 0, generic ones
18 %define builtin_libs
1
21 # Should --enable-debug_flag be used in release builds? Using it
22 # defines __WXDEBUG__ and gives us runtime diagnostics that are turned
23 # into Python exceptions starting with 2.3.4. (So turning it on is a
24 # very helpful thing IMO and is recommended.)
28 # build the name of the real wx-config from the port, flags, etc.
29 %define dbgflg %
(if [ "
%{debug_flag}"
= "
1"
]; then echo d
; fi)
30 %define uniflg %
(if [ "
%{unicode}"
= "
1"
]; then echo u
; fi)
31 %define DBGFLG %
(if [ "
%{debug_flag}"
= "
1"
]; then echo D
; fi)
32 %define UNIFLG %
(if [ "
%{unicode}"
= "
1"
]; then echo U
; fi)
33 %define wxconfigname
%{wxpref}/bin/wx%{lcport}%{uniflg}%{dbgflg}-%{ver2}-config
35 # turn off the generation of debuginfo rpm (RH9)
36 %define debug_package
%{nil}
38 #----------------------------------------------------------------
39 Summary: Cross platform GUI toolkit
for Python using wx
%{port}
43 Source0: %{tarname}-%{version}.tar.gz
44 License: wxWindows Library Licence
, Version 3
45 URL: http
://wxPython.org
/
46 Packager: Robin Dunn
<robin@alldunn.com
>
47 Group: Development
/Python
48 BuildRoot: %{_tmppath}/%{name}-buildroot
51 Provides: wxPython
= %{version}
52 Provides: wxPython
%{port} = %{version}
54 Provides: libwx_
%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so
55 Provides: libwx_
%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
56 Provides: libwx_
%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so
57 Provides: libwx_
%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
60 # old wxPython packages
61 Obsoletes
: wxPython wxPython
%{port}
65 wxPython is a GUI toolkit
for Python that is a wrapper around the
66 wxWindows C
++ GUI library. wxPython provides a large variety of
67 window types and controls
, all implemented with a native look and feel
68 (and native runtime speed
) on the platforms it is supported on.
70 This package is implemented using the
%{port} port of wxWindows
, and
71 includes the wx
%{port} shared libs and etc.
74 %package -n wxPython
%{port}-devel
75 Summary: wxPython
%{port} development files
76 Group: Development
/Libraries
77 Requires: wxPython
%{port} = %{version}
80 %description -n wxPython
%{port}-devel
81 This packages contains the headers and etc.
for building apps or
82 Python extension modules that use the same wx
%{port} shared libraries
85 #----------------------------------------------------------------
87 %setup -q
-n
%{tarname}-%{version}
90 #----------------------------------------------------------------
92 if [ "$SMP"
!= ""
]; then
102 # Configure, trying to reduce external dependencies
103 $WXDIR
/configure
--with
-%{lcport} \
106 --enable-rpath
=%{wxpref}/lib \
115 --enable-debug_flag \
118 --with
-libjpeg
=builtin \
119 --with
-libpng
=builtin \
120 --with
-libtiff
=builtin \
121 --with
-zlib
=builtin \
136 WX_CONFIG
="$WXDIR
/build
/wx
-config
--prefix
=$WXDIR
--exec-prefix
=$WXDIR
/build" \
141 # Build wxrc (XRC resource tool) but don't use the makefiles since they expect
142 # a shared version of the xrc lib to have been built...
143 cd $WXDIR
/contrib
/utils
/wxrc
144 WX_CONFIG
="$WXDIR
/build
/wx
-config
--prefix
=$WXDIR
--exec-prefix
=$WXDIR
/build"
145 wCC
=`$WX_CONFIG
--cc`
146 wCXX
=`$WX_CONFIG
--cxx`
148 for f
in wxrc.cpp ..
/..
/src
/xrc
/xml.cpp ..
/..
/src
/xrc
/xmlres.cpp
; do
150 $wCXX `$WX_CONFIG
--cxxflags`
-I ..
/..
/include
-I ..
/..
/src
/xrc
/expat
/xmlparse
-I ..
/..
/src
/xrc
/expat
/xmltok
-c $f
152 for f
in ..
/..
/src
/xrc
/expat
/xmlparse
/xmlparse.c ..
/..
/src
/xrc
/expat
/xmltok
/xmlrole.c ..
/..
/src
/xrc
/expat
/xmltok
/xmltok.c
; do
154 $wCC `$WX_CONFIG
--cxxflags`
-I ..
/..
/include
-I ..
/..
/src
/xrc
/expat
/xmlparse
-I ..
/..
/src
/xrc
/expat
/xmltok
-c $f
157 $wCXX `$WX_CONFIG
--libs`
*.o
-o wxrc
161 #----------------------------------------------------------------
163 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
168 make prefix
=$RPM_BUILD_ROOT
%{wxpref} install
177 WX_CONFIG
="$RPM_BUILD_ROOT
%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
179 --root
=$RPM_BUILD_ROOT
181 # Since I want this RPM to be as generic as possible I won't let
182 # distutils copy the scripts since it will mangle the #! line to use
183 # the real python pathname. Since some distros install python 2.2 as
184 # python2 and others as python, then I can't let distutils do that
185 # otherwise the dependencies will be fouled up. Copy them manually
186 # instead, leaving the #!/bin/env line intact.
188 # TODO: Should this be dependent on %{builtin_libs} or something like it?
190 mkdir -p $RPM_BUILD_ROOT
/usr
/bin
202 cp scripts
/$s $RPM_BUILD_ROOT
/%{pref}/bin
207 cp $WXDIR
/contrib
/utils
/wxrc
/wxrc $RPM_BUILD_ROOT
/%{pref}/bin
210 # Copy icons and make menu entries
211 #-- This only works for Mandrake. Is there a cross-distro way to do it?
212 ##mkdir -p $RPM_BUILD_ROOT/%{_iconsdir}
213 ##mkdir -p $RPM_BUILD_ROOT/%{_miconsdir}
214 ##mkdir -p $RPM_BUILD_ROOT/%{_menudir}
215 ##install -p -m 644 $WXDIR/wxPython/wxPython/py/PyCrust_32.png $RPM_BUILD_ROOT/%{_iconsdir}/PyCrust.png
216 ##install -p -m 644 $WXDIR/wxPython/wxPython/py/PyCrust_16.png $RPM_BUILD_ROOT/%{_miconsdir}/PyCrust.png
217 ##install -p -m 644 $WXDIR/wxPython/wxPython/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT/%{_iconsdir}/XRCed.png
218 ##install -p -m 644 $WXDIR/wxPython/wxPython/tools/XRCed/XRCed_16.png $RPM_BUILD_ROOT/%{_miconsdir}/XRCed.png
220 ##cat > $RPM_BUILD_ROOT/%{_menudir}/%{name} <<EOF
221 ##?package(%{name}): command="%_bindir/pyshell" needs="X11" \
222 ##icon="PyCrust.png" section="Applications/Development" \
223 ##title="PyShell" longtitle="Python Shell"
225 ##?package(%{name}): command="%_bindir/pycrust" needs="X11" \
226 ##icon="PyCrust.png" section="Applications/Development" \
227 ##title="PyCrust" longtitle="Python Shell with Filling"
229 ##?package(%{name}): command="%_bindir/pyalamode" needs="X11" \
230 ##icon="PyCrust.png" section="Applications/Development" \
231 ##title="PyAlaMode" longtitle="Python Shell with Filling and editor windows"
233 ##?package(%{name}): command="%_bindir/xrced" needs="X11" \
234 ##icon="XRCed.png" section="Applications/Development" \
235 ##title="XRCed" longtitle="wxPython XRC resource editor"
241 # Generate the filelists. For some reason the %defattr below is still
242 # resulting in many (but not all) files not owned by root when just
243 # specifying directories and wildcards to be included in each package.
244 # So instead we'll build some explicit filelists here and use %attr on
247 mkdir -p $RPM_BUILD_ROOT
%{pref}/share
/doc
248 GFL
="
%{python} wxPython
/distrib
/genfilelist.py"
249 $GFL $RPM_BUILD_ROOT
%{pref} > FILELIST
250 $GFL
-r $RPM_BUILD_ROOT
%{pref}/bin
>> FILELIST
251 $GFL $RPM_BUILD_ROOT
%{pref}/lib
>> FILELIST
252 $GFL
-r $RPM_BUILD_ROOT
%{pref}/lib/python%{pyver} >> FILELIST
253 $GFL
-r $RPM_BUILD_ROOT
%{pref}/share
>> FILELIST
254 $GFL $RPM_BUILD_ROOT
%{wxpref} >> FILELIST
255 $GFL $RPM_BUILD_ROOT
%{wxpref}/lib
>> FILELIST
256 $GFL $RPM_BUILD_ROOT "
%{wxpref}/lib
/libwx
*"
>> FILELIST
257 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/share
>> FILELIST
258 ###GFL -r $RPM_BUILD_ROOT %{_iconsdir} >> FILELIST
259 ##$GFL -r $RPM_BUILD_ROOT %{_menudir} >> FILELIST
261 $GFL $RPM_BUILD_ROOT
%{wxpref}/include
> DEVELLIST
262 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/include
/wx
>> DEVELLIST
263 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/lib
/wx
>> DEVELLIST
264 $GFL $RPM_BUILD_ROOT
%{wxconfigname} >> DEVELLIST
265 $GFL $RPM_BUILD_ROOT
%{wxpref}/bin
/wx
-config
>> DEVELLIST
268 #----------------------------------------------------------------
275 #----------------------------------------------------------------
277 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
280 #----------------------------------------------------------------
283 %defattr(-,root
,root
)
284 %doc docs
/preamble.txt docs
/licence.txt docs
/readme.txt docs
/changes.txt
285 %doc wxPython
/README.txt wxPython
/CHANGES.txt
288 %files -n wxPython
%{port}-devel
-f DEVELLIST
289 %defattr(-,root
,root
)
292 #----------------------------------------------------------------