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-%{version}
12 %define wxprefbase
%{pref}/lib
/wxPython
13 %define name wxPython
%{port}-py%{pyver}
16 # Should the builtin image and etc. libs be used, or system libs?
17 # Distro specific RPMs should probably set this to 0, generic ones
19 %define builtin_libs
1
22 # Should --enable-debug_flag be used in release builds? Using it
23 # defines __WXDEBUG__ and gives us runtime diagnostics that are turned
24 # into Python exceptions starting with 2.3.4. (So turning it on is a
25 # very helpful thing IMO and is recommended.)
29 # build the name of the real wx-config from the port, flags, etc.
30 %define dbgflg %
(if [ "
%{debug_flag}"
= "
1"
]; then echo d
; fi)
31 %define uniflg %
(if [ "
%{unicode}"
= "
1"
]; then echo u
; fi)
32 %define DBGFLG %
(if [ "
%{debug_flag}"
= "
1"
]; then echo D
; fi)
33 %define UNIFLG %
(if [ "
%{unicode}"
= "
1"
]; then echo U
; fi)
34 %define wxconfigname
%{wxpref}/bin/wx%{lcport}%{uniflg}%{dbgflg}-%{ver2}-config
36 # turn off the generation of debuginfo rpm (RH9)
37 %define debug_package
%{nil}
39 #----------------------------------------------------------------
40 Summary: Cross platform GUI toolkit
for Python using wx
%{port}
44 Source0: %{tarname}-%{version}.tar.gz
45 License: wxWindows Library Licence
, Version 3
46 URL: http
://wxPython.org
/
47 Packager: Robin Dunn
<robin@alldunn.com
>
48 Group: Development
/Python
49 BuildRoot: %{_tmppath}/%{name}-buildroot
52 Provides: wxPython
= %{version}
53 Provides: wxPython
%{port} = %{version}
55 Provides: libwx_
%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so
56 Provides: libwx_
%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
57 Provides: libwx_
%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so
58 Provides: libwx_
%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
61 # old wxPython packages
62 Obsoletes
: wxPython wxPython
%{port}
66 wxPython is a GUI toolkit
for Python that is a wrapper around the
67 wxWindows C
++ GUI library. wxPython provides a large variety of
68 window types and controls
, all implemented with a native look and feel
69 (and native runtime speed
) on the platforms it is supported on.
71 This package is implemented using the
%{port} port of wxWindows
, and
72 includes the wx
%{port} shared libs and etc.
75 %package -n wxPython
%{port}-devel
76 Summary: wxPython
%{port} development files
77 Group: Development
/Libraries
78 Requires: wxPython
%{port} = %{version}
81 %description -n wxPython
%{port}-devel
82 This packages contains the headers and etc.
for building apps or
83 Python extension modules that use the same wx
%{port} shared libraries
86 #----------------------------------------------------------------
88 %setup -q
-n
%{tarname}-%{version}
91 #----------------------------------------------------------------
93 if [ "$SMP"
!= ""
]; then
103 # Configure, trying to reduce external dependencies
104 $WXDIR
/configure
--with
-%{lcport} \
107 --enable-rpath
=%{wxpref}/lib \
116 --enable-debug_flag \
119 --with
-libjpeg
=builtin \
120 --with
-libpng
=builtin \
121 --with
-libtiff
=builtin \
122 --with
-zlib
=builtin \
137 WX_CONFIG
="$WXDIR
/build
/wx
-config
--prefix
=$WXDIR
--exec-prefix
=$WXDIR
/build" \
142 # Build wxrc (XRC resource tool) but don't use the makefiles since they expect
143 # a shared version of the xrc lib to have been built...
144 cd $WXDIR
/contrib
/utils
/wxrc
145 WX_CONFIG
="$WXDIR
/build
/wx
-config
--prefix
=$WXDIR
--exec-prefix
=$WXDIR
/build"
146 wCC
=`$WX_CONFIG
--cc`
147 wCXX
=`$WX_CONFIG
--cxx`
149 for f
in wxrc.cpp ..
/..
/src
/xrc
/xml.cpp ..
/..
/src
/xrc
/xmlres.cpp
; do
151 $wCXX `$WX_CONFIG
--cxxflags`
-I ..
/..
/include
-I ..
/..
/src
/xrc
/expat
/xmlparse
-I ..
/..
/src
/xrc
/expat
/xmltok
-c $f
153 for f
in ..
/..
/src
/xrc
/expat
/xmlparse
/xmlparse.c ..
/..
/src
/xrc
/expat
/xmltok
/xmlrole.c ..
/..
/src
/xrc
/expat
/xmltok
/xmltok.c
; do
155 $wCC `$WX_CONFIG
--cxxflags`
-I ..
/..
/include
-I ..
/..
/src
/xrc
/expat
/xmlparse
-I ..
/..
/src
/xrc
/expat
/xmltok
-c $f
158 $wCXX `$WX_CONFIG
--libs`
*.o
-o wxrc
162 #----------------------------------------------------------------
164 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
169 make prefix
=$RPM_BUILD_ROOT
%{wxpref} install
178 WX_CONFIG
="$RPM_BUILD_ROOT
%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
180 --root
=$RPM_BUILD_ROOT
182 # Since I want this RPM to be as generic as possible I won't let
183 # distutils copy the scripts since it will mangle the #! line to use
184 # the real python pathname. Since some distros install python 2.2 as
185 # python2 and others as python, then I can't let distutils do that
186 # otherwise the dependencies will be fouled up. Copy them manually
187 # instead, leaving the #!/bin/env line intact.
189 # TODO: Should this be dependent on %{builtin_libs} or something like it?
191 mkdir -p $RPM_BUILD_ROOT
/usr
/bin
203 cp scripts
/$s $RPM_BUILD_ROOT
/%{pref}/bin
208 cp $WXDIR
/contrib
/utils
/wxrc
/wxrc $RPM_BUILD_ROOT
/%{pref}/bin
211 # Copy icons and make menu entries
212 #-- This only works for Mandrake. Is there a cross-distro way to do it?
213 ##mkdir -p $RPM_BUILD_ROOT/%{_iconsdir}
214 ##mkdir -p $RPM_BUILD_ROOT/%{_miconsdir}
215 ##mkdir -p $RPM_BUILD_ROOT/%{_menudir}
216 ##install -p -m 644 $WXDIR/wxPython/wxPython/py/PyCrust_32.png $RPM_BUILD_ROOT/%{_iconsdir}/PyCrust.png
217 ##install -p -m 644 $WXDIR/wxPython/wxPython/py/PyCrust_16.png $RPM_BUILD_ROOT/%{_miconsdir}/PyCrust.png
218 ##install -p -m 644 $WXDIR/wxPython/wxPython/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT/%{_iconsdir}/XRCed.png
219 ##install -p -m 644 $WXDIR/wxPython/wxPython/tools/XRCed/XRCed_16.png $RPM_BUILD_ROOT/%{_miconsdir}/XRCed.png
221 ##cat > $RPM_BUILD_ROOT/%{_menudir}/%{name} <<EOF
222 ##?package(%{name}): command="%_bindir/pyshell" needs="X11" \
223 ##icon="PyCrust.png" section="Applications/Development" \
224 ##title="PyShell" longtitle="Python Shell"
226 ##?package(%{name}): command="%_bindir/pycrust" needs="X11" \
227 ##icon="PyCrust.png" section="Applications/Development" \
228 ##title="PyCrust" longtitle="Python Shell with Filling"
230 ##?package(%{name}): command="%_bindir/pyalamode" needs="X11" \
231 ##icon="PyCrust.png" section="Applications/Development" \
232 ##title="PyAlaMode" longtitle="Python Shell with Filling and editor windows"
234 ##?package(%{name}): command="%_bindir/xrced" needs="X11" \
235 ##icon="XRCed.png" section="Applications/Development" \
236 ##title="XRCed" longtitle="wxPython XRC resource editor"
242 # Generate the filelists. For some reason the %defattr below is still
243 # resulting in many (but not all) files not owned by root when just
244 # specifying directories and wildcards to be included in each package.
245 # So instead we'll build some explicit filelists here and use %attr on
248 mkdir -p $RPM_BUILD_ROOT
%{pref}/share
/doc
249 GFL
="
%{python} wxPython
/distrib
/genfilelist.py"
250 $GFL $RPM_BUILD_ROOT
%{pref} > FILELIST
251 $GFL
-r $RPM_BUILD_ROOT
%{pref}/bin
>> FILELIST
252 $GFL $RPM_BUILD_ROOT
%{pref}/lib
>> FILELIST
253 $GFL
-r $RPM_BUILD_ROOT
%{pref}/lib/python%{pyver} >> FILELIST
254 $GFL
-r $RPM_BUILD_ROOT
%{pref}/share
>> FILELIST
255 $GFL $RPM_BUILD_ROOT
%{wxpref} >> FILELIST
256 $GFL $RPM_BUILD_ROOT
%{wxpref}/lib
>> FILELIST
257 $GFL $RPM_BUILD_ROOT "
%{wxpref}/lib
/libwx
*"
>> FILELIST
258 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/share
>> FILELIST
259 ###GFL -r $RPM_BUILD_ROOT %{_iconsdir} >> FILELIST
260 ##$GFL -r $RPM_BUILD_ROOT %{_menudir} >> FILELIST
262 $GFL $RPM_BUILD_ROOT
%{wxpref}/include
> DEVELLIST
263 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/include
/wx
>> DEVELLIST
264 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/lib
/wx
>> DEVELLIST
265 $GFL $RPM_BUILD_ROOT
%{wxconfigname} >> DEVELLIST
266 $GFL $RPM_BUILD_ROOT
%{wxpref}/bin
/wx
-config
>> DEVELLIST
269 #----------------------------------------------------------------
278 if [ -e
%{wxprefbase} ]; then
281 ln
-s
%{wxpref} %{wxprefbase}
284 if [ -e
%{wxprefbase} ]; then
288 #----------------------------------------------------------------
290 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
293 #----------------------------------------------------------------
296 %defattr(-,root
,root
)
297 %doc docs
/preamble.txt docs
/licence.txt docs
/readme.txt docs
/changes.txt
298 %doc wxPython
/README.txt wxPython
/CHANGES.txt
301 %files -n wxPython
%{port}-devel
-f DEVELLIST
302 %defattr(-,root
,root
)
305 #----------------------------------------------------------------