Compare commits
9 Commits
080ef9bdfb
...
fb39860846
Author | SHA1 | Date | |
---|---|---|---|
|
fb39860846 | ||
|
f5b3292c68 | ||
|
08290bc9c3 | ||
|
002eb7557e | ||
|
692623a0b9 | ||
|
5ee9c1ec45 | ||
|
2b53e7ec9b | ||
|
4922a4e974 | ||
|
ba2118865d |
@ -1,53 +0,0 @@
|
|||||||
diff -U3 -r Python-2.7.14.orig/Lib/site.py Python-2.7.14/Lib/site.py
|
|
||||||
--- Python-2.7.14.orig/Lib/site.py 2018-01-29 15:05:04.517599815 +0100
|
|
||||||
+++ Python-2.7.14/Lib/site.py 2018-01-30 09:13:17.305270500 +0100
|
|
||||||
@@ -515,6 +515,41 @@
|
|
||||||
"'import usercustomize' failed; use -v for traceback"
|
|
||||||
|
|
||||||
|
|
||||||
+def handle_ambiguous_python_version():
|
|
||||||
+ """Warn or fail if /usr/bin/python is used
|
|
||||||
+
|
|
||||||
+ Behavior depends on the value of PYTHON_DISALLOW_AMBIGUOUS_VERSION:
|
|
||||||
+ - "warn" - print warning to stderr
|
|
||||||
+ - "1" - print error and exit with positive exit code
|
|
||||||
+ - otherwise: do nothing
|
|
||||||
+
|
|
||||||
+ This is a Fedora modification, see the Change page for details:
|
|
||||||
+ See https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
|
|
||||||
+ """
|
|
||||||
+ if sys.executable == "/usr/bin/python":
|
|
||||||
+ setting = os.environ.get("PYTHON_DISALLOW_AMBIGUOUS_VERSION")
|
|
||||||
+ if setting == 'warn':
|
|
||||||
+ print>>sys.stderr, (
|
|
||||||
+ "DEPRECATION WARNING: python2 invoked with /usr/bin/python.\n"
|
|
||||||
+ " Use /usr/bin/python3 or /usr/bin/python2\n"
|
|
||||||
+ " /usr/bin/python will be removed or switched to Python 3"
|
|
||||||
+ " in the future.\n"
|
|
||||||
+ " If you cannot make the switch now, please follow"
|
|
||||||
+ " instructions at"
|
|
||||||
+ " https://fedoraproject.org/wiki/Changes/"
|
|
||||||
+ "Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out")
|
|
||||||
+ elif setting == '1':
|
|
||||||
+ print>>sys.stderr, (
|
|
||||||
+ "ERROR: python2 invoked with /usr/bin/python.\n"
|
|
||||||
+ " Use /usr/bin/python3 or /usr/bin/python2\n"
|
|
||||||
+ " /usr/bin/python will be switched to Python 3"
|
|
||||||
+ " in the future.\n"
|
|
||||||
+ " More details are at"
|
|
||||||
+ " https://fedoraproject.org/wiki/Changes/"
|
|
||||||
+ "Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out")
|
|
||||||
+ exit(1)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
def main():
|
|
||||||
global ENABLE_USER_SITE
|
|
||||||
|
|
||||||
@@ -543,6 +578,7 @@
|
|
||||||
# this module is run as a script, because this code is executed twice.
|
|
||||||
if hasattr(sys, "setdefaultencoding"):
|
|
||||||
del sys.setdefaultencoding
|
|
||||||
+ handle_ambiguous_python_version()
|
|
||||||
|
|
||||||
main()
|
|
||||||
|
|
2
pynche
2
pynche
@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
exec `python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific = True))"`/pynche/pynche
|
exec `python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific = True))"`/pynche/pynche
|
||||||
|
93
python2.spec
93
python2.spec
@ -12,6 +12,10 @@
|
|||||||
# (the -debug subpackages)
|
# (the -debug subpackages)
|
||||||
%bcond_without debug_build
|
%bcond_without debug_build
|
||||||
|
|
||||||
|
# Only use this when bootstrapping python3
|
||||||
|
# Needed to build setuptools for the first time
|
||||||
|
%bcond_with python3_bootstrap
|
||||||
|
|
||||||
%global unicode ucs4
|
%global unicode ucs4
|
||||||
|
|
||||||
%global python python2
|
%global python python2
|
||||||
@ -66,6 +70,10 @@
|
|||||||
# available in /usr/bin when Python is built. Also, the bytecompilation fails
|
# available in /usr/bin when Python is built. Also, the bytecompilation fails
|
||||||
# on files that test invalid syntax.
|
# on files that test invalid syntax.
|
||||||
%undefine __brp_python_bytecompile
|
%undefine __brp_python_bytecompile
|
||||||
|
# The above is broken now
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1597664
|
||||||
|
# This is an older non-standard way to disable the brp script, as a workaround
|
||||||
|
%undefine py_auto_byte_compile
|
||||||
|
|
||||||
# We need to get a newer configure generated out of configure.in for the following
|
# We need to get a newer configure generated out of configure.in for the following
|
||||||
# patches:
|
# patches:
|
||||||
@ -104,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming language
|
|||||||
Name: %{python}
|
Name: %{python}
|
||||||
# Remember to also rebase python2-docs when changing this:
|
# Remember to also rebase python2-docs when changing this:
|
||||||
Version: 2.7.15
|
Version: 2.7.15
|
||||||
Release: 1%{?dist}
|
Release: 6%{?dist}
|
||||||
License: Python
|
License: Python
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
|
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
|
||||||
@ -182,6 +190,15 @@ Requires: python2-pip
|
|||||||
%endif # !module_build
|
%endif # !module_build
|
||||||
%endif # rewheel
|
%endif # rewheel
|
||||||
|
|
||||||
|
# Providing python27 as now multiple interpreters exist in Fedora
|
||||||
|
# alongside the system one e.g. python26, python33 etc
|
||||||
|
Provides: python27 = %{version}-%{release}
|
||||||
|
|
||||||
|
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
|
||||||
|
# We recommend /usr/bin/python so users get it by default
|
||||||
|
# Versioned recommends are problematic, and we know that the package requires
|
||||||
|
# python2 back with fixed version, so we just use the path here:
|
||||||
|
Recommends: %{_bindir}/python
|
||||||
|
|
||||||
|
|
||||||
# =======================
|
# =======================
|
||||||
@ -720,11 +737,6 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
|
|||||||
# 00198 #
|
# 00198 #
|
||||||
Patch198: 00198-add-rewheel-module.patch
|
Patch198: 00198-add-rewheel-module.patch
|
||||||
|
|
||||||
# 00288 #
|
|
||||||
# Adds a warning when /usr/bin/python is invoked during rpmbuild
|
|
||||||
# See https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
|
|
||||||
Patch288: 00288-ambiguous-python-version-rpmbuild-warn.patch
|
|
||||||
|
|
||||||
# 00289 #
|
# 00289 #
|
||||||
# Disable automatic detection for the nis module
|
# Disable automatic detection for the nis module
|
||||||
# (we handle it it in Setup.dist, see Patch0)
|
# (we handle it it in Setup.dist, see Patch0)
|
||||||
@ -752,15 +764,6 @@ Patch5000: 05000-autotool-intermediates.patch
|
|||||||
# Additional metadata, and subpackages
|
# Additional metadata, and subpackages
|
||||||
# ======================================================
|
# ======================================================
|
||||||
|
|
||||||
Provides: python = %{version}-%{release}
|
|
||||||
Provides: python%{?_isa} = %{version}-%{release}
|
|
||||||
|
|
||||||
|
|
||||||
# Providing python27 as now multiple interpreters exist in Fedora
|
|
||||||
# alongside the system one e.g. python26, python33 etc
|
|
||||||
Provides: python27 = %{version}-%{release}
|
|
||||||
|
|
||||||
|
|
||||||
URL: https://www.python.org/
|
URL: https://www.python.org/
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -776,6 +779,22 @@ package.
|
|||||||
This package provides the "python2" executable; most of the actual
|
This package provides the "python2" executable; most of the actual
|
||||||
implementation is within the "python2-libs" package.
|
implementation is within the "python2-libs" package.
|
||||||
|
|
||||||
|
|
||||||
|
%package -n python-unversioned-command
|
||||||
|
Summary: The "python" command that runs Python 2
|
||||||
|
BuildArch: noarch
|
||||||
|
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
|
||||||
|
|
||||||
|
# In theory this could require any python2 version
|
||||||
|
Requires: python2 == %{version}-%{release}
|
||||||
|
# But since we want to provide versioned python, we require exact version
|
||||||
|
Provides: python = %{version}-%{release}
|
||||||
|
# This also save us an explicit conflict for older python2 builds
|
||||||
|
|
||||||
|
%description -n python-unversioned-command
|
||||||
|
This package contains /usr/bin/python - the "python" command that runs Python 2.
|
||||||
|
|
||||||
|
|
||||||
%package libs
|
%package libs
|
||||||
Summary: Runtime libraries for Python 2
|
Summary: Runtime libraries for Python 2
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
@ -809,9 +828,15 @@ Group: Development/Libraries
|
|||||||
Requires: %{python}%{?_isa} = %{version}-%{release}
|
Requires: %{python}%{?_isa} = %{version}-%{release}
|
||||||
Requires: python-rpm-macros
|
Requires: python-rpm-macros
|
||||||
Requires: python2-rpm-macros
|
Requires: python2-rpm-macros
|
||||||
Requires: python3-rpm-generators
|
|
||||||
Requires: pkgconfig
|
Requires: pkgconfig
|
||||||
|
|
||||||
|
%if %{without python3_bootstrap}
|
||||||
|
# When bootstrapping python3, we need to build setuptools
|
||||||
|
# But setuptools BR python2-devel and that brings in python3-rpm-generators
|
||||||
|
# python3-rpm-generators needs python3-setuptools, so we cannot have it yet
|
||||||
|
Requires: python3-rpm-generators
|
||||||
|
%endif
|
||||||
|
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1217376
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1217376
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1496757
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1496757
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1218294
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1218294
|
||||||
@ -1037,7 +1062,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
|
|||||||
%if %{with rewheel}
|
%if %{with rewheel}
|
||||||
%patch198 -p1
|
%patch198 -p1
|
||||||
%endif
|
%endif
|
||||||
%patch288 -p1
|
|
||||||
%patch289 -p1
|
%patch289 -p1
|
||||||
|
|
||||||
|
|
||||||
@ -1239,7 +1263,7 @@ make install DESTDIR=%{buildroot}
|
|||||||
#
|
#
|
||||||
%if 0%{?with_gdb_hooks}
|
%if 0%{?with_gdb_hooks}
|
||||||
DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
|
DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
|
||||||
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
|
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
|
||||||
|
|
||||||
mkdir -p %{buildroot}$DirHoldingGdbPy
|
mkdir -p %{buildroot}$DirHoldingGdbPy
|
||||||
cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
|
cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
|
||||||
@ -1482,7 +1506,9 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \
|
|||||||
# Make library-files user writable
|
# Make library-files user writable
|
||||||
/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
|
/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
|
||||||
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
|
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
|
||||||
|
%if %{with debug_build}
|
||||||
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
|
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
# ======================================================
|
# ======================================================
|
||||||
@ -1557,18 +1583,19 @@ CheckPython \
|
|||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-, root, root, -)
|
|
||||||
%{!?_licensedir:%global license %%doc}
|
%{!?_licensedir:%global license %%doc}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README
|
%doc README
|
||||||
%{_bindir}/pydoc*
|
%{_bindir}/pydoc*
|
||||||
%{_bindir}/python
|
|
||||||
%{_bindir}/%{python}
|
%{_bindir}/%{python}
|
||||||
%{_bindir}/python%{pybasever}
|
%{_bindir}/python%{pybasever}
|
||||||
%{_mandir}/*/*
|
%{_mandir}/*/python2*
|
||||||
|
|
||||||
|
%files -n python-unversioned-command
|
||||||
|
%{_bindir}/python
|
||||||
|
%{_mandir}/*/python.1.*
|
||||||
|
|
||||||
%files libs
|
%files libs
|
||||||
%defattr(-,root,root,-)
|
|
||||||
%{!?_licensedir:%global license %%doc}
|
%{!?_licensedir:%global license %%doc}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README
|
%doc README
|
||||||
@ -1728,7 +1755,6 @@ CheckPython \
|
|||||||
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-,root,root,-)
|
|
||||||
%{_libdir}/pkgconfig/python-%{pybasever}.pc
|
%{_libdir}/pkgconfig/python-%{pybasever}.pc
|
||||||
%{_libdir}/pkgconfig/python.pc
|
%{_libdir}/pkgconfig/python.pc
|
||||||
%{_libdir}/pkgconfig/python2.pc
|
%{_libdir}/pkgconfig/python2.pc
|
||||||
@ -1744,7 +1770,6 @@ CheckPython \
|
|||||||
%{_libdir}/libpython%{pybasever}.so
|
%{_libdir}/libpython%{pybasever}.so
|
||||||
|
|
||||||
%files tools
|
%files tools
|
||||||
%defattr(-,root,root,755)
|
|
||||||
%doc Tools/pynche/README.pynche
|
%doc Tools/pynche/README.pynche
|
||||||
%{site_packages}/pynche
|
%{site_packages}/pynche
|
||||||
%{_bindir}/smtpd*.py*
|
%{_bindir}/smtpd*.py*
|
||||||
@ -1761,14 +1786,12 @@ CheckPython \
|
|||||||
%{pylibdir}/Doc
|
%{pylibdir}/Doc
|
||||||
|
|
||||||
%files tkinter
|
%files tkinter
|
||||||
%defattr(-,root,root,755)
|
|
||||||
%{pylibdir}/lib-tk
|
%{pylibdir}/lib-tk
|
||||||
%if ! 0%{?_module_build}
|
%if ! 0%{?_module_build}
|
||||||
%{dynload_dir}/_tkinter.so
|
%{dynload_dir}/_tkinter.so
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files test
|
%files test
|
||||||
%defattr(-, root, root, -)
|
|
||||||
%{pylibdir}/bsddb/test
|
%{pylibdir}/bsddb/test
|
||||||
%{pylibdir}/ctypes/test
|
%{pylibdir}/ctypes/test
|
||||||
%{pylibdir}/distutils/tests
|
%{pylibdir}/distutils/tests
|
||||||
@ -1797,7 +1820,6 @@ CheckPython \
|
|||||||
|
|
||||||
%if %{with debug_build}
|
%if %{with debug_build}
|
||||||
%files debug
|
%files debug
|
||||||
%defattr(-,root,root,-)
|
|
||||||
|
|
||||||
# Analog of the core subpackage's files:
|
# Analog of the core subpackage's files:
|
||||||
%{_bindir}/python-debug
|
%{_bindir}/python-debug
|
||||||
@ -1940,6 +1962,23 @@ CheckPython \
|
|||||||
# ======================================================
|
# ======================================================
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.15-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-5
|
||||||
|
- Move /usr/bin/python into a separate package
|
||||||
|
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
|
||||||
|
- Revert https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
|
||||||
|
|
||||||
|
* Wed Jun 13 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-4
|
||||||
|
- Rebuilt for Python 3.7
|
||||||
|
|
||||||
|
* Wed Jun 13 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-3
|
||||||
|
- Bootstrap for Python 3.7
|
||||||
|
|
||||||
|
* Tue May 15 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.7.15-2
|
||||||
|
- Fix loading of the gdb python plugin (rhbz#1578001)
|
||||||
|
|
||||||
* Tue May 01 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-1
|
* Tue May 01 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-1
|
||||||
- Update to version 2.7.15
|
- Update to version 2.7.15
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user