1 %define pref
%{_prefix}
2 %define python @PYTHON@
5 %define lcport @LCPORT@
6 %define unicode @UNICODE@
7 %define tarname @TARNAME@
8 %define version @VERSION@
10 %define wxprefbase
%{pref}/lib
/wxPython
11 %define wxpref
%{wxprefbase}-%{version}
12 %define name wxPython
%{port}-py%{pyver}
15 # Allow the release tag to be specified on the rpmbuild command
16 # line with --define 'release SOMETHING' If no such definition is
17 # used then the release number is 1.
18 %if %{?release:0}%{!?release:1}
23 # Should the builtin image and etc. libs be used, or system libs?
24 # Distro specific RPMs should probably set this to 0, generic ones
26 %define builtin_libs
1
29 # Should --enable-debug_flag be used in release builds? Using it
30 # defines __WXDEBUG__ and gives us runtime diagnostics that are turned
31 # into Python exceptions starting with 2.3.4. (So turning it on is a
32 # very helpful thing IMO and is recommended.) The code is still
33 # compiled with optimization flags and such when this option is used,
34 # it simply turns on some extra code.
38 # build the name of the real wx-config from the port, flags, etc.
39 %define dbgflg %
(if [ "
%{debug_flag}"
= "
1"
]; then echo d
; fi)
40 %define uniflg %
(if [ "
%{unicode}"
= "
1"
]; then echo u
; fi)
41 %define DBGFLG %
(if [ "
%{debug_flag}"
= "
1"
]; then echo D
; fi)
42 %define UNIFLG %
(if [ "
%{unicode}"
= "
1"
]; then echo U
; fi)
43 %define wxconfigname
%{wxpref}/bin/wx%{lcport}%{uniflg}%{dbgflg}-%{ver2}-config
45 # turn off the generation of debuginfo rpm (RH9)
46 %define debug_package
%{nil}
48 #----------------------------------------------------------------
49 Summary: Cross platform GUI toolkit
for Python using wx
%{port}
53 Source0: %{tarname}-%{version}.tar.gz
54 License: wx Library Licence
, Version 3
55 URL: http
://wxPython.org
/
56 Packager: Robin Dunn
<robin@alldunn.com
>
57 Group: Development
/Python
58 BuildRoot: %{_tmppath}/%{name}-buildroot
61 Provides: wxPython
= %{version}
62 Provides: wxPython
%{port} = %{version}
64 # Provides: libwx_%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so
65 # Provides: libwx_%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
66 # Provides: libwx_%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so
67 # Provides: libwx_%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
70 # old wxPython packages
71 Obsoletes
: wxPython wxPython
%{port}
75 wxPython is a GUI toolkit
for Python that is a wrapper around the
76 wxWidgets C
++ GUI library. wxPython provides a large variety of
77 window types and controls
, all implemented with a native look and feel
78 (and native runtime speed
) on the platforms it is supported on.
80 This package is implemented using the
%{port} port of wxWidgets
, and
81 includes the wx
%{port} shared libs and etc.
84 %package -n wxPython
%{port}-devel
85 Summary: wxPython
%{port} development files
86 Group: Development
/Libraries
87 Requires: wxPython
%{port} = %{version}
90 %description -n wxPython
%{port}-devel
91 This packages contains the headers and etc.
for building apps or
92 Python extension modules that use the same wx
%{port} shared libraries
95 #----------------------------------------------------------------
97 %setup -q
-n
%{tarname}-%{version}
100 #----------------------------------------------------------------
107 # Configure, trying to reduce external dependencies
108 ..
/configure
--with
-%{lcport} \
111 --disable
-monolithic \
112 --enable-rpath
=%{wxpref}/lib \
122 --enable-sound
--with
-sdl \
125 --enable-debug_flag \
128 --with
-libjpeg
=builtin \
129 --with
-libpng
=builtin \
130 --with
-libtiff
=builtin \
131 --with
-zlib
=builtin \
135 # Build wxWidgets and some contrib libs
137 make -C contrib
/src
/gizmos
138 make -C contrib
/src
/ogl CXXFLAGS
="
-DwxUSE_DEPRECATED
=0"
139 make -C contrib
/src
/stc
140 make -C contrib
/src
/xrc
149 WX_CONFIG
="$WXDIR
/bld
/wx
-config
--inplace" \
153 # Build wxrc (XRC resource tool)
154 cd $WXDIR
/bld
/contrib
/utils
/wxrc
159 #----------------------------------------------------------------
165 # Install wxWidgets and the contribs
166 make prefix
=$RPM_BUILD_ROOT
%{wxpref} install
167 make -C contrib
/src
/gizmos prefix
=$RPM_BUILD_ROOT
%{wxpref} install
168 make -C contrib
/src
/ogl CXXFLAGS
="
-DwxUSE_DEPRECATED
=0" prefix
=$RPM_BUILD_ROOT
%{wxpref} install
169 make -C contrib
/src
/stc prefix
=$RPM_BUILD_ROOT
%{wxpref} install
170 make -C contrib
/src
/xrc prefix
=$RPM_BUILD_ROOT
%{wxpref} install
179 WX_CONFIG
="$RPM_BUILD_ROOT
%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
181 --root
=$RPM_BUILD_ROOT
187 # Since I want this RPM to be as generic as possible I won't let
188 # distutils copy the scripts (NO_SCRIPTS=1 above) since it will mangle
189 # the #! line to use the real python pathname. Since some distros
190 # install python 2.2 as python2 and others as python I can't let
191 # distutils do that otherwise the dependencies will be fouled up.
192 # Copy them manually instead, leaving the #!/bin/env line intact.
193 # TODO: Should this be dependent on %{builtin_libs} or something like
196 mkdir -p $RPM_BUILD_ROOT
%{pref}/bin
208 cp scripts
/$s $RPM_BUILD_ROOT
%{pref}/bin
213 cp $WXDIR
/bld
/contrib
/utils
/wxrc
/wxrc $RPM_BUILD_ROOT
%{pref}/bin
216 # install KDE & GNOME menus
217 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/applnk
/Development
218 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/applications
219 for d
in distrib
/*.desktop
; do
220 install -m
644 $d $RPM_BUILD_ROOT
%{_datadir}/applnk
/Development
221 install -m
644 $d $RPM_BUILD_ROOT
%{_datadir}/applications
225 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/icons/hicolor/{16x16,32x32}/apps
226 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/pixmaps
227 install -m
644 wx
/py
/PyCrust_16.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/16x16
/apps
/PyCrust.png
228 install -m
644 wx
/py
/PyCrust_32.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/32x32
/apps
/PyCrust.png
229 install -m
644 wx
/py
/PyCrust_32.png $RPM_BUILD_ROOT
%{_datadir}/pixmaps
/PyCrust.png
230 install -m
644 wx
/tools
/XRCed
/XRCed_16.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/16x16
/apps
/XRCed.png
231 install -m
644 wx
/tools
/XRCed
/XRCed_32.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/32x32
/apps
/XRCed.png
232 install -m
644 wx
/tools
/XRCed
/XRCed_32.png $RPM_BUILD_ROOT
%{_datadir}/pixmaps
/XRCed.png
234 # install Mandrake menu
235 mkdir -p $RPM_BUILD_ROOT
/%{_libdir}/menu
236 cat
> $RPM_BUILD_ROOT
%{_libdir}/menu/%{name} <<EOF
237 ?package
(%{name}): \\
238 command="
%{_bindir}/pyshell" \\
240 icon
="PyCrust.png" \\
241 section
="Applications
/Development
/Tools" \\
243 longtitle
="GUI Python Shell"
244 ?package
(%{name}): \\
245 command="
%{_bindir}/pycrust" \\
247 icon
="PyCrust.png" \\
248 section
="Applications
/Development
/Tools" \\
250 longtitle
="GUI Python Shell with Filling"
251 ?package
(%{name}): \\
252 command="
%{_bindir}/pyalamode" \\
254 icon
="PyCrust.png" \\
255 section
="Applications
/Development
/Tools" \\
257 longtitle
="GUI Python Shell with Filling and editor windows"
258 ?package
(%{name}): \\
259 command="
%{_bindir}/xrced" \\
262 section
="Applications
/Development
/Tools" \\
264 longtitle
="wxPython XRC resource editor"
268 #----------------------------------------------------------------
271 if [ -e
%{wxprefbase} ]; then
272 # in case there are old dirs from an old install
278 if [ ! -e
%{wxprefbase} ]; then
279 ln
-s wxPython
-%{version} %{wxprefbase}
281 # This is done on Mandrake to update its menus:
282 if [ -x
/usr
/bin
/update
-menus
]; then /usr
/bin
/update
-menus || true
; fi
287 # This is done on Mandrake to update its menus:
288 if [ "$
1"
= "
0"
-a
-x
/usr
/bin
/update
-menus
]; then /usr
/bin
/update
-menus || true
; fi
291 #----------------------------------------------------------------
293 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
296 #----------------------------------------------------------------
299 %defattr(-,root
,root
)
300 %doc docs
/preamble.txt docs
/licence.txt docs
/lgpl.txt docs
/readme.txt docs
/changes.txt
303 %{_libdir}/python%{pyver}/site
-packages
/*
308 %{_datadir}/applnk
/Development
/*
309 %{_datadir}/applications
/*
310 %{_datadir}/icons
/hicolor
/*/apps
/*
311 %{_datadir}/pixmaps
/*
317 %files -n wxPython
%{port}-devel
318 %defattr(-,root
,root
)
322 %{wxpref}/bin
/wx
-config
323 %{wxpref}/bin/wx-config-%{ver2}
325 #----------------------------------------------------------------