# # spec file for package python-base (Version 2.6.2) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: python-base BuildRequires: zlib-devel %if %suse_version >= 1030 BuildRequires: fdupes %endif Url: http://www.python.org/ License: X11/MIT Group: Development/Languages/Python AutoReqProv: on # bug437293 %ifarch ppc64 Obsoletes: python-64bit %endif # Summary: Python Interpreter base package Version: 2.6.2 Release: 1 %define tarname Python-%{version} Source0: %{tarname}.tar.bz2 Source1: macros.python Source6: README.SUSE Source13: distutils.cfg Source14: _local.pth Patch01: Python-2.3.3-dirs.patch Patch10: python-distutils-rpm-8.patch Patch21: Python-2.6b1-multilib.patch Patch25: python-2.6b1-canonicalize2.patch Patch31: python-2.5.2-fwrapv.patch Patch35: python-2.5.2-configure.patch Patch37: python-2.6rc2-https-proxy.patch Patch38: python-2.6-gettext-plurals.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %define python_version %(echo %{version} | head -c 3) Provides: %{name} = %{python_version} %description Python is an interpreted, object-oriented programming language, and is often compared to Tcl, Perl, Scheme, or Java. You can find an overview of Python in the documentation and tutorials included in the python-doc (HTML) or python-doc-pdf (PDF) packages. This package contains all of stand-alone Python files, minus binary modules that would pull in extra dependencies. Authors: -------- Guido van Rossum %package -n python-devel License: Python Copyright Requires: python-base = %{version} Summary: Include Files and Libraries Mandatory for Building Python Modules Group: Development/Languages/Python AutoReqProv: on %description -n python-devel The Python programming language's interpreter can be extended with dynamically loaded extensions and can be embedded in other programs. This package contains header files, a static library, and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. Authors: -------- Guido van Rossum %package -n python-xml License: Python Copyright Requires: python-base = %{version} Summary: A Python XML Interface Group: Development/Libraries/Python AutoReqProv: on %description -n python-xml The expat module is a Python interface to the expat XML parser. Since Python2.x, it is part of the core Python distribution. %package -n libpython2_6-1_0 License: X11/MIT Summary: Python Interpreter shared library Group: Development/Languages/Python AutoReqProv: on #%description -n libpython%{lib_version} %description -n libpython2_6-1_0 Python is an interpreted, object-oriented programming language, and is often compared to Tcl, Perl, Scheme, or Java. You can find an overview of Python in the documentation and tutorials included in the python-doc (HTML) or python-doc-pdf (PDF) packages. This package contains libpython2.6 shared library for embedding in other applications. Authors: -------- Guido van Rossum %prep %setup -q -n %{tarname} # patching %patch01 %patch10 -p1 %patch21 -p1 %patch25 %patch31 %patch35 %patch37 %patch38 # some cleanup find . -name .cvsignore -type f -print0 | xargs -0 rm -f find . -name CVS -type d -print0 | xargs -0 rm -rf %build ######################################## # use rpm_opt_flags ######################################## export OPT="$RPM_OPT_FLAGS" ######################################## # regenerate ######################################## autoreconf -f -i . # Modules/_ctypes/libffi # prevent make from trying to rebuild asdl stuff, which requires existing # python installation touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h ######################################## # configure ######################################## ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --docdir=%{_docdir}/python \ --with-fpectl \ --enable-shared \ --enable-unicode=ucs4 ######################################## # compile ######################################## LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH \ make %{?jobs:-j%jobs} \ DESTDIR=$RPM_BUILD_ROOT \ profile-opt %check # on hppa, the threading of glibc is quite broken. The tests just stop # at some point, and the machine does not build anything more until a # timeout several hours later. %ifnarch hppa %arm # test_file fails in autobuild env - "stdin.seek(-1)" wrongly succeeds. probably an issue with autobuild's stdin # test_urllib2 relies on being able to resolve local address, which is notoriously impossible in autobuild EXCLUDE="-x test_urllib2 -x test_file" # test_nis and test_threading are AWFULLY slow. EXCLUDE="$EXCLUDE -x test_nis -x test_threading" %ifarch ia64 # test_smtplib's testSend is known to be broken and on ia64 it actually fails most of the time, preventing the build. EXCLUDE="$EXCLUDE -x test_smtplib" %endif # Limit virtual memory to avoid spurious failures if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then ulimit -v 10000000 || : fi make test TESTOPTS="-l $EXCLUDE" # use network, be verbose: #make test TESTOPTS="-l -u network -v" %endif %install # replace rest of /usr/local/bin/python or /usr/bin/python2.5 with /usr/bin/python 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@' # the grep inbetween makes it much faster ######################################## # install it ######################################## make \ OPT="$RPM_OPT_FLAGS -fPIC" \ DESTDIR=$RPM_BUILD_ROOT \ install # install site-specific tweaks ln -s python%{python_version} ${RPM_BUILD_ROOT}%{_bindir}/python2 install -m 644 %{S:13} ${RPM_BUILD_ROOT}%{_libdir}/python%{python_version}/distutils install -m 644 %{S:14} ${RPM_BUILD_ROOT}%{_libdir}/python%{python_version}/site-packages install -d -m 755 ${RPM_BUILD_ROOT}/etc/rpm install -m 644 %{S:1} ${RPM_BUILD_ROOT}/etc/rpm ######################################## # some cleanups ######################################## # remove hard links and replace them with symlinks for dir in bin include %{_lib} ; do rm -f $RPM_BUILD_ROOT/%{_prefix}/$dir/python ln -s python%{python_version} $RPM_BUILD_ROOT/%{_prefix}/$dir/python done CLEANUP_DIR="$RPM_BUILD_ROOT%{_libdir}/python%{python_version}" # kill imageop.so, it's insecure rm -f $CLEANUP_DIR/lib-dynload/imageop.so # remove various things that don't need to be in python-base rm $RPM_BUILD_ROOT%{_bindir}/idle rm -r $CLEANUP_DIR/{curses,bsddb,idlelib,lib-tk,sqlite3} rm $CLEANUP_DIR/ssl.py* # does not work without _ssl.so anyway %if %suse_version >= 1030 # replace duplicate .pyo/.pyc with hardlinks %fdupes $RPM_BUILD_ROOT/%{_libdir}/python%{python_version} %endif ######################################## # documentation ######################################## export PDOCS=${RPM_BUILD_ROOT}%{_docdir}/%{name} install -d -m 755 $PDOCS install -c -m 644 %{SOURCE6} $PDOCS/ install -c -m 644 LICENSE $PDOCS/ install -c -m 644 README $PDOCS/ ######################################## # devel ######################################## # install Makefile.pre.in and Makefile.pre cp Makefile Makefile.pre.in Makefile.pre $RPM_BUILD_ROOT%{_libdir}/python%{python_version}/config/ %clean rm -rf $RPM_BUILD_ROOT #%post -n libpython%{lib_version} %post -n libpython2_6-1_0 %{run_ldconfig} #%postun -n libpython%{lib_version} %postun -n libpython2_6-1_0 %{run_ldconfig} %files -n python-devel %defattr(-, root, root) %{_libdir}/python%{python_version}/config/* %exclude %{_libdir}/python%{python_version}/config/Setup %exclude %{_libdir}/python%{python_version}/config/Makefile %defattr(644, root, root, 755) %{_libdir}/libpython*.so %{_includedir}/python* %exclude %{_includedir}/python%{python_version}/pyconfig.h %{_libdir}/python%{python_version}/test %defattr(755, root, root) %{_bindir}/python-config %{_bindir}/python%{python_version}-config %files -n python-xml %defattr(644, root, root, 755) %{_libdir}/python%{python_version}/xml %{_libdir}/python%{python_version}/lib-dynload/pyexpat.so #%files -n libpython%{lib_version} %files -n libpython2_6-1_0 %defattr(644, root, root) %{_libdir}/libpython*.so.* %files %defattr(644, root, root, 755) %config /etc/rpm/macros.python %dir %{_docdir}/%{name} %doc %{_docdir}/%{name}/README %doc %{_docdir}/%{name}/LICENSE %doc %{_docdir}/%{name}/README.SUSE %doc %{_mandir}/man1/python.1* %dir %{_includedir}/python%{python_version} %{_includedir}/python%{python_version}/pyconfig.h %{_libdir}/python %dir %{_libdir}/python%{python_version} %dir %{_libdir}/python%{python_version}/config %{_libdir}/python%{python_version}/config/Setup %{_libdir}/python%{python_version}/config/Makefile %{_libdir}/python%{python_version}/*.* %{_libdir}/python%{python_version}/compiler %{_libdir}/python%{python_version}/ctypes %{_libdir}/python%{python_version}/distutils %{_libdir}/python%{python_version}/email %{_libdir}/python%{python_version}/encodings %{_libdir}/python%{python_version}/hotshot %{_libdir}/python%{python_version}/json %{_libdir}/python%{python_version}/lib2to3 %{_libdir}/python%{python_version}/logging %{_libdir}/python%{python_version}/multiprocessing %{_libdir}/python%{python_version}/plat-* %{_libdir}/python%{python_version}/wsgiref %dir %{_libdir}/python%{python_version}/site-packages %{_libdir}/python%{python_version}/site-packages/README %{_libdir}/python%{python_version}/site-packages/_local.pth %dir %{_libdir}/python%{python_version}/lib-dynload %{_libdir}/python%{python_version}/lib-dynload/_bisect.so %{_libdir}/python%{python_version}/lib-dynload/_bytesio.so %{_libdir}/python%{python_version}/lib-dynload/_csv.so %{_libdir}/python%{python_version}/lib-dynload/_collections.so %{_libdir}/python%{python_version}/lib-dynload/_ctypes.so %{_libdir}/python%{python_version}/lib-dynload/_ctypes_test.so %{_libdir}/python%{python_version}/lib-dynload/_elementtree.so %{_libdir}/python%{python_version}/lib-dynload/_fileio.so %{_libdir}/python%{python_version}/lib-dynload/_functools.so %{_libdir}/python%{python_version}/lib-dynload/_heapq.so %{_libdir}/python%{python_version}/lib-dynload/_hotshot.so %{_libdir}/python%{python_version}/lib-dynload/_json.so %{_libdir}/python%{python_version}/lib-dynload/_locale.so %{_libdir}/python%{python_version}/lib-dynload/_lsprof.so %{_libdir}/python%{python_version}/lib-dynload/_md5.so %{_libdir}/python%{python_version}/lib-dynload/_multiprocessing.so %{_libdir}/python%{python_version}/lib-dynload/_random.so %{_libdir}/python%{python_version}/lib-dynload/_sha.so %{_libdir}/python%{python_version}/lib-dynload/_sha256.so %{_libdir}/python%{python_version}/lib-dynload/_sha512.so %{_libdir}/python%{python_version}/lib-dynload/_socket.so %{_libdir}/python%{python_version}/lib-dynload/_struct.so %{_libdir}/python%{python_version}/lib-dynload/_testcapi.so %{_libdir}/python%{python_version}/lib-dynload/_weakref.so %{_libdir}/python%{python_version}/lib-dynload/array.so %{_libdir}/python%{python_version}/lib-dynload/binascii.so %{_libdir}/python%{python_version}/lib-dynload/bz2.so %{_libdir}/python%{python_version}/lib-dynload/cPickle.so %{_libdir}/python%{python_version}/lib-dynload/cStringIO.so %{_libdir}/python%{python_version}/lib-dynload/cmath.so %{_libdir}/python%{python_version}/lib-dynload/crypt.so %{_libdir}/python%{python_version}/lib-dynload/datetime.so %{_libdir}/python%{python_version}/lib-dynload/fcntl.so %{_libdir}/python%{python_version}/lib-dynload/future_builtins.so %{_libdir}/python%{python_version}/lib-dynload/grp.so %{_libdir}/python%{python_version}/lib-dynload/itertools.so %{_libdir}/python%{python_version}/lib-dynload/linuxaudiodev.so %{_libdir}/python%{python_version}/lib-dynload/math.so %{_libdir}/python%{python_version}/lib-dynload/mmap.so %{_libdir}/python%{python_version}/lib-dynload/nis.so %{_libdir}/python%{python_version}/lib-dynload/operator.so %{_libdir}/python%{python_version}/lib-dynload/ossaudiodev.so %{_libdir}/python%{python_version}/lib-dynload/parser.so %{_libdir}/python%{python_version}/lib-dynload/resource.so %{_libdir}/python%{python_version}/lib-dynload/select.so %{_libdir}/python%{python_version}/lib-dynload/spwd.so %{_libdir}/python%{python_version}/lib-dynload/strop.so %{_libdir}/python%{python_version}/lib-dynload/syslog.so %{_libdir}/python%{python_version}/lib-dynload/termios.so %{_libdir}/python%{python_version}/lib-dynload/time.so %{_libdir}/python%{python_version}/lib-dynload/unicodedata.so %{_libdir}/python%{python_version}/lib-dynload/zlib.so %{_libdir}/python%{python_version}/lib-dynload/_codecs*.so %{_libdir}/python%{python_version}/lib-dynload/_multibytecodec.so %{_libdir}/python%{python_version}/lib-dynload/audioop.so %{_libdir}/python%{python_version}/lib-dynload/Python-%{version}-py%{python_version}.egg-info # these modules don't support 64-bit arches (disabled by setup.py) %ifnarch alpha ia64 x86_64 s390x ppc64 # requires sizeof(int) == sizeof(long) == sizeof(char*) %{_libdir}/python%{python_version}/lib-dynload/dl.so %endif %attr(755, root, root) %{_bindir}/pydoc %attr(755, root, root) %{_bindir}/python %attr(755, root, root) %{_bindir}/2to3 %attr(755, root, root) %{_bindir}/python%{python_version} %attr(755, root, root) %{_bindir}/smtpd.py %{_bindir}/python2 %changelog * Mon Apr 27 2009 matejcik@suse.cz - update to 2.6.2 * bugfix-only release for 2.6 series * Fri Feb 06 2009 matejcik@suse.cz - excluded pyconfig.h and Makefile and Setup from -devel subpackage to prevent file conflicts of python-base and python-devel * Thu Jan 15 2009 matejcik@suse.cz - fixed gettext.py problem with empty plurals line (bnc#462375) * Wed Jan 07 2009 olh@suse.de - obsolete old -XXbit packages (bnc#437293) * Mon Dec 15 2008 matejcik@suse.cz - removed bsddb directory from python-base, reenabled in python * Mon Oct 20 2008 matejcik@suse.cz - added libpython and python-base to baselibs.conf (bnc#432677) - disabled test_smtplib for ia64 so that the package actually gets built (bnc#436966) * Thu Oct 09 2008 matejcik@suse.cz - update to 2.6 final (version name is 2.6.0 to make upgrade from 2.6rc2 possible) - replaced site.py hack with a .pth file to do the same thing (cleaner solution that doesn't mess up documented behavior and also fixes virtualenv, bnc#430761) - enabled profile optimized build - fixed %%py_requires macro (bnc#346490) - provide %%name = 2.6 * Fri Sep 19 2008 matejcik@suse.cz - moved tests to %%check section - update to 2.6rc2 - included patch for https proxy support that resolves bnc#214983 (in a proper way) and bnc#298378 * Wed Sep 17 2008 matejcik@suse.cz - included /etc/rpm/macros.python to fix the split-caused breakage * Tue Sep 16 2008 matejcik@suse.cz - applied bug-no-proxy patch from python#3879, which should improve backwards compatibility (important i.e. for bzr) - moved python-xml to a subpackage of this (brings no additional dependencies, so it can as well stay) - moved Makefile and pyconfig.h to python-base, removing the need to have python-devel for installation - improved compatibility with older distros for 11.0 - moved ssl.py and sqlite3 module to python package - they won't work without their respective binary modules anyway * Mon Sep 15 2008 matejcik@suse.cz - updated to 2.6rc1 - bugfix-only pre-stable release - renamed python-base-devel to python-devel as it should be - removed macros from libpython package name * Fri Sep 12 2008 matejcik@suse.cz - moved python-devel to a subpackage of this - created libpython subpackage - moved essential files from -devel to -base, so that distutils should now be able to install without -devel package * Tue Sep 09 2008 matejcik@suse.cz - initial release of python-base