]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/wxPythonFull.spec.in
Add --with-sdl to the build doc and RPM spec
[wxWidgets.git] / wxPython / distrib / wxPythonFull.spec.in
1 %define pref %{_prefix}
2 %define python @PYTHON@
3 %define pyver @PYVER@
4 %define port @PORT@
5 %define lcport @LCPORT@
6 %define unicode @UNICODE@
7 %define tarname @TARNAME@
8 %define version @VERSION@
9 %define ver2 @VER2@
10 %define release 1
11 %define wxprefbase %{pref}/lib/wxPython
12 %define wxpref %{wxprefbase}-%{version}
13 %define name wxPython%{port}-py%{pyver}
14
15
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
18 # should use 1
19 %define builtin_libs 1
20
21
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.)
26 %define debug_flag 1
27
28
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
35
36 # turn off the generation of debuginfo rpm (RH9)
37 %define debug_package %{nil}
38
39 #----------------------------------------------------------------
40 Summary: Cross platform GUI toolkit for Python using wx%{port}
41 Name: %{name}
42 Version: %{version}
43 Release: %{release}
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
50 Prefix: %{pref}
51
52 Provides: wxPython = %{version}
53 Provides: wxPython%{port} = %{version}
54
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})
59
60
61 # old wxPython packages
62 Obsoletes: wxPython wxPython%{port}
63
64
65 %description
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.
70
71 This package is implemented using the %{port} port of wxWindows, and
72 includes the wx%{port} shared libs and etc.
73
74
75 %package -n wxPython%{port}-devel
76 Summary: wxPython%{port} development files
77 Group: Development/Libraries
78 Requires: wxPython%{port} = %{version}
79
80
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
84 that wxPython uses.
85
86 #----------------------------------------------------------------
87 %prep
88 %setup -q -n %{tarname}-%{version}
89
90
91 #----------------------------------------------------------------
92 %build
93
94 WXDIR=`pwd`
95 mkdir bld
96 cd bld
97
98 # Configure, trying to reduce external dependencies
99 ../configure --with-%{lcport} \
100 --prefix=%{wxpref} \
101 --disable-soname \
102 --disable-monolithic \
103 --enable-rpath=%{wxpref}/lib \
104 --with-opengl \
105 %if %{unicode}
106 --enable-gtk2 \
107 --enable-unicode \
108 %endif
109 --enable-geometry \
110 --enable-optimise \
111 --enable-sound --with-sdl \
112 --enable-display \
113 %if %{debug_flag}
114 --enable-debug_flag \
115 %endif
116 %if %{builtin_libs}
117 --with-libjpeg=builtin \
118 --with-libpng=builtin \
119 --with-libtiff=builtin \
120 --with-zlib=builtin \
121 %endif
122
123
124 # Build wxWindows and some contrib libs
125 make
126 make -C contrib/src/gizmos
127 make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0"
128 make -C contrib/src/stc
129 make -C contrib/src/xrc
130
131
132 # # Link the contrib header directories in place so we can build all of
133 # # wxPython without installing wxWindows
134 # if [ ! -e $WXDIR/include/wx/gizmos ]; then
135 # cd $WXDIR/include/wx
136 # ln -s ../../contrib/include/wx/* .
137 # fi
138
139
140 # Now build wxPython
141 cd $WXDIR/wxPython
142 %{python} setup.py \
143 NO_SCRIPTS=1 \
144 WXPORT=%{lcport} \
145 UNICODE=%{unicode} \
146 WX_CONFIG="$WXDIR/bld/wx-config --prefix=$WXDIR --exec-prefix=$WXDIR/bld" \
147 CONTRIBS_INC="$WXDIR/include" \
148 build
149
150
151 # Build wxrc (XRC resource tool)
152 cd $WXDIR/bld/contrib/utils/wxrc
153 make
154 strip wxrc
155
156
157 #----------------------------------------------------------------
158 %install
159
160 WXDIR=`pwd`
161 cd bld
162
163 # Install wxWindows and the contribs so the wxPython build can find
164 # all the headers it needs
165 make prefix=$RPM_BUILD_ROOT%{wxpref} install
166 make -C contrib/src/gizmos prefix=$RPM_BUILD_ROOT%{wxpref} install
167 make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" prefix=$RPM_BUILD_ROOT%{wxpref} install
168 make -C contrib/src/stc prefix=$RPM_BUILD_ROOT%{wxpref} install
169 make -C contrib/src/xrc prefix=$RPM_BUILD_ROOT%{wxpref} install
170
171
172 # install wxPython
173 cd $WXDIR/wxPython
174 %{python} setup.py \
175 NO_SCRIPTS=1 \
176 WXPORT=%{lcport} \
177 UNICODE=%{unicode} \
178 WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
179 install \
180 --root=$RPM_BUILD_ROOT
181
182
183
184 cd $WXDIR/wxPython
185
186 # install the wxPython headers
187 cp -R include $RPM_BUILD_ROOT%{wxpref}
188 mkdir -p $RPM_BUILD_ROOT%{wxpref}/include/wx/wxPython/i_files
189 cp src/*.i $RPM_BUILD_ROOT%{wxpref}/include/wx/wxPython/i_files
190
191
192 # Since I want this RPM to be as generic as possible I won't let
193 # distutils copy the scripts (NO_SCRIPTS=1 above) since it will mangle
194 # the #! line to use the real python pathname. Since some distros
195 # install python 2.2 as python2 and others as python I can't let
196 # distutils do that otherwise the dependencies will be fouled up.
197 # Copy them manually instead, leaving the #!/bin/env line intact.
198 # TODO: Should this be dependent on %{builtin_libs} or something like
199 # it?
200
201 mkdir -p $RPM_BUILD_ROOT%{pref}/bin
202 for s in \
203 helpviewer \
204 img2png \
205 img2py \
206 img2xpm \
207 pyalacarte \
208 pyalamode \
209 pycrust \
210 pywrap \
211 pyshell \
212 xrced; do
213 cp scripts/$s $RPM_BUILD_ROOT%{pref}/bin
214 done
215
216
217 # Install wxrc
218 cp $WXDIR/bld/contrib/utils/wxrc/wxrc $RPM_BUILD_ROOT%{pref}/bin
219
220
221 # install KDE & GNOME menus
222 mkdir -p $RPM_BUILD_ROOT%{_datadir}/applnk/Development
223 mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
224 for d in distrib/*.desktop; do
225 install -m 644 $d $RPM_BUILD_ROOT%{_datadir}/applnk/Development
226 install -m 644 $d $RPM_BUILD_ROOT%{_datadir}/applications
227 done
228
229 # install KDE icons
230 mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{16x16,32x32}/apps
231 mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
232 install -m 644 wx/py/PyCrust_16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/PyCrust.png
233 install -m 644 wx/py/PyCrust_32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/PyCrust.png
234 install -m 644 wx/py/PyCrust_32.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/PyCrust.png
235 install -m 644 wx/tools/XRCed/XRCed_16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/XRCed.png
236 install -m 644 wx/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/XRCed.png
237 install -m 644 wx/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/XRCed.png
238
239 # install Mandrake menu
240 mkdir -p $RPM_BUILD_ROOT/%{_libdir}/menu
241 cat > $RPM_BUILD_ROOT%{_libdir}/menu/%{name} <<EOF
242 ?package(%{name}): \\
243 command="%{_bindir}/pyshell" \\
244 needs="X11" \\
245 icon="PyCrust.png" \\
246 section="Applications/Development/Tools" \\
247 title="PyShell" \\
248 longtitle="GUI Python Shell"
249 ?package(%{name}): \\
250 command="%{_bindir}/pycrust" \\
251 needs="X11" \\
252 icon="PyCrust.png" \\
253 section="Applications/Development/Tools" \\
254 title="PyCrust" \\
255 longtitle="GUI Python Shell with Filling"
256 ?package(%{name}): \\
257 command="%{_bindir}/pyalamode" \\
258 needs="X11" \\
259 icon="PyCrust.png" \\
260 section="Applications/Development/Tools" \\
261 title="PyAlaMode" \\
262 longtitle="GUI Python Shell with Filling and editor windows"
263 ?package(%{name}): \\
264 command="%{_bindir}/xrced" \\
265 needs="X11" \\
266 icon="XRCed.png" \\
267 section="Applications/Development/Tools" \\
268 title="XRCed" \\
269 longtitle="wxPython XRC resource editor"
270 EOF
271
272
273 #----------------------------------------------------------------
274
275 %pre
276 if [ -e %{wxprefbase} ]; then
277 # in case there are old dirs from an old install
278 rm -r %{wxprefbase}
279 fi
280
281
282 %post
283 if [ ! -e %{wxprefbase} ]; then
284 ln -s wxPython-%{version} %{wxprefbase}
285 fi
286 # This is done on Mandrake to update its menus:
287 if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
288
289
290 %postun
291 rm -f %{wxprefbase}
292 # This is done on Mandrake to update its menus:
293 if [ "$1" = "0" -a -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
294
295
296 #----------------------------------------------------------------
297 %clean
298 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
299
300
301 #----------------------------------------------------------------
302
303 %files
304 %defattr(-,root,root)
305 %doc docs/preamble.txt docs/licence.txt docs/lgpl.txt docs/readme.txt docs/changes.txt
306 %doc wxPython/docs/*
307 %{_bindir}/*
308 %{_libdir}/python%{pyver}/site-packages/*
309 %dir %{wxpref}
310 %dir %{wxpref}/lib
311 %{wxpref}/lib/libwx*
312 %{wxpref}/share
313 %{_datadir}/applnk/Development/*
314 %{_datadir}/applications/*
315 %{_datadir}/icons/hicolor/*/apps/*
316 %{_datadir}/pixmaps/*
317 %{_libdir}/menu/*
318
319 ##%{wxprefbase}
320
321
322 %files -n wxPython%{port}-devel
323 %defattr(-,root,root)
324 %{wxpref}/include
325 %{wxpref}/lib/wx
326 %{wxconfigname}
327 %{wxpref}/bin/wx-config
328
329 #----------------------------------------------------------------
330 # end of file