-# TODO: --with-system-libmpdec when new version released [BR: mpdecimal-devel > 2.3]
+# TODO:
+# - fix lib64 and noarch/datadir patches as the 2nd one overrides some
+# changes made by the first one; propose patches to python team as they
+# seem to be duplicated by fedora as well
#
# Conditional build:
%bcond_with info # info pages (requires emacs)
+%bcond_without system_mpdecimal # system libmpdec library
%bcond_without tkinter # disables tkinter module building
%bcond_with tests # disables Python testing
%bcond_with verbose_tests # runs tests in verbose mode
# test_gdb: fails, as the gdb uses old python version
%define broken_tests test_httpservers test_distutils test_cmd_line test_pydoc test_telnetlib test_zlib test_gdb test_site
-%define py_ver 3.3
+%define py_ver 3.4
%define py_abi %{py_ver}m
%define py_prefix %{_prefix}
%define py_libdir %{py_prefix}/%{_lib}/python%{py_ver}
Summary(tr.UTF-8): X arayüzlü, yüksek düzeyli, kabuk yorumlayıcı dili
Summary(uk.UTF-8): Мова програмування дуже високого рівня з X-інтерфейсом
Name: python3
-Version: %{py_ver}.1
-Release: 0.1
+Version: %{py_ver}.2
+Release: 2
Epoch: 1
License: PSF
Group: Applications
Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
-# Source0-md5: 993232d9f4d9b4863cc1ec69a792e9cd
+# Source0-md5: 36fc7327c02c6f12fa24fc9ba78039e3
Patch0: %{name}-pythonpath.patch
Patch1: %{name}-ac_fixes.patch
Patch2: %{name}-lib64.patch
Patch3: %{name}-noarch_to_datadir.patch
Patch4: %{name}-no_cmdline_tests.patch
Patch5: %{name}-makefile-location.patch
-Patch6: libc-cloexec.patch
+
+Patch7: python-distro.patch
+Patch8: %{name}-db.patch
URL: http://www.python.org/
BuildRequires: autoconf >= 2.65
BuildRequires: bluez-libs-devel
BuildRequires: gmp-devel >= 4.0
BuildRequires: libffi-devel
BuildRequires: libstdc++-devel
+%{?with_system_mpdecimal:BuildRequires: mpdecimal-devel >= 2.4.1}
BuildRequires: ncurses-ext-devel >= 5.2
BuildRequires: openssl-devel >= 0.9.7
BuildRequires: readline-devel >= 5.0
%define specflags_ppc64 -D__ppc64__=1
%if %{with verbose_tests}
-%define test_flags -v -l -x
+%define test_flags -v -x
%else
-%define test_flags -w -l -x
+%define test_flags -w -x
%endif
%ifarch alpha ia64 ppc64 sparc64 ppc64 %{x8664}
Summary(pl.UTF-8): Moduły języka Python
Group: Libraries/Python
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
+%{?with_system_mpdecimal:Requires: mpdecimal >= 2.4.1}
Obsoletes: python3-modules-sqlite
%description modules
Przykłady te są dla Pythona 2.3.4, nie %{version}.
+%package test
+Summary: Test modules for Python
+Summary(pl.UTF-8): Moduły testowe dla Pythona
+Group: Development/Languages/Python
+
+%description test
+Test modules for Python.
+
+%description test -l pl.UTF-8
+Moduły testowe dla Pythona.
+
%prep
%setup -q -n Python-%{version}
%patch0 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch6 -p1
+
+%patch7 -p1
+%patch8 -p1
%{__rm} -r Modules/zlib
%{__rm} -r Modules/expat
%{__rm} -r Modules/_ctypes/$SUBDIR
done
+%if "%{pld_release}" == "ac"
files="md5module.c sha1module.c"
-%if !0%(pkg-config openssl --atleast-version=0.9.8; echo $?)
files="$files sha256module.c sha512module.c"
-%endif
for f in $files; do
%{__rm} Modules/$f
done
+%endif
+
+find . -name '*.py' | xargs -r grep -El '^#! */usr/bin/env python3?' | xargs %{__sed} -i -e '1s,^#! */usr/bin/env python3\?,#!/usr/bin/python3,'
%build
if ! grep -q "tmpfs" /proc/self/mounts; then
fi
%{__autoconf}
-CPPFLAGS="-I/usr/include/ncursesw %{rpmcppflags} -Wall %{!?debug:-DNDEBUG=1}"; export CPPFLAGS
%configure \
+ OPT="%{rpmcflags} -fno-caller-saves" \
+ CPPFLAGS="%{rpmcppflags}" \
+ LDFLAGS="%{rpmldflags}" \
ac_cv_posix_semaphores_enabled=yes \
ac_cv_broken_sem_getvalue=no \
- %{?with_debug:--with-pydebug} \
- --with-cxx-main="%{__cxx}" \
- --enable-shared \
--enable-ipv6 \
+ --enable-shared \
+ --with-computed-gotos \
+ --with-cxx-main="%{__cxx}" \
--with-dbmliborder=gdbm:bdb \
- --with-signal-module \
-%ifarch %{ix86} %{x8664} ppc ppc64
- --with-tsc \
-%endif
- --with-threads \
--with-doc-strings \
--with-fpectl \
+ %{?with_debug:--with-pydebug} \
+ --with-signal-module \
--with-system-expat \
--with-system-ffi \
- --with-computed-gotos \
- LINKCC='$(PURIFY) $(CXX)' \
- LDSHARED='$(CC) $(CFLAGS) -shared' \
- BLDSHARED='$(CC) $(CFLAGS) -shared' \
- LDFLAGS="%{rpmcflags} %{rpmldflags}"
+ %{?with_system_mpdecimal:--with-system-libmpdec} \
+ --with-threads \
+%ifarch %{ix86} %{x8664} ppc ppc64
+ --with-tsc
+%endif
-%{__make} \
- OPT="%{rpmcflags} %{rpmcppflags} -fno-caller-saves" 2>&1 | awk '
+%{__make} 2>&1 | awk '
BEGIN { fail = 0; logmsg = ""; }
{
if ($0 ~ /\*\*\* WARNING:/) {
export LC_ALL
%if %{with tests}
binlibdir=`echo build/lib.*`
+# -l and -j don't go together! and -j is brought up by Tools/scripts/run_tests.py
%{__make} test \
TESTOPTS="%{test_flags} %{test_list}" \
TESTPYTHON="LD_LIBRARY_PATH=`pwd` PYTHONHOME=`pwd` PYTHONPATH=`pwd`/Lib:`pwd`/$binlibdir ./python -tt"
# pygettext.py is provided for compatibility
install -p Tools/i18n/pygettext.py $RPM_BUILD_ROOT%{_bindir}/pygettext%{py_ver}
+# reindent python code
+install -p Tools/scripts/reindent.py $RPM_BUILD_ROOT%{_bindir}/pyreindent%{py_ver}
+
# just to cut the noise, as they are not packaged (now)
-# first tests (probably could be packaged)
-%{__rm} -r $RPM_BUILD_ROOT%{py_scriptdir}/test
-%{__rm} -r $RPM_BUILD_ROOT%{py_scriptdir}/ctypes/test
-%{__rm} -r $RPM_BUILD_ROOT%{py_scriptdir}/distutils/tests
-%{__rm} -r $RPM_BUILD_ROOT%{py_scriptdir}/lib2to3/tests
-%{__rm} -r $RPM_BUILD_ROOT%{py_scriptdir}/sqlite3/test
-%{__rm} -r $RPM_BUILD_ROOT%{py_scriptdir}/tkinter/test
-%{__rm} -r $RPM_BUILD_ROOT%{py_scriptdir}/unittest/test
-
-# other files
%{__rm} $RPM_BUILD_ROOT%{py_scriptdir}/plat-*/regen
%{__rm} $RPM_BUILD_ROOT%{py_scriptdir}/ctypes/macholib/fetch_macholib*
%{__rm} $RPM_BUILD_ROOT%{py_scriptdir}/site-packages/README
# currently provided by python-2to3, consider switching to this one
%{__rm} $RPM_BUILD_ROOT%{_bindir}/2to3
+# packaged separately (python-setuptools.spec)
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/easy_install-3.4 \
+ $RPM_BUILD_ROOT%{py_sitescriptdir}/{easy_install.py,pkg_resources.py} \
+ $RPM_BUILD_ROOT%{py_sitescriptdir}/__pycache__/{easy_install,pkg_resources}.*.pyc
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/{_markerlib,setuptools,setuptools-2.1.dist-info}
+
+# packaged separately (python-pip.spec)
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/{pip3,pip3.4}
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/{pip,pip-1.5.6.dist-info}
+
# that seems to be only an empty extension template,
# which seems to be built only {with tests}
%{__rm} -f $RPM_BUILD_ROOT%{py_dyndir}/xxlimited.*.so
%attr(755,root,root) %{_bindir}/python%{py_abi}
%attr(755,root,root) %{_bindir}/python3
%{_mandir}/man1/python%{py_ver}.1*
+%{_mandir}/man1/python3.1*
%files libs
%defattr(644,root,root,755)
%attr(755,root,root) %{py_dyndir}/_struct.cpython-*.so
# modules required by python library
+%{py_scriptdir}/_collections_abc.py
+%{py_scriptdir}/_sitebuiltins.py
%{py_scriptdir}/_sysconfigdata.py
%{py_scriptdir}/_weakrefset.py
%{py_scriptdir}/abc.py
%{py_scriptdir}/os.py
# needed by the dynamic sys.lib patch
%{py_scriptdir}/types.py
+%{py_scriptdir}/__pycache__/_sitebuiltins.cpython-*.py[co]
%{py_scriptdir}/__pycache__/_sysconfigdata.cpython-*.py[co]
%{py_scriptdir}/__pycache__/_weakrefset.cpython-*.py[co]
%{py_scriptdir}/__pycache__/abc.cpython-*.py[co]
%{py_scriptdir}/__pycache__/bisect.cpython-*.py[co]
%{py_scriptdir}/__pycache__/codecs.cpython-*.py[co]
+%{py_scriptdir}/__pycache__/_collections_abc.cpython-*.py[co]
%{py_scriptdir}/__pycache__/copyreg.cpython-*.py[co]
%{py_scriptdir}/__pycache__/functools.cpython-*.py[co]
%{py_scriptdir}/__pycache__/genericpath.cpython-*.py[co]
%defattr(644,root,root,755)
/etc/shrc.d/python*-modules*
%attr(755,root,root) %{_bindir}/pyvenv
-%attr(755,root,root) %{_bindir}/pyvenv-3.3
+%attr(755,root,root) %{_bindir}/pyvenv-3.4
%{py_scriptdir}/__future__.py
%{py_scriptdir}/__phello__.foo.py
+%{py_scriptdir}/_bootlocale.py
%{py_scriptdir}/_compat_pickle.py
%{py_scriptdir}/_dummy_thread.py
%{py_scriptdir}/_markupbase.py
%{py_scriptdir}/dis.py
%{py_scriptdir}/doctest.py
%{py_scriptdir}/dummy_threading.py
+%{py_scriptdir}/enum.py
%{py_scriptdir}/filecmp.py
%{py_scriptdir}/fileinput.py
%{py_scriptdir}/fnmatch.py
%{py_scriptdir}/nturl2path.py
%{py_scriptdir}/numbers.py
%{py_scriptdir}/opcode.py
+%{py_scriptdir}/operator.py
%{py_scriptdir}/optparse.py
-%{py_scriptdir}/os2emxpath.py
+%{py_scriptdir}/pathlib.py
%{py_scriptdir}/pickle.py
%{py_scriptdir}/pickletools.py
%{py_scriptdir}/pipes.py
%{py_scriptdir}/rlcompleter.py
%{py_scriptdir}/runpy.py
%{py_scriptdir}/sched.py
+%{py_scriptdir}/selectors.py
%{py_scriptdir}/shelve.py
%{py_scriptdir}/shlex.py
%{py_scriptdir}/shutil.py
%{py_scriptdir}/socket.py
%{py_scriptdir}/socketserver.py
%{py_scriptdir}/ssl.py
+%{py_scriptdir}/statistics.py
%{py_scriptdir}/string.py
%{py_scriptdir}/stringprep.py
%{py_scriptdir}/struct.py
%{py_scriptdir}/this.py
%{py_scriptdir}/threading.py
%{py_scriptdir}/trace.py
+%{py_scriptdir}/tracemalloc.py
%{py_scriptdir}/tty.py
%{py_scriptdir}/turtle.py
%{py_scriptdir}/uu.py
%{py_scriptdir}/zipfile.py
%{py_scriptdir}/__pycache__/__future__.cpython-*.py[co]
%{py_scriptdir}/__pycache__/__phello__.cpython-*.py[co]
+%{py_scriptdir}/__pycache__/_bootlocale.cpython-*.py[co]
%{py_scriptdir}/__pycache__/_compat_pickle.cpython-*.py[co]
%{py_scriptdir}/__pycache__/_dummy_thread.cpython-*.py[co]
%{py_scriptdir}/__pycache__/_markupbase.cpython-*.py[co]
%{py_scriptdir}/__pycache__/dis.cpython-*.py[co]
%{py_scriptdir}/__pycache__/doctest.cpython-*.py[co]
%{py_scriptdir}/__pycache__/dummy_threading.cpython-*.py[co]
+%{py_scriptdir}/__pycache__/enum.cpython-*.py[co]
%{py_scriptdir}/__pycache__/filecmp.cpython-*.py[co]
%{py_scriptdir}/__pycache__/fileinput.cpython-*.py[co]
%{py_scriptdir}/__pycache__/fnmatch.cpython-*.py[co]
%{py_scriptdir}/__pycache__/nturl2path.cpython-*.py[co]
%{py_scriptdir}/__pycache__/numbers.cpython-*.py[co]
%{py_scriptdir}/__pycache__/opcode.cpython-*.py[co]
+%{py_scriptdir}/__pycache__/operator.cpython-*.py[co]
%{py_scriptdir}/__pycache__/optparse.cpython-*.py[co]
-%{py_scriptdir}/__pycache__/os2emxpath.cpython-*.py[co]
+%{py_scriptdir}/__pycache__/pathlib.cpython-*.py[co]
%{py_scriptdir}/__pycache__/pickle.cpython-*.py[co]
%{py_scriptdir}/__pycache__/pickletools.cpython-*.py[co]
%{py_scriptdir}/__pycache__/pipes.cpython-*.py[co]
%{py_scriptdir}/__pycache__/rlcompleter.cpython-*.py[co]
%{py_scriptdir}/__pycache__/runpy.cpython-*.py[co]
%{py_scriptdir}/__pycache__/sched.cpython-*.py[co]
+%{py_scriptdir}/__pycache__/selectors.cpython-*.py[co]
%{py_scriptdir}/__pycache__/shelve.cpython-*.py[co]
%{py_scriptdir}/__pycache__/shlex.cpython-*.py[co]
%{py_scriptdir}/__pycache__/shutil.cpython-*.py[co]
%{py_scriptdir}/__pycache__/socket.cpython-*.py[co]
%{py_scriptdir}/__pycache__/socketserver.cpython-*.py[co]
%{py_scriptdir}/__pycache__/ssl.cpython-*.py[co]
+%{py_scriptdir}/__pycache__/statistics.cpython-*.py[co]
%{py_scriptdir}/__pycache__/string.cpython-*.py[co]
%{py_scriptdir}/__pycache__/stringprep.cpython-*.py[co]
%{py_scriptdir}/__pycache__/struct.cpython-*.py[co]
%{py_scriptdir}/__pycache__/this.cpython-*.py[co]
%{py_scriptdir}/__pycache__/threading.cpython-*.py[co]
%{py_scriptdir}/__pycache__/trace.cpython-*.py[co]
+%{py_scriptdir}/__pycache__/tracemalloc.cpython-*.py[co]
%{py_scriptdir}/__pycache__/tty.cpython-*.py[co]
%{py_scriptdir}/__pycache__/turtle.cpython-*.py[co]
%{py_scriptdir}/__pycache__/uu.cpython-*.py[co]
%attr(755,root,root) %{py_dyndir}/_json.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_lsprof.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_lzma.cpython-*.so
+%attr(755,root,root) %{py_dyndir}/_md5.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_multibytecodec.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_multiprocessing.cpython-*.so
+%attr(755,root,root) %{py_dyndir}/_opcode.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_pickle.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_posixsubprocess.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_random.cpython-*.so
+%attr(755,root,root) %{py_dyndir}/_sha1.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_socket.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_ssl.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_testbuffer.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_testcapi.cpython-*.so
+%attr(755,root,root) %{py_dyndir}/_testimportmultiple.cpython-*.so
# for openssl < 0.9.8 package sha256 and sha512 modules
-%if 0%(pkg-config openssl --atleast-version=0.9.8; echo $?)
+%if "%{pld_release}" != "ac"
%attr(755,root,root) %{py_dyndir}/_sha256.cpython-*.so
%attr(755,root,root) %{py_dyndir}/_sha512.cpython-*.so
%endif
%attr(755,root,root) %{py_dyndir}/array.cpython-*.so
-%attr(755,root,root) %{py_dyndir}/atexit.cpython-*.so
%attr(755,root,root) %{py_dyndir}/audioop.cpython-*.so
%attr(755,root,root) %{py_dyndir}/binascii.cpython-*.so
%attr(755,root,root) %{py_dyndir}/cmath.cpython-*.so
%{py_scriptdir}/plat-*/__pycache__
%{py_scriptdir}/plat-*/*.py
+%dir %{py_scriptdir}/asyncio
+%{py_scriptdir}/asyncio/__pycache__
+%{py_scriptdir}/asyncio/*.py
+
%{py_scriptdir}/concurrent
%dir %{py_scriptdir}/ctypes
%dir %{py_scriptdir}/email/mime
%{py_scriptdir}/email/__pycache__
%{py_scriptdir}/email/mime/__pycache__
+%{py_scriptdir}/email/architecture.rst
%{py_scriptdir}/email/*.py
%{py_scriptdir}/email/mime/*.py
+%dir %{py_scriptdir}/ensurepip
+%{py_scriptdir}/ensurepip/__pycache__
+%{py_scriptdir}/ensurepip/*.py
+%{py_scriptdir}/ensurepip/_bundled
+
%dir %{py_scriptdir}/html
%{py_scriptdir}/html/*.py
%{py_scriptdir}/html/__pycache__
%{py_scriptdir}/http/__pycache__
%{py_scriptdir}/http/*.py
+%dir %{py_scriptdir}/idlelib
+
%dir %{py_scriptdir}/importlib
%{py_scriptdir}/importlib/__pycache__
%{py_scriptdir}/importlib/*.py
%{py_scriptdir}/multiprocessing/dummy/*.py
%{py_scriptdir}/turtledemo
-%{py_scriptdir}/unittest
+
+%dir %{py_scriptdir}/unittest
+%{py_scriptdir}/unittest/__pycache__
+%{py_scriptdir}/unittest/*.py
%dir %{py_scriptdir}/urllib
%{py_scriptdir}/urllib/__pycache__
%dir %{py_scriptdir}/venv/scripts
%dir %{py_scriptdir}/venv/scripts/posix
%{py_scriptdir}/venv/scripts/posix/activate
-%{py_scriptdir}/venv/scripts/posix/pydoc
%dir %{py_scriptdir}/wsgiref
%{py_scriptdir}/wsgiref/__pycache__
%files -n pydoc3
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/pydoc3
-%attr(755,root,root) %{_bindir}/pydoc3.3
+%attr(755,root,root) %{_bindir}/pydoc3.4
%{py_scriptdir}/pydoc.py
%{py_scriptdir}/__pycache__/pydoc.cpython-*.py[co]
%dir %{py_scriptdir}/pydoc_data
%files -n idle3
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/idle3
-%attr(755,root,root) %{_bindir}/idle3.3
-%dir %{py_scriptdir}/idlelib
+%attr(755,root,root) %{_bindir}/idle3.4
%dir %{py_scriptdir}/idlelib/Icons
%{py_scriptdir}/idlelib/__pycache__
%{py_scriptdir}/idlelib/*.py
%{py_libdir}/config-%{py_abi}/config.c
%{py_libdir}/config-%{py_abi}/config.c.in
%{py_libdir}/config-%{py_abi}/python.o
+%{py_libdir}/config-%{py_abi}/python-config.py
%{_pkgconfigdir}/python-%{py_ver}.pc
%{_pkgconfigdir}/python-%{py_abi}.pc
%{_pkgconfigdir}/python3.pc
%defattr(644,root,root,755)
/etc/shrc.d/python*-devel*
%attr(755,root,root) %{_bindir}/pygettext%{py_ver}
+%attr(755,root,root) %{_bindir}/pyreindent%{py_ver}
%{py_scriptdir}/pdb.py
%{py_scriptdir}/profile.py
%{py_scriptdir}/pstats.py
%defattr(644,root,root,755)
%{_examplesdir}/%{name}-%{version}
+%files test
+%{py_scriptdir}/idlelib/idle_test
+%{py_scriptdir}/test
+%{py_scriptdir}/ctypes/test
+%{py_scriptdir}/distutils/tests
+%{py_scriptdir}/lib2to3/tests
+%{py_scriptdir}/sqlite3/test
+%{py_scriptdir}/tkinter/test
+%{py_scriptdir}/unittest/test
+
%if %{with info}
%files doc-info
%defattr(644,root,root,755)