2008-09-24 00:12:56 +02:00
#
2011-02-17 18:32:10 +01:00
# spec file for package python-base
2008-09-24 00:12:56 +02:00
#
2011-02-17 18:32:10 +01:00
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
2008-09-24 00:12:56 +02:00
#
# 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
2012-04-17 16:57:13 +02:00
Version : 2.7.3
2011-12-08 14:04:48 +01:00
Release : 0
License : Python-2.0
Summary : Python Interpreter base package
2008-09-24 00:12:56 +02:00
Url : http://www.python.org/
Group : Development/Languages/Python
2012-04-17 16:57:13 +02:00
%define tarversion %{version}
2011-12-08 14:04:48 +01:00
%define tarname Python-%{tarversion}
2008-09-24 00:12:56 +02:00
Source0 : %{tarname} .tar.bz2
Source1 : macros.python
2009-12-21 23:06:46 +01:00
Source2 : baselibs.conf
2010-09-03 17:55:49 +02:00
Source3 : README.SUSE
Source4 : distutils.cfg
Source5 : _local.pth
2011-08-24 15:28:09 +02:00
# COMMON-PATCH-BEGIN
2010-09-03 17:55:49 +02:00
Patch1 : python-2.7-dirs.patch
Patch2 : python-distutils-rpm-8.patch
2012-03-28 20:27:24 +02:00
Patch3 : python-2.7.3rc2-multilib.patch
2011-08-24 15:28:09 +02:00
Patch4 : python-2.5.1-sqlite.patch
2012-03-28 20:27:24 +02:00
Patch5 : python-2.7.3rc2-canonicalize2.patch
2011-08-24 15:28:09 +02:00
Patch6 : python-2.7rc2-configure.patch
Patch7 : python-2.6-gettext-plurals.patch
Patch8 : python-2.6b3-curses-panel.patch
Patch9 : python-2.7.1-distutils_test_path.patch
2011-12-08 14:04:48 +01:00
Patch10 : sparc_longdouble.patch
2010-11-18 18:31:47 +01:00
Patch12 : http://psf.upfronthosting.co.za/roundup/tracker/file19029/python-test_structmembers.patch
2011-08-24 15:28:09 +02:00
Patch13 : python-2.7.2-fix_date_time_compiler.patch
2012-02-20 15:28:59 +01:00
Patch15 : python-2.7.2-disable-tests-in-test_io.patch
2012-03-28 20:27:24 +02:00
Patch16 : pypirc-secure.diff
2012-04-17 16:57:13 +02:00
Patch17 : remove-static-libpython.diff
2012-05-18 14:22:20 +02:00
# PATCH-FIX-OPENSUSE python-2.7.3-ssl_ca_path.patch [bnc#761501] -- Support directory-based certificate stores with the ca_certs parameter of SSL functions
Patch18 : python-2.7.3-ssl_ca_path.patch
2012-07-20 13:17:00 +02:00
Patch19 : python-2.7.3-fix-dbm-64bit-bigendian.patch
2011-08-24 15:28:09 +02:00
# COMMON-PATCH-END
2011-12-08 14:31:32 +01:00
%define python_version %(echo %{tarversion} | head -c 3)
2011-12-08 14:04:48 +01:00
BuildRequires : automake
BuildRequires : fdupes
BuildRequires : pkg-config
BuildRequires : zlib-devel
# explicitly, see bnc#697251:
Requires : libpython2_7-1_0 = %{version}
2008-10-13 16:53:57 +02:00
Provides : %{name} = %{python_version}
2011-12-08 14:04:48 +01:00
# bug437293
%ifarch ppc64
Obsoletes : python-64bit
%endif
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2011-05-31 20:00:07 +02:00
2008-09-24 00:12:56 +02:00
%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.
%package -n python-devel
Summary : Include Files and Libraries Mandatory for Building Python Modules
Group : Development/Languages/Python
2011-12-08 14:04:48 +01:00
Requires : glibc-devel
2012-07-31 14:36:53 +02:00
Requires : python-base = %{version} -%{release}
2008-09-24 00:12:56 +02:00
%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.
%package -n python-xml
Summary : A Python XML Interface
Group : Development/Libraries/Python
2012-07-31 14:36:53 +02:00
Requires : python-base = %{version} -%{release}
2011-01-18 10:08:19 +01:00
# pyxml used to live out of tree
Provides : pyxml = 0.8.5
Obsoletes : pyxml < 0.8.5
2008-09-24 00:12:56 +02:00
%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.
2010-09-03 17:55:49 +02:00
%package -n libpython2_7-1_0
2008-09-24 00:12:56 +02:00
Summary : Python Interpreter shared library
Group : Development/Languages/Python
2010-09-03 17:55:49 +02:00
%description -n libpython2_7-1_0
2008-09-24 00:12:56 +02:00
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.
%prep
%setup -q -n %{tarname}
# patching
2011-08-24 15:28:09 +02:00
# COMMON-PREP-BEGIN
2010-09-03 17:55:49 +02:00
%patch1 -p1
%patch2 -p1
2011-08-24 15:28:09 +02:00
%patch3
2010-09-03 17:55:49 +02:00
%patch4
%patch5
%patch6
2011-08-24 15:28:09 +02:00
%patch7
%patch8
%patch9 -p1
%patch10 -p1
2011-05-02 18:07:07 +02:00
%patch12
2011-08-24 15:28:09 +02:00
%patch13
2012-02-20 15:28:59 +01:00
#skip test_io test for ppc,ppc64 as it broken.
%ifarch ppc ppc64
%patch15 -p1
%endif
2012-03-28 20:27:24 +02:00
%patch16 -p1
2012-04-17 16:57:13 +02:00
%patch17
2012-05-18 14:22:20 +02:00
%patch18
2012-07-20 13:17:00 +02:00
%patch19 -p1
2011-08-24 15:28:09 +02:00
# COMMON-PREP-END
2010-03-12 17:36:40 +01:00
2011-05-24 17:33:04 +02:00
# drop Autoconf version requirement
sed -i 's/^version_required/dnl version_required/' configure.in
2008-09-24 00:12:56 +02:00
%build
2011-12-08 14:04:48 +01:00
export OPT=" %{optflags} "
2011-05-24 17:33:04 +02:00
2008-09-24 00:12:56 +02:00
autoreconf -f -i . # Modules/_ctypes/libffi
2011-05-24 17:33:04 +02:00
# provide a stable timestamp
2011-12-08 14:04:48 +01:00
touch -r %{SOURCE0} Makefile.pre.in
2011-05-24 17:33:04 +02:00
2008-09-24 00:12:56 +02:00
# prevent make from trying to rebuild asdl stuff, which requires existing
# python installation
touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h
2011-05-24 17:33:04 +02:00
2011-12-08 14:04:48 +01:00
%configure \
2008-09-24 00:12:56 +02:00
--docdir=%{_docdir} /python \
--with-fpectl \
2010-01-29 18:51:47 +01:00
--enable-ipv6 \
2008-09-24 00:12:56 +02:00
--enable-shared \
--enable-unicode=ucs4
2011-05-24 17:33:04 +02:00
2008-10-13 16:53:57 +02:00
LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH \
2011-12-08 14:04:48 +01:00
make %{?_smp_mflags} profile-opt
2008-09-24 00:12:56 +02:00
%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
2011-12-08 14:04:48 +01:00
# timeout several hours later.
2008-09-24 00:12:56 +02:00
%ifnarch hppa %arm
2010-09-03 17:55:49 +02:00
# test_file(2k) fails in autobuild env - "stdin.seek(-1)" wrongly succeeds. probably an issue with autobuild's stdin
2008-09-24 00:12:56 +02:00
# test_urllib2 relies on being able to resolve local address, which is notoriously impossible in autobuild
2010-09-03 17:55:49 +02:00
EXCLUDE=" - x t e s t _ u r l l i b 2 - x t e s t _ f i l e - x t e s t _ f i l e 2 k "
2008-10-22 18:44:23 +02:00
# test_nis and test_threading are AWFULLY slow.
2008-09-24 00:12:56 +02:00
EXCLUDE=" $ E X C L U D E - x t e s t _ n i s - x t e s t _ t h r e a d i n g "
2011-05-24 17:33:04 +02:00
# test_gdb fails if gdb with (different) python support is part of the buildsystem
EXCLUDE=" $ E X C L U D E - x t e s t _ g d b "
2008-10-22 18:44:23 +02:00
%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=" $ E X C L U D E - x t e s t _ s m t p l i b "
%endif
2012-03-29 19:02:42 +02:00
# test_unicode fails in Factory
EXCLUDE=" $ E X C L U D E - x t e s t _ u n i c o d e "
2008-09-24 00:12:56 +02:00
# Limit virtual memory to avoid spurious failures
if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then
ulimit -v 10000000 || :
fi
2012-03-29 19:39:12 +02:00
make test TESTOPTS=" - l $ E X C L U D E " TESTPYTHONOPTS=" - R "
2008-09-24 00:12:56 +02:00
# 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 " . / P a r s e r " -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
########################################
2011-12-08 14:04:48 +01:00
%make_install OPT=" %{optflags} - f P I C "
2008-09-24 00:12:56 +02:00
# install site-specific tweaks
2012-03-29 16:11:03 +02:00
#ln -s python%{python_version} %{buildroot}%{_bindir}/python2
2011-12-08 14:04:48 +01:00
install -m 644 %{SOURCE4} %{buildroot} %{_libdir} /python%{python_version} /distutils
install -m 644 %{SOURCE5} %{buildroot} %{_libdir} /python%{python_version} /site-packages
install -d -m 755 %{buildroot} %{_sysconfdir} /rpm
install -m 644 %{SOURCE1} %{buildroot} %{_sysconfdir} /rpm
2009-08-07 22:04:34 +02:00
# make sure /usr/lib/python/site-packages exists even on lib64 machines
2011-12-08 14:04:48 +01:00
mkdir -p %{buildroot} %{_prefix} /lib/python%{python_version} /site-packages
2008-09-24 00:12:56 +02:00
########################################
# some cleanups
########################################
# remove hard links and replace them with symlinks
for dir in bin include %{_lib} ; do
2011-12-08 14:04:48 +01:00
rm -f %{buildroot} /%{_prefix} /$dir/python
ln -s python%{python_version} %{buildroot} /%{_prefix} /$dir/python
2008-09-24 00:12:56 +02:00
done
2011-12-08 14:04:48 +01:00
CLEANUP_DIR=" %{buildroot} %{_libdir} / p y t h o n %{python_version} "
2010-02-05 13:55:54 +01:00
# don't distribute precompiled windows installers (duh)
rm -f $CLEANUP_DIR/distutils/command/*.exe
2010-05-25 10:30:25 +02:00
# kill imageop.so and audioop.so, they are rarely used and insecure
2008-09-24 00:12:56 +02:00
rm -f $CLEANUP_DIR/lib-dynload/imageop.so
2010-05-25 10:30:25 +02:00
rm -f $CLEANUP_DIR/lib-dynload/audioop.so
2012-04-17 16:57:13 +02:00
# link shared library instead of static library that tools expect
ln -s ../../libpython%{python_version} .so %{buildroot} %{_libdir} /python%{python_version} /config/libpython%{python_version} .so
2008-09-24 00:12:56 +02:00
# remove various things that don't need to be in python-base
2011-12-08 14:04:48 +01:00
rm %{buildroot} %{_bindir} /idle
2011-08-24 15:28:09 +02:00
rm -rf $CLEANUP_DIR/{curses,bsddb,idlelib,lib-tk,sqlite3}
2008-09-24 00:12:56 +02:00
rm $CLEANUP_DIR/ssl.py*
# does not work without _ssl.so anyway
# replace duplicate .pyo/.pyc with hardlinks
2011-12-08 14:04:48 +01:00
%fdupes %{buildroot} /%{_libdir} /python%{python_version}
2008-09-24 00:12:56 +02:00
########################################
# documentation
########################################
2011-12-08 14:04:48 +01:00
export PDOCS=%{buildroot} %{_docdir} /%{name}
2008-09-24 00:12:56 +02:00
install -d -m 755 $PDOCS
2011-12-08 14:04:48 +01:00
install -c -m 644 %{SOURCE3} $PDOCS/
2008-09-24 00:12:56 +02:00
install -c -m 644 LICENSE $PDOCS/
install -c -m 644 README $PDOCS/
2011-12-08 14:04:48 +01:00
ln -s python%{python_version} .1.gz %{buildroot} %{_mandir} /man1/python.1.gz
2008-09-24 00:12:56 +02:00
########################################
# devel
########################################
# install Makefile.pre.in and Makefile.pre
2011-12-08 14:04:48 +01:00
cp Makefile Makefile.pre.in Makefile.pre %{buildroot} %{_libdir} /python%{python_version} /config/
2008-09-24 00:12:56 +02:00
2011-12-08 14:04:48 +01:00
%post -n libpython2_7-1_0 -p %{run_ldconfig}
%postun -n libpython2_7-1_0 -p %{run_ldconfig}
2008-09-24 00:12:56 +02:00
%files -n python-devel
%defattr (-, root, root)
%{_libdir} /python%{python_version} /config/*
2009-02-08 02:28:20 +01:00
%exclude %{_libdir} /python%{python_version} /config/Setup
%exclude %{_libdir} /python%{python_version} /config/Makefile
2008-09-24 00:12:56 +02:00
%defattr (644, root, root, 755)
%{_libdir} /libpython*.so
2010-09-03 17:55:49 +02:00
%{_libdir} /pkgconfig/python-%{python_version} .pc
%{_libdir} /pkgconfig/python.pc
2012-03-29 16:11:03 +02:00
%{_libdir} /pkgconfig/python2.pc
2008-09-24 00:12:56 +02:00
%{_includedir} /python*
2009-02-08 02:28:20 +01:00
%exclude %{_includedir} /python%{python_version} /pyconfig.h
2008-09-24 00:12:56 +02:00
%{_libdir} /python%{python_version} /test
%defattr (755, root, root)
%{_bindir} /python-config
2012-03-29 16:11:03 +02:00
%{_bindir} /python2-config
2008-09-24 00:12:56 +02:00
%{_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
2010-09-03 17:55:49 +02:00
%files -n libpython2_7-1_0
2008-09-24 00:12:56 +02:00
%defattr (644, root, root)
%{_libdir} /libpython*.so.*
%files
%defattr (644, root, root, 755)
2011-12-08 14:04:48 +01:00
%config %{_sysconfdir} /rpm/macros.python
2008-09-24 00:12:56 +02:00
%dir %{_docdir} /%{name}
%doc %{_docdir} /%{name} /README
%doc %{_docdir} /%{name} /LICENSE
%doc %{_docdir} /%{name} /README.SUSE
%doc %{_mandir} /man1/python.1*
2010-09-03 17:55:49 +02:00
%doc %{_mandir} /man1/python%{python_version} .1*
2008-09-24 00:12:56 +02:00
%dir %{_includedir} /python%{python_version}
%{_includedir} /python%{python_version} /pyconfig.h
%{_libdir} /python
2011-12-08 14:04:48 +01:00
%dir %{_prefix} /lib/python%{python_version}
%dir %{_prefix} /lib/python%{python_version} /site-packages
2008-09-24 00:12:56 +02:00
%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
2010-09-03 17:55:49 +02:00
%{_libdir} /python%{python_version} /importlib
2008-09-24 00:12:56 +02:00
%{_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-*
2010-09-03 17:55:49 +02:00
%{_libdir} /python%{python_version} /pydoc_data
2010-10-04 15:38:36 +02:00
%{_libdir} /python%{python_version} /unittest
2008-09-24 00:12:56 +02:00
%{_libdir} /python%{python_version} /wsgiref
%dir %{_libdir} /python%{python_version} /site-packages
%{_libdir} /python%{python_version} /site-packages/README
2008-10-13 16:53:57 +02:00
%{_libdir} /python%{python_version} /site-packages/_local.pth
2008-09-24 00:12:56 +02:00
%dir %{_libdir} /python%{python_version} /lib-dynload
%{_libdir} /python%{python_version} /lib-dynload/_bisect.so
2011-12-08 14:04:48 +01:00
#%%{_libdir}/python%%{python_version}/lib-dynload/_bytesio.so
2008-09-24 00:12:56 +02:00
%{_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
2011-12-08 14:04:48 +01:00
#%%{_libdir}/python%%{python_version}/lib-dynload/_fileio.so
2008-09-24 00:12:56 +02:00
%{_libdir} /python%{python_version} /lib-dynload/_functools.so
%{_libdir} /python%{python_version} /lib-dynload/_heapq.so
%{_libdir} /python%{python_version} /lib-dynload/_hotshot.so
2010-09-03 17:55:49 +02:00
%{_libdir} /python%{python_version} /lib-dynload/_io.so
2008-09-24 00:12:56 +02:00
%{_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/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
2012-03-29 16:11:03 +02:00
%{_libdir} /python%{python_version} /lib-dynload/Python-%{tarversion} -py%{python_version} .egg-info
2008-09-24 00:12:56 +02:00
# these modules don't support 64-bit arches (disabled by setup.py)
2010-03-04 16:07:48 +01:00
%ifnarch alpha ia64 x86_64 s390x ppc64 sparc64
2008-09-24 00:12:56 +02:00
# 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} /python%{python_version}
%attr (755, root, root) %{_bindir} /smtpd.py
%{_bindir} /python2
2012-01-04 17:23:21 +01:00
%exclude %{_bindir} /2to3
2008-09-24 00:12:56 +02:00
%changelog