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.)
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 #----------------------------------------------------------------
98 # Configure, trying to reduce external dependencies
99 ..
/configure
--with
-%{lcport} \
102 --disable
-monolithic \
103 --enable-rpath
=%{wxpref}/lib \
112 --enable-debug_flag \
115 --with
-libjpeg
=builtin \
116 --with
-libpng
=builtin \
117 --with
-libtiff
=builtin \
118 --with
-zlib
=builtin \
122 # Build wxWindows and some contrib libs
124 make -C contrib
/src
/gizmos
125 make -C contrib
/src
/ogl CXXFLAGS
="
-DwxUSE_DEPRECATED
=0"
126 make -C contrib
/src
/stc
127 make -C contrib
/src
/xrc
130 # Install wxWindows and the contribs so the wxPython build can find
131 # all the headers it needs
132 make prefix
=$RPM_BUILD_ROOT
%{wxpref} install
133 make -C contrib
/src
/gizmos prefix
=$RPM_BUILD_ROOT
%{wxpref} install
134 make -C contrib
/src
/ogl CXXFLAGS
="
-DwxUSE_DEPRECATED
=0" prefix
=$RPM_BUILD_ROOT
%{wxpref} install
135 make -C contrib
/src
/stc prefix
=$RPM_BUILD_ROOT
%{wxpref} install
136 make -C contrib
/src
/xrc prefix
=$RPM_BUILD_ROOT
%{wxpref} install
145 WX_CONFIG
="$RPM_BUILD_ROOT
%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
148 ## $WXDIR/bld/wx-config --prefix=$WXDIR --exec-prefix=$WXDIR/bld"
150 # Build wxrc (XRC resource tool)
151 cd $WXDIR
/bld
/contrib
/utils
/wxrc
162 WX_CONFIG
="$RPM_BUILD_ROOT
%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
164 --root
=$RPM_BUILD_ROOT
167 #----------------------------------------------------------------
170 # Other "install" tasks...
174 # install the wxPython headers
175 cp
-R include $RPM_BUILD_ROOT
%{wxpref}
176 mkdir -p $RPM_BUILD_ROOT
%{wxpref}/include
/wx
/wxPython
/i_files
177 cp src
/*.i $RPM_BUILD_ROOT
%{wxpref}/include
/wx
/wxPython
/i_files
180 # Since I want this RPM to be as generic as possible I won't let
181 # distutils copy the scripts (NO_SCRIPTS=1 above) since it will mangle
182 # the #! line to use the real python pathname. Since some distros
183 # install python 2.2 as python2 and others as python I can't let
184 # distutils do that otherwise the dependencies will be fouled up.
185 # Copy them manually instead, leaving the #!/bin/env line intact.
186 # TODO: Should this be dependent on %{builtin_libs} or something like
189 mkdir -p $RPM_BUILD_ROOT
%{pref}/bin
201 cp scripts
/$s $RPM_BUILD_ROOT
%{pref}/bin
206 cp $WXDIR
/bld
/contrib
/utils
/wxrc
/wxrc $RPM_BUILD_ROOT
%{pref}/bin
209 # link specific name to generic name
210 ##ln -s wxPython-%{version} $RPM_BUILD_ROOT%{wxprefbase}
213 # install KDE & GNOME menus
214 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/applnk
/Development
215 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/applications
216 for d
in distrib
/*.desktop
; do
217 install -m
644 $d $RPM_BUILD_ROOT
%{_datadir}/applnk
/Development
218 install -m
644 $d $RPM_BUILD_ROOT
%{_datadir}/applications
222 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/icons/hicolor/{16x16,32x32}/apps
223 mkdir -p $RPM_BUILD_ROOT
%{_datadir}/pixmaps
224 install -m
644 wx
/py
/PyCrust_16.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/16x16
/apps
/PyCrust.png
225 install -m
644 wx
/py
/PyCrust_32.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/32x32
/apps
/PyCrust.png
226 install -m
644 wx
/py
/PyCrust_32.png $RPM_BUILD_ROOT
%{_datadir}/pixmaps
/PyCrust.png
227 install -m
644 wx
/tools
/XRCed
/XRCed_16.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/16x16
/apps
/XRCed.png
228 install -m
644 wx
/tools
/XRCed
/XRCed_32.png $RPM_BUILD_ROOT
%{_datadir}/icons
/hicolor
/32x32
/apps
/XRCed.png
229 install -m
644 wx
/tools
/XRCed
/XRCed_32.png $RPM_BUILD_ROOT
%{_datadir}/pixmaps
/XRCed.png
231 # install Mandrake menu
232 mkdir -p $RPM_BUILD_ROOT
/%{_libdir}/menu
233 cat
> $RPM_BUILD_ROOT
%{_libdir}/menu/%{name} <<EOF
234 ?package
(%{name}): \\
235 command="
%{_bindir}/pyshell" \\
237 icon
="PyCrust.png" \\
238 section
="Applications
/Development
/Tools" \\
240 longtitle
="GUI Python Shell"
241 ?package
(%{name}): \\
242 command="
%{_bindir}/pycrust" \\
244 icon
="PyCrust.png" \\
245 section
="Applications
/Development
/Tools" \\
247 longtitle
="GUI Python Shell with Filling"
248 ?package
(%{name}): \\
249 command="
%{_bindir}/pyalamode" \\
251 icon
="PyCrust.png" \\
252 section
="Applications
/Development
/Tools" \\
254 longtitle
="GUI Python Shell with Filling and editor windows"
255 ?package
(%{name}): \\
256 command="
%{_bindir}/xrced" \\
259 section
="Applications
/Development
/Tools" \\
261 longtitle
="wxPython XRC resource editor"
265 #----------------------------------------------------------------
268 if [ -e
%{wxprefbase} ]; then
269 # in case there are old dirs from an old install
275 if [ ! -e
%{wxprefbase} ]; then
276 ln
-s wxPython
-%{version} %{wxprefbase}
278 # This is done on Mandrake to update its menus:
279 if [ -x
/usr
/bin
/update
-menus
]; then /usr
/bin
/update
-menus || true
; fi
283 if [ -e
%{wxprefbase} ]; then
286 # This is done on Mandrake to update its menus:
287 if [ "$
1"
= "
0"
-a
-x
/usr
/bin
/update
-menus
]; then /usr
/bin
/update
-menus || true
; fi
290 #----------------------------------------------------------------
292 [ "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
295 #----------------------------------------------------------------
298 %defattr(-,root
,root
)
299 %doc docs
/preamble.txt docs
/licence.txt docs
/lgpl.txt docs
/readme.txt docs
/changes.txt
302 %{_libdir}/python%{pyver}/site
-packages
/*
305 %{_datadir}/applnk
/Development
/*
306 %{_datadir}/applications
/*
307 %{_datadir}/icons
/hicolor
/*/apps
/*
308 %{_datadir}/pixmaps
/*
314 %files -n wxPython
%{port}-devel
315 %defattr(-,root
,root
)
319 %{wxpref}/bin
/wx
-config
321 #----------------------------------------------------------------