2 BuildRequires: db4-devel fdupes gdbm-devel gmp-devel bzip2-devel openssl-devel ncurses-devel readline-devel sqlite-devel
3 Url: http://www.python.org/
4 License: MIT License (or similar)
5 Group: Development/Languages/Python
6 Obsoletes: python-nothreads python21 python-elementtree python-sqlite
7 Summary: Python Interpreter
10 Requires: python-base = %{version}
11 %define tarversion %{version}
12 %define tarname Python-%{tarversion}
13 Source0: %{tarname}.tar.bz2
17 #Source11: testfiles.tar.bz2
18 # issues with copyrighted Unicode testing files
19 Patch1: python-2.7-dirs.patch
20 Patch2: python-2.7.1-multilib.patch
21 Patch3: python-2.7rc2-canonicalize2.patch
22 Patch4: python-2.5.1-sqlite.patch
23 Patch5: python-2.7rc2-configure.patch
24 Patch6: python-2.6b3-curses-panel.patch
25 Patch7: sparc_longdouble.patch
26 Patch9: python-2.7.1-fix_date_time_compiler.patch
27 Patch10: python-2.7-fix-parallel-make.patch
28 Patch11: python-2.7.1-linux3.patch
30 %define python_version %(echo %{version} | head -c 3)
31 %define idle_name idle
32 Provides: %{name} = %{python_version}
35 Python is an interpreted, object-oriented programming language, and is
36 often compared to Tcl, Perl, Scheme, or Java. You can find an overview
37 of Python in the documentation and tutorials included in the python-doc
38 (HTML) or python-doc-pdf (PDF) packages.
40 If you want to install third party modules using distutils, you need to
41 install python-devel package.
47 Guido van Rossum <guido@python.org>
50 License: Python License ..
51 Requires: python-base = %{version}
52 Summary: An Integrated Development Environment for Python
53 Group: Development/Languages/Python
56 IDLE is a Tkinter based integrated development environment for Python.
57 It features a multi-window text editor with multiple undo, Python
58 colorizing, and many other things, as well as a Python shell window and
64 Guido van Rossum <guido@python.org>
67 License: Python License ..
68 Requires: python-base = %{version}
69 Summary: An Integrated Development Environment for Python
70 Group: Development/Languages/Python
73 for supporting xml stuff. (TODO: This description should be changed correctly.)
78 Guido van Rossum <guido@python.org>
81 License: Python License ..
84 Requires: python-base = %{version}
85 Summary: Python Demonstration Scripts
86 Group: Development/Languages/Python
89 Various demonstrations of what you can do with Python and a number of
90 programs that are useful for building or extending Python.
96 Guido van Rossum <guido@python.org>
100 License: Python License ..
101 Requires: python-base = %{version}
104 Summary: Python Interface to the (N)Curses Library
105 Group: Development/Libraries/Python
108 An easy to use interface to the (n)curses CUI library. CUI stands for
109 Console User Interface.
115 Guido van Rossum <guido@python.org>
118 License: MIT License (or similar)
119 Requires: python-base = %{version}
122 Summary: Python Interface to the GDBM Library
123 Group: Development/Libraries/Python
126 An easy to use interface for GDBM databases. GDBM is the GNU
127 implementation of the standard Unix DBM databases.
133 Guido van Rossum <guido@python.org>
136 %setup -q -n %{tarname}
149 # drop Autoconf version requirement
150 sed -i 's/^version_required/dnl version_required/' configure.in
153 export OPT="$RPM_OPT_FLAGS"
155 autoreconf -f -i . # Modules/_ctypes/libffi
156 # prevent make from trying to rebuild asdl stuff, which requires existing
157 # python installation
158 touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h
161 --prefix=%{_prefix} \
162 --libdir=%{_libdir} \
163 --mandir=%{_mandir} \
164 --docdir=%{_docdir}/python \
168 --enable-unicode=ucs4
170 make %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT
173 # on hppa, the threading of glibc is quite broken. The tests just stop
174 # at some point, and the machine does not build anything more until a
175 # timeout several hours later.
177 # Limit virtual memory to avoid spurious failures
178 if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then
179 ulimit -v 10000000 || :
181 LIST="test_urllib test_ssl test_hashlib test_hmac test_unicodedata test_tarfile test_sqlite test_tcl test_anydbm test_dumbdbm test_gdbm test_whichdb test_tk test_ttk_textonly test_bsddb test_readline "
182 #drop test_urllib2_localnet, need to fix later.
183 make test TESTOPTS="$LIST"
187 # replace rest of /usr/local/bin/python or /usr/bin/python2.x with /usr/bin/python
188 find . -wholename "./Parser" -prune -o -name '*.py' -type f -print0 | xargs -0 grep -lE '^#! *(/usr/.*bin/(env +)?)?python' | xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+\.[0-9]+)?@#!/usr/bin/python@'
189 # the grep inbetween makes it much faster
190 ########################################
192 ########################################
194 OPT="$RPM_OPT_FLAGS -fPIC" \
195 DESTDIR=$RPM_BUILD_ROOT \
197 ########################################
199 ########################################
200 # remove hard links and replace them with symlinks
201 for dir in bin include %{_lib} ; do
202 rm -f $RPM_BUILD_ROOT/%{_prefix}/$dir/python
203 ln -s python%{python_version} $RPM_BUILD_ROOT/%{_prefix}/$dir/python
205 # kill imageop.so, it's insecure
206 rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{python_version}/lib-dynload/imageop.so
208 rm -rf %{buildroot}/usr/lib/python2.7/lib-tk
209 rm $RPM_BUILD_ROOT%{_bindir}/python{,%{python_version}}
210 rm $RPM_BUILD_ROOT%{_bindir}/smtpd.py
211 rm $RPM_BUILD_ROOT%{_bindir}/pydoc
212 rm $RPM_BUILD_ROOT%{_bindir}/2to3
213 rm $RPM_BUILD_ROOT%{_mandir}/man1/python*
214 rm $RPM_BUILD_ROOT%{_libdir}/libpython*.so.*
215 rm $RPM_BUILD_ROOT%{_libdir}/python
216 find $RPM_BUILD_ROOT%{_libdir}/python%{python_version} -maxdepth 1 ! \( -name "ssl.py" \) -exec rm {} ";"
217 rm $RPM_BUILD_ROOT%{_bindir}/python%{python_version}-config
218 rm $RPM_BUILD_ROOT%{_bindir}/python-config
219 rm $RPM_BUILD_ROOT%{_libdir}/pkgconfig/*
220 rm -r $RPM_BUILD_ROOT%{_includedir}/python
221 rm -r $RPM_BUILD_ROOT%{_includedir}/python%{python_version}
222 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/compiler
223 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/config
224 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/ctypes
225 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/distutils
226 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/email
227 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/encodings
228 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/hotshot
229 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/importlib
230 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/json
231 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib2to3
232 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/logging
233 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/multiprocessing
234 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/plat-*
235 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/pydoc_data
236 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/test
237 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/unittest
238 rm -r $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/wsgiref
239 rm $RPM_BUILD_ROOT%{_libdir}/libpython%{python_version}.so
240 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/site-packages/README
241 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_bisect.so
242 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_csv.so
243 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_collections.so
244 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_ctypes.so
245 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_ctypes_test.so
246 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_elementtree.so
247 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_functools.so
248 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_heapq.so
249 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_hotshot.so
250 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_io.so
251 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_json.so
252 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_locale.so
253 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_lsprof.so
254 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_multiprocessing.so
255 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_random.so
256 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_socket.so
257 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_struct.so
258 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_testcapi.so
259 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/array.so
260 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/binascii.so
261 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/bz2.so
262 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/cPickle.so
263 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/cStringIO.so
264 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/cmath.so
265 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/crypt.so
266 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/datetime.so
267 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/fcntl.so
268 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/future_builtins.so
269 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/grp.so
270 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/itertools.so
271 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/linuxaudiodev.so
272 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/math.so
273 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/mmap.so
274 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/nis.so
275 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/operator.so
276 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/ossaudiodev.so
277 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/parser.so
278 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/resource.so
279 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/select.so
280 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/spwd.so
281 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/strop.so
282 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/syslog.so
283 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/termios.so
284 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/time.so
285 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/unicodedata.so
286 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/zlib.so
287 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_codecs*.so
288 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/_multibytecodec.so
289 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/audioop.so
290 rm -f $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/dl.so
291 rm $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/lib-dynload/Python-%{tarversion}-py%{python_version}.egg-info
292 # replace duplicate .pyo/.pyc with hardlinks
293 %fdupes $RPM_BUILD_ROOT/%{_libdir}/python%{python_version}
295 export PDOCS=${RPM_BUILD_ROOT}%{_docdir}/%{name}
296 install -d -m 755 $PDOCS
298 ########################################
300 ########################################
301 find Tools/ Demo/ -type d \( -regex ".*/.cvsignore" \) -exec rm -f \{\} \;
302 for x in `find Tools/ Demo/ \( -not -name Makefile \) -print | sort` ; do
303 test -d $x && ( install -c -m 755 -d $PDOCS/$x ) \
304 || ( install -c -m 644 $x $PDOCS/$x )
306 ########################################
308 ########################################
309 # move idle config into /etc
310 install -d -m755 ${RPM_BUILD_ROOT}/etc/%{idle_name}
312 cd ${RPM_BUILD_ROOT}/%{_libdir}/python%{python_version}/idlelib/
313 for file in *.def ; do
314 mv $file ${RPM_BUILD_ROOT}/etc/%{idle_name}/
315 ln -sf /etc/%{idle_name}/$file ${RPM_BUILD_ROOT}/%{_libdir}/python%{python_version}/idlelib/
318 ########################################
320 ########################################
321 install -m 644 %{S:2} $RPM_BUILD_ROOT/etc
322 install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d
323 install -m 644 %{S:3} %{S:4} $RPM_BUILD_ROOT/etc/profile.d
326 rm -rf $RPM_BUILD_ROOT
328 %post -p /sbin/ldconfig
330 %postun -p /sbin/ldconfig
333 %defattr(644, root, root, 755)
334 %dir /etc/%{idle_name}
335 %config /etc/%{idle_name}/*
336 %doc Lib/idlelib/NEWS.txt
337 %doc Lib/idlelib/README.txt
338 %doc Lib/idlelib/TODO.txt
339 %doc Lib/idlelib/extend.txt
340 %doc Lib/idlelib/ChangeLog
341 %{_libdir}/python%{python_version}/idlelib
342 %attr(755, root, root) %{_bindir}/%{idle_name}
345 %{_libdir}/python%{python_version}/xml/*
346 %{_libdir}/python%{python_version}/xml/*/*
349 %defattr(644, root, root, 755)
350 %doc %{_docdir}/%{name}/Demo
351 %doc %{_docdir}/%{name}/Tools
355 %defattr(644, root, root, 755)
356 %{_libdir}/python%{python_version}/curses
357 %{_libdir}/python%{python_version}/lib-dynload/_curses.so
358 %{_libdir}/python%{python_version}/lib-dynload/_curses_panel.so
361 %defattr(644, root, root, 755)
362 %{_libdir}/python%{python_version}/lib-dynload/gdbm.so
363 %{_libdir}/python%{python_version}/lib-dynload/dbm.so
366 %defattr(644, root, root, 755)
367 %config /etc/pythonstart
368 %config /etc/profile.d/python.*
369 %dir %{_libdir}/python%{python_version}
370 %{_libdir}/python%{python_version}/ssl.py*
371 %{_libdir}/python%{python_version}/bsddb
372 %{_libdir}/python%{python_version}/sqlite3
373 %dir %{_libdir}/python%{python_version}/lib-dynload
374 %{_libdir}/python%{python_version}/lib-dynload/_bsddb.so
375 %{_libdir}/python%{python_version}/lib-dynload/_hashlib.so
376 %{_libdir}/python%{python_version}/lib-dynload/_sqlite3.so
377 %{_libdir}/python%{python_version}/lib-dynload/_ssl.so
378 %{_libdir}/python%{python_version}/lib-dynload/readline.so
379 %{_libdir}/python%{python_version}/lib-dynload/pyexpat.so