X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=python3.spec;h=3590181f5d1ff567a2a8a357a20f0edcda14471e;hb=25e3a83cfbee4f35175ae231e37a0eb15c30a644;hp=902a9ebf39189f5307f5fd41b1d36b9cdbbe11af;hpb=629c57e2a269134cac1af4a70ce1812feeaf4d8f;p=packages%2Fpython3.git diff --git a/python3.spec b/python3.spec index 902a9eb..3590181 100644 --- a/python3.spec +++ b/python3.spec @@ -2,10 +2,10 @@ # - 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 -# - --with-system-libmpdec when new version released [BR: mpdecimal-devel > 2.3] # # 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 @@ -20,7 +20,7 @@ # 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} @@ -37,20 +37,20 @@ Summary(ru.UTF-8): Язык программирования очень высо 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}.4 -Release: 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: 8fb961a20600aafafd249537af3ac637 +# 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/ @@ -65,6 +65,7 @@ BuildRequires: gdbm-devel >= 1.8.3 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 @@ -83,9 +84,9 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %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} @@ -217,6 +218,7 @@ Summary: Python modules 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 @@ -446,6 +448,17 @@ Przykładowe programy w Pythonie. 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 @@ -454,7 +467,7 @@ Przykłady te są dla Pythona 2.3.4, nie %{version}. %patch3 -p1 %patch4 -p1 %patch5 -p1 -%patch6 -p1 + %patch7 -p1 %patch8 -p1 @@ -465,13 +478,15 @@ for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx; do %{__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 @@ -481,32 +496,30 @@ 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:/) { @@ -521,6 +534,7 @@ LC_ALL=C 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" @@ -581,17 +595,10 @@ sed 's/=/ /' \ # 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 @@ -602,6 +609,16 @@ install -p Tools/i18n/pygettext.py $RPM_BUILD_ROOT%{_bindir}/pygettext%{py_ver} # 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 @@ -650,6 +667,8 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -677,11 +696,13 @@ rm -rf $RPM_BUILD_ROOT %{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] @@ -721,9 +742,10 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -762,6 +784,7 @@ rm -rf $RPM_BUILD_ROOT %{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 @@ -793,8 +816,9 @@ rm -rf $RPM_BUILD_ROOT %{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 @@ -812,6 +836,7 @@ rm -rf $RPM_BUILD_ROOT %{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 @@ -821,6 +846,7 @@ rm -rf $RPM_BUILD_ROOT %{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 @@ -836,6 +862,7 @@ rm -rf $RPM_BUILD_ROOT %{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 @@ -847,6 +874,7 @@ rm -rf $RPM_BUILD_ROOT %{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] @@ -885,6 +913,7 @@ rm -rf $RPM_BUILD_ROOT %{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] @@ -916,8 +945,9 @@ rm -rf $RPM_BUILD_ROOT %{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] @@ -935,6 +965,7 @@ rm -rf $RPM_BUILD_ROOT %{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] @@ -944,6 +975,7 @@ rm -rf $RPM_BUILD_ROOT %{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] @@ -959,6 +991,7 @@ rm -rf $RPM_BUILD_ROOT %{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] @@ -998,24 +1031,27 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -1041,6 +1077,10 @@ rm -rf $RPM_BUILD_ROOT %{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 @@ -1077,6 +1117,11 @@ rm -rf $RPM_BUILD_ROOT %{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__ @@ -1085,6 +1130,8 @@ rm -rf $RPM_BUILD_ROOT %{py_scriptdir}/http/__pycache__ %{py_scriptdir}/http/*.py +%dir %{py_scriptdir}/idlelib + %dir %{py_scriptdir}/importlib %{py_scriptdir}/importlib/__pycache__ %{py_scriptdir}/importlib/*.py @@ -1105,7 +1152,10 @@ rm -rf $RPM_BUILD_ROOT %{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__ @@ -1150,7 +1200,7 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -1161,8 +1211,7 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -1186,6 +1235,7 @@ rm -rf $RPM_BUILD_ROOT %{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 @@ -1194,6 +1244,7 @@ rm -rf $RPM_BUILD_ROOT %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 @@ -1225,6 +1276,16 @@ rm -rf $RPM_BUILD_ROOT %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)