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 wxprefbase
%{pref}/lib
/wxPython
12 %define wxpref
%{wxprefbase}-%{version}
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.) The code is still
26 # compiled with optimization flags and such when this option is used,
27 # it simply turns on some extra code.
31 # build the name of the real wx-config from the port, flags, etc.
32 %define dbgflg %
(if [ "
%{debug_flag}"
= "
1"
]; then echo d
; fi)
33 %define uniflg %
(if [ "
%{unicode}"
= "
1"
]; then echo u
; fi)
34 %define DBGFLG %
(if [ "
%{debug_flag}"
= "
1"
]; then echo D
; fi)
35 %define UNIFLG %
(if [ "
%{unicode}"
= "
1"
]; then echo U
; fi)
36 %define wxconfigname
%{wxpref}/bin/wx%{lcport}%{uniflg}%{dbgflg}-%{ver2}-config
38 # turn off the generation of debuginfo rpm (RH9)
39 %define debug_package
%{nil}
41 #----------------------------------------------------------------
42 Summary: Cross platform GUI toolkit
for Python using wx
%{port}
46 Source0: %{tarname}-%{version}.tar.gz
47 License: wx Library Licence
, Version 3
48 URL: http
://wxPython.org
/
49 Packager: Robin Dunn
<robin@alldunn.com
>
50 Group: Development
/Python
51 BuildRoot: %{_tmppath}/%{name}-buildroot
54 Provides: wxPython
= %{version}
55 Provides: wxPython
%{port} = %{version}
57 # Provides: libwx_%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so
58 # Provides: libwx_%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
59 # Provides: libwx_%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so
60 # Provides: libwx_%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
63 # old wxPython packages
64 Obsoletes
: wxPython wxPython
%{port}
68 wxPython is a GUI toolkit
for Python that is a wrapper around the
69 wxWidgets C
++ GUI library. wxPython provides a large variety of
70 window types and controls
, all implemented with a native look and feel
71 (and native runtime speed
) on the platforms it is supported on.
73 This package is implemented using the
%{port} port of wxWidgets
, and
74 includes the wx
%{port} shared libs and etc.
77 %package -n wxPython
%{port}-devel
78 Summary: wxPython
%{port} development files
79 Group: Development
/Libraries
80 Requires: wxPython
%{port} = %{version}
83 %description -n wxPython
%{port}-devel
84 This packages contains the headers and etc.
for building apps or
85 Python extension modules that use the same wx
%{port} shared libraries
88 #----------------------------------------------------------------
90 %setup -q
-n
%{tarname}-%{version}
93 #----------------------------------------------------------------
100 # Configure, trying to reduce external dependencies
101 ..
/configure
--with
-%{lcport} \
104 --disable
-monolithic \
105 --enable-rpath
=%{wxpref}/lib \
113 --enable-sound
--with
-sdl \
116 --enable-debug_flag \
119 --with
-libjpeg
=builtin \
120 --with
-libpng
=builtin \
121 --with
-libtiff
=builtin \
122 --with
-zlib
=builtin \
126 # Build wxWidgets and some contrib libs
128 make -C contrib
/src
/gizmos
129 make -C contrib
/src
/ogl CXXFLAGS
="
-DwxUSE_DEPRECATED
=0"
130 make -C contrib
/src
/stc
131 make -C contrib
/src
/xrc
140 WX_CONFIG
="$WXDIR
/bld
/wx
-config
--prefix
=$WXDIR
--exec-prefix
=$WXDIR
/bld" \
141 CONTRIBS_INC
="$WXDIR
/contrib
/include" \
145 # Build wxrc (XRC resource tool)
146 cd $WXDIR
/bld
/contrib
/utils
/wxrc
151 #----------------------------------------------------------------
157 # Install wxWidgets and the contribs
158 make prefix
=$RPM_BUILD_ROOT
%{wxpref} install
159 make -C contrib
/src
/gizmos prefix
=$RPM_BUILD_ROOT
%{wxpref} install
160 make -C contrib
/src
/ogl CXXFLAGS
="
-DwxUSE_DEPRECATED
=0" prefix
=$RPM_BUILD_ROOT
%{wxpref} install
161 make -C contrib
/src
/stc prefix
=$RPM_BUILD_ROOT
%{wxpref} install
162 make -C contrib
/src
/xrc prefix
=$RPM_BUILD_ROOT
%{wxpref} install
171 WX_CONFIG
="$RPM_BUILD_ROOT
%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
173 --root
=$RPM_BUILD_ROOT
179 # Since I want this RPM to be as generic as possible I won't let
180 # distutils copy the scripts (NO_SCRIPTS=1 above) since it will mangle
181 # the #! line to use the real python pathname. Since some distros
182 # install python 2.2 as python2 and others as python I can't let
183 # distutils do that otherwise the dependencies will be fouled up.
184 # Copy them manually instead, leaving the #!/bin/env line intact.
185 # TODO: Should this be dependent on %{builtin_libs} or something like
188 mkdir -p $RPM_BUILD_ROOT
%{pref}/bin
200 cp scripts
/$s $RPM_BUILD_ROOT
%{pref}/bin
205 cp $WXDIR
/bld
/contrib
/utils
/wxrc
/wxrc $RPM_BUILD_ROOT
%{pref}/bin
208 # install KDE & GNOME menus
209 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/applnk
/Development
210 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/applications
211 for d
in distrib
/*.desktop
; do
212 install -m
644 $d $RPM_BUILD_ROOT
%{_datadir}/applnk
/Development
213 install -m
644 $d $RPM_BUILD_ROOT
%{_datadir}/applications
217 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/icons/hicolor/{16x16,32x32}/apps
218 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/pixmaps
219 install -m
644 wx
/py
/PyCrust_16.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/16x16
/apps
/PyCrust.png
220 install -m
644 wx
/py
/PyCrust_32.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/32x32
/apps
/PyCrust.png
221 install -m
644 wx
/py
/PyCrust_32.png $RPM_BUILD_ROOT
%{_datadir}/pixmaps
/PyCrust.png
222 install -m
644 wx
/tools
/XRCed
/XRCed_16.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/16x16
/apps
/XRCed.png
223 install -m
644 wx
/tools
/XRCed
/XRCed_32.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/32x32
/apps
/XRCed.png
224 install -m
644 wx
/tools
/XRCed
/XRCed_32.png $RPM_BUILD_ROOT
%{_datadir}/pixmaps
/XRCed.png
226 # install Mandrake menu
227 mkdir -p $RPM_BUILD_ROOT
/%{_libdir}/menu
228 cat
> $RPM_BUILD_ROOT
%{_libdir}/menu/%{name} <<EOF
229 ?package
(%{name}): \\
230 command="
%{_bindir}/pyshell" \\
232 icon
="PyCrust.png" \\
233 section
="Applications
/Development
/Tools" \\
235 longtitle
="GUI Python Shell"
236 ?package
(%{name}): \\
237 command="
%{_bindir}/pycrust" \\
239 icon
="PyCrust.png" \\
240 section
="Applications
/Development
/Tools" \\
242 longtitle
="GUI Python Shell with Filling"
243 ?package
(%{name}): \\
244 command="
%{_bindir}/pyalamode" \\
246 icon
="PyCrust.png" \\
247 section
="Applications
/Development
/Tools" \\
249 longtitle
="GUI Python Shell with Filling and editor windows"
250 ?package
(%{name}): \\
251 command="
%{_bindir}/xrced" \\
254 section
="Applications
/Development
/Tools" \\
256 longtitle
="wxPython XRC resource editor"
260 #----------------------------------------------------------------
263 if [ -e
%{wxprefbase} ]; then
264 # in case there are old dirs from an old install
270 if [ ! -e
%{wxprefbase} ]; then
271 ln
-s wxPython
-%{version} %{wxprefbase}
273 # This is done on Mandrake to update its menus:
274 if [ -x
/usr
/bin
/update
-menus
]; then /usr
/bin
/update
-menus || true
; fi
279 # This is done on Mandrake to update its menus:
280 if [ "$
1"
= "
0"
-a
-x
/usr
/bin
/update
-menus
]; then /usr
/bin
/update
-menus || true
; fi
283 #----------------------------------------------------------------
285 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
288 #----------------------------------------------------------------
291 %defattr(-,root
,root
)
292 %doc docs
/preamble.txt docs
/licence.txt docs
/lgpl.txt docs
/readme.txt docs
/changes.txt
295 %{_libdir}/python%{pyver}/site
-packages
/*
300 %{_datadir}/applnk
/Development
/*
301 %{_datadir}/applications
/*
302 %{_datadir}/icons
/hicolor
/*/apps
/*
303 %{_datadir}/pixmaps
/*
309 %files -n wxPython
%{port}-devel
310 %defattr(-,root
,root
)
314 %{wxpref}/bin
/wx
-config
316 #----------------------------------------------------------------