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 wxconfigname
%{wxpref}/bin/wx%{lcport}%{uniflg}%{dbgflg}-%{ver2}-config
34 #----------------------------------------------------------------
35 Summary: Cross platform GUI toolkit
for Python using wx
%{port}
39 Source0: %{tarname}-%{version}.tar.gz
40 License: wxWindows Library Licence
, Version 3
41 URL: http
://wxPython.org
/
42 Packager: Robin Dunn
<robin@alldunn.com
>
43 Group: Development
/Python
44 BuildRoot: %{_tmppath}/%{name}-buildroot
46 #BuildRequires: %{python}
48 Provides: wxPython
= %{version}
49 Provides: wxPython
%{port} = %{version}
51 # old wxPython packages
56 wxPython is a GUI toolkit
for Python that is a wrapper around the
57 wxWindows C
++ GUI library. wxPython provides a large variety of
58 window types and controls
, all implemented with a native look and feel
59 (and native runtime speed
) on the platforms it is supported on.
61 This package is implemented using the
%{port} port of wxWindows
, and
62 includes the wx
%{port} shared libs and etc.
65 %package -n wxPython
%{port}-devel
66 Summary: wxPython
%{port} development files
67 Group: Development
/Libraries
68 Requires: wxPython
%{port} = %{version}
71 %description -n wxPython
%{port}-devel
72 This packages contains the headers and etc.
for building apps or
73 Python extension modules that use the same wx
%{port} shared libraries
76 #----------------------------------------------------------------
78 %setup -q
-n
%{tarname}-%{version}
81 #----------------------------------------------------------------
83 if [ "$SMP"
!= ""
]; then
93 # Configure, trying to reduce external dependencies
94 $WXDIR
/configure
--with
-%{lcport} \
97 --enable-rpath
=%{wxpref}/lib \
106 --enable-debug_flag \
109 --with
-libjpeg
=builtin \
110 --with
-libpng
=builtin \
111 --with
-libtiff
=builtin \
112 --with
-zlib
=builtin \
127 WX_CONFIG
="$WXDIR
/build
/wx
-config
--prefix
=$WXDIR
--exec-prefix
=$WXDIR
/build" \
130 ## WX_CONFIG="$WXDIR/build/wx-config --inplace --prefix=$RPM_BUILD_ROOT%{wxpref}" \
134 # Build wxrc (XRC resource tool) but don't use the makefiles since they expect
135 # a shared version of the xrc lib to have been built...
136 cd $WXDIR
/contrib
/utils
/wxrc
137 WX_CONFIG
="$WXDIR
/build
/wx
-config
--prefix
=$WXDIR
--exec-prefix
=$WXDIR
/build"
138 wCC
=`$WX_CONFIG
--cc`
139 wCXX
=`$WX_CONFIG
--cxx`
141 for f
in wxrc.cpp ..
/..
/src
/xrc
/*.cpp
; do
143 $wCXX `$WX_CONFIG
--cxxflags`
-I ..
/..
/include
-I ..
/..
/src
/xrc
/expat
/xmlparse
-I ..
/..
/src
/xrc
/expat
/xmltok
-c $f
145 for f
in ..
/..
/src
/xrc
/expat
/xmlparse
/xmlparse.c ..
/..
/src
/xrc
/expat
/xmltok
/xmlrole.c ..
/..
/src
/xrc
/expat
/xmltok
/xmltok.c
; do
147 $wCC `$WX_CONFIG
--cxxflags`
-I ..
/..
/include
-I ..
/..
/src
/xrc
/expat
/xmlparse
-I ..
/..
/src
/xrc
/expat
/xmltok
-c $f
150 # the handlers are not needed
153 $wCXX `$WX_CONFIG
--libs`
*.o
-o wxrc
157 #----------------------------------------------------------------
159 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
164 make prefix
=$RPM_BUILD_ROOT
%{wxpref} install
173 WX_CONFIG
="$RPM_BUILD_ROOT
%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
175 --root
=$RPM_BUILD_ROOT
177 # Since I want this RPM to be as generic as possible I won't let
178 # distutils copy the scripts since it will mangle the #! line to use
179 # the real python pathname. Since some distros install python 2.2 as
180 # python2 and others as python, then I can't let distutils do that
181 # otherwise the dependencies will be fouled up. Copy them manually
182 # instead, leaving the #!/bin/env line intact.
184 # TODO: Should this be dependent on %{builtin_libs} or something like it?
186 mkdir -p $RPM_BUILD_ROOT
/usr
/bin
196 cp scripts
/$s $RPM_BUILD_ROOT
/%{pref}/bin
201 cp $WXDIR
/contrib
/utils
/wxrc
/wxrc $RPM_BUILD_ROOT
/%{pref}/bin
204 # Generate the filelists. For some reason the %defattr below is still
205 # resulting in many (but not all) files not owned by root when just
206 # specifying directories and wildcards to be included in each package.
207 # So instead we'll build some explicit filelists here and use %attr on
210 mkdir -p $RPM_BUILD_ROOT
%{pref}/share
/doc
211 GFL
="
%{python} wxPython
/distrib
/genfilelist.py"
212 $GFL $RPM_BUILD_ROOT
%{pref} > FILELIST
213 $GFL
-r $RPM_BUILD_ROOT
%{pref}/bin
>> FILELIST
214 $GFL $RPM_BUILD_ROOT
%{pref}/lib
>> FILELIST
215 $GFL
-r $RPM_BUILD_ROOT
%{pref}/lib/python%{pyver} >> FILELIST
216 $GFL
-r $RPM_BUILD_ROOT
%{pref}/share
>> FILELIST
217 $GFL $RPM_BUILD_ROOT
%{wxpref} >> FILELIST
218 $GFL $RPM_BUILD_ROOT
%{wxpref}/lib
>> FILELIST
219 $GFL $RPM_BUILD_ROOT "
%{wxpref}/lib
/libwx
*"
>> FILELIST
220 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/share
>> FILELIST
222 $GFL $RPM_BUILD_ROOT
%{wxpref}/include
> DEVELLIST
223 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/include
/wx
>> DEVELLIST
224 $GFL
-r $RPM_BUILD_ROOT
%{wxpref}/lib
/wx
>> DEVELLIST
225 $GFL $RPM_BUILD_ROOT
%{wxconfigname} >> DEVELLIST
226 $GFL $RPM_BUILD_ROOT
%{wxpref}/bin
/wx
-config
>> DEVELLIST
229 #----------------------------------------------------------------
231 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
234 #----------------------------------------------------------------
237 %defattr(-,root
,root
)
238 %doc docs
/preamble.txt docs
/licence.txt docs
/readme.txt docs
/changes.txt
239 %doc wxPython
/README.txt wxPython
/CHANGES.txt
242 %files -n wxPython
%{port}-devel
-f DEVELLIST
243 %defattr(-,root
,root
)
246 #----------------------------------------------------------------