Compare commits

...

9 Commits

Author SHA1 Message Date
Fedora Release Engineering fb39860846 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-14 02:48:28 +00:00
Jason Tibbitts f5b3292c68 Remove needless use of %defattr 2018-07-10 01:54:54 -05:00
Miro Hrončok 08290bc9c3 Add a workaround for broken %undefine __brp_python_bytecompile
See https://bugzilla.redhat.com/show_bug.cgi?id=1597664
2018-07-03 14:02:51 +02:00
Miro Hrončok 002eb7557e Move /usr/bin/python into a separate package
See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package

Reverts https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
2018-07-03 11:31:07 +02:00
Miro Hrončok 692623a0b9 pynche: Do not execute just python, but python2 2018-06-21 16:35:28 +02:00
Miro Hrončok 5ee9c1ec45 Rebuilt for Python 3.7 2018-06-13 18:34:16 +02:00
Miro Hrončok 2b53e7ec9b Bootstrap for Python 3.7 2018-06-13 15:40:42 +02:00
Charalampos Stratakis 4922a4e974 Fix loading of the gdb python plugin (rhbz#1578001)
Conditionalize permissions changes for the debug
shared library.
2018-05-15 14:28:59 +02:00
Miro Hrončok ba2118865d Add a Python 3 bootstrapping bcond 2018-05-12 00:53:31 +02:00
3 changed files with 67 additions and 81 deletions

View File

@ -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
View File

@ -1,2 +1,2 @@
#!/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

View File

@ -12,6 +12,10 @@
# (the -debug subpackages)
%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 python python2
@ -66,6 +70,10 @@
# available in /usr/bin when Python is built. Also, the bytecompilation fails
# on files that test invalid syntax.
%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
# patches:
@ -104,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
Release: 1%{?dist}
Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@ -182,6 +190,15 @@ Requires: python2-pip
%endif # !module_build
%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 #
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 #
# Disable automatic detection for the nis module
# (we handle it it in Setup.dist, see Patch0)
@ -752,15 +764,6 @@ Patch5000: 05000-autotool-intermediates.patch
# 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/
%description
@ -776,6 +779,22 @@ package.
This package provides the "python2" executable; most of the actual
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
Summary: Runtime libraries for Python 2
Group: Applications/System
@ -809,9 +828,15 @@ Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-rpm-macros
Requires: python2-rpm-macros
Requires: python3-rpm-generators
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=1496757
# https://bugzilla.redhat.com/show_bug.cgi?id=1218294
@ -1037,7 +1062,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%if %{with rewheel}
%patch198 -p1
%endif
%patch288 -p1
%patch289 -p1
@ -1239,7 +1263,7 @@ make install DESTDIR=%{buildroot}
#
%if 0%{?with_gdb_hooks}
DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
mkdir -p %{buildroot}$DirHoldingGdbPy
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
/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
/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
%endif
# ======================================================
@ -1557,18 +1583,19 @@ CheckPython \
%files
%defattr(-, root, root, -)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
%{_bindir}/pydoc*
%{_bindir}/python
%{_bindir}/%{python}
%{_bindir}/python%{pybasever}
%{_mandir}/*/*
%{_mandir}/*/python2*
%files -n python-unversioned-command
%{_bindir}/python
%{_mandir}/*/python.1.*
%files libs
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
@ -1728,7 +1755,6 @@ CheckPython \
%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/python-%{pybasever}.pc
%{_libdir}/pkgconfig/python.pc
%{_libdir}/pkgconfig/python2.pc
@ -1744,7 +1770,6 @@ CheckPython \
%{_libdir}/libpython%{pybasever}.so
%files tools
%defattr(-,root,root,755)
%doc Tools/pynche/README.pynche
%{site_packages}/pynche
%{_bindir}/smtpd*.py*
@ -1761,14 +1786,12 @@ CheckPython \
%{pylibdir}/Doc
%files tkinter
%defattr(-,root,root,755)
%{pylibdir}/lib-tk
%if ! 0%{?_module_build}
%{dynload_dir}/_tkinter.so
%endif
%files test
%defattr(-, root, root, -)
%{pylibdir}/bsddb/test
%{pylibdir}/ctypes/test
%{pylibdir}/distutils/tests
@ -1797,7 +1820,6 @@ CheckPython \
%if %{with debug_build}
%files debug
%defattr(-,root,root,-)
# Analog of the core subpackage's files:
%{_bindir}/python-debug
@ -1940,6 +1962,23 @@ CheckPython \
# ======================================================
%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
- Update to version 2.7.15