RHEL: Convert from Fedora for the Python 3.11 stack in RHEL

Resolves: rhbz#2127923

Changes:
- Bconds set accordingly
- python3-rpm-generators taken out of the bootstrap loop as it runs on Python 3.6
- All binaries have versioned variants
This commit is contained in:
Charalampos Stratakis 2022-11-16 18:39:55 +01:00
parent eb2dc2bd2e
commit 61d457cb01
1 changed files with 69 additions and 138 deletions

View File

@ -1,3 +1,6 @@
%global __python3 /usr/bin/python3.11
%global python3_pkgversion 3.11
# ================== # ==================
# Top-level metadata # Top-level metadata
# ================== # ==================
@ -17,8 +20,8 @@ URL: https://www.python.org/
#global prerel ... #global prerel ...
%global upstream_version %{general_version}%{?prerel} %global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}} Version: %{general_version}%{?prerel:~%{prerel}}
Release: 3%{?dist} Release: 1%{?dist}
License: Python-2.0.1 License: Python
# ================================== # ==================================
@ -28,15 +31,8 @@ License: Python-2.0.1
# Note that the bcond macros are named for the CLI option they create. # Note that the bcond macros are named for the CLI option they create.
# "%%bcond_without" means "ENABLE by default and create a --without option" # "%%bcond_without" means "ENABLE by default and create a --without option"
# Main Python, i.e. whether this is the main Python version in the distribution # RHEL: Disabled by default
# that owns /usr/bin/python3 and other unique paths
# This also means the built subpackages are called python3 rather than python3X
# By default, this is determined by the %%__default_python3_pkgversion value
%if "%{?__default_python3_pkgversion}" == "%{pybasever}"
%bcond_without main_python
%else
%bcond_with main_python %bcond_with main_python
%endif
# If this is *not* Main Python, should it contain `Provides: python(abi) ...`? # If this is *not* Main Python, should it contain `Provides: python(abi) ...`?
# In Fedora no package shall depend on an alternative Python via this tag, so we do not provide it. # In Fedora no package shall depend on an alternative Python via this tag, so we do not provide it.
@ -59,11 +55,11 @@ License: Python-2.0.1
# IMPORTANT: When bootstrapping, it's very likely the wheels for pip and # IMPORTANT: When bootstrapping, it's very likely the wheels for pip and
# setuptools are not available. Turn off the rpmwheels bcond until # setuptools are not available. Turn off the rpmwheels bcond until
# the two packages are built with wheels to get around the issue. # the two packages are built with wheels to get around the issue.
%bcond_with bootstrap %bcond_without bootstrap
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package # Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
# Uses upstream bundled prebuilt wheels otherwise # Uses upstream bundled prebuilt wheels otherwise
%bcond_without rpmwheels %bcond_with rpmwheels
# If the rpmwheels condition is disabled, we use the bundled wheel packages # If the rpmwheels condition is disabled, we use the bundled wheel packages
# from Python with the versions below. # from Python with the versions below.
# This needs to be manually updated when we update Python. # This needs to be manually updated when we update Python.
@ -154,13 +150,6 @@ License: Python-2.0.1
# on files that test invalid syntax. # on files that test invalid syntax.
%undefine py_auto_byte_compile %undefine py_auto_byte_compile
# When a main_python build is attempted despite the %%__default_python3_pkgversion value
# We undefine magic macros so the python3-... package does not provide wrong python3X-...
%if %{with main_python} && ("%{?__default_python3_pkgversion}" != "%{pybasever}")
%undefine __pythonname_provides
%{warn:Doing a main_python build with wrong %%__default_python3_pkgversion (0%{?__default_python3_pkgversion}, but this is %pyshortver)}
%endif
%if %{with main_python} %if %{with main_python}
# To keep the upgrade path clean, we Obsolete python3.X from the python3 # To keep the upgrade path clean, we Obsolete python3.X from the python3
# package and python3.X-foo from individual subpackages. # package and python3.X-foo from individual subpackages.
@ -199,7 +188,9 @@ BuildRequires: glibc-devel
BuildRequires: gmp-devel BuildRequires: gmp-devel
BuildRequires: gnupg2 BuildRequires: gnupg2
BuildRequires: libappstream-glib BuildRequires: libappstream-glib
BuildRequires: libb2-devel # libb2 is not included in RHEL, we utilize
# the internal implementation of blake2
#BuildRequires: libb2-devel
BuildRequires: libffi-devel BuildRequires: libffi-devel
BuildRequires: libnsl2-devel BuildRequires: libnsl2-devel
BuildRequires: libtirpc-devel BuildRequires: libtirpc-devel
@ -213,7 +204,7 @@ BuildRequires: ncurses-devel
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: redhat-rpm-config >= 127 BuildRequires: redhat-rpm-config
BuildRequires: sqlite-devel BuildRequires: sqlite-devel
BuildRequires: gdb BuildRequires: gdb
@ -246,7 +237,10 @@ BuildRequires: %{python_wheel_pkg_prefix}-pip-wheel
# upgrading the main python3 to a new Python version, this would pull in the # upgrading the main python3 to a new Python version, this would pull in the
# old version instead. # old version instead.
BuildRequires: python%{pybasever} BuildRequires: python%{pybasever}
# for proper automatic provides %endif
%if %{without bootstrap} || %{without main_python}
# Generators run on the main Python 3 so we can take this dependency out of the bootstrap loop
BuildRequires: python3-rpm-generators BuildRequires: python3-rpm-generators
%endif %endif
@ -457,8 +451,8 @@ Summary: Python runtime libraries
Requires: %{python_wheel_pkg_prefix}-setuptools-wheel Requires: %{python_wheel_pkg_prefix}-setuptools-wheel
Requires: %{python_wheel_pkg_prefix}-pip-wheel Requires: %{python_wheel_pkg_prefix}-pip-wheel
%else %else
Provides: bundled(python3dist(pip)) = %{pip_version} Provides: bundled(python%{python3_pkgversion}dist(pip)) = %{pip_version}
Provides: bundled(python3dist(setuptools)) = %{setuptools_version} Provides: bundled(python%{python3_pkgversion}dist(setuptools)) = %{setuptools_version}
%endif %endif
%unversioned_obsoletes_of_python3_X_if_main libs %unversioned_obsoletes_of_python3_X_if_main libs
@ -492,7 +486,10 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
# But we want them when packages BuildRequire python3-devel # But we want them when packages BuildRequire python3-devel
Requires: (python-rpm-macros if rpm-build) Requires: (python-rpm-macros if rpm-build)
Requires: (python3-rpm-macros if rpm-build) Requires: (python3-rpm-macros if rpm-build)
Requires: (pyproject-rpm-macros if rpm-build)
# We provide the python3.11-rpm-macros here to make it possible to
# BuildRequire them in the same manner as RHEL8.
Provides: %{pkgname}-rpm-macros = %{version}-%{release}
%unversioned_obsoletes_of_python3_X_if_main devel %unversioned_obsoletes_of_python3_X_if_main devel
@ -504,7 +501,8 @@ Recommends: %{pkgname}-pip
# tox users are likely to need the devel subpackage # tox users are likely to need the devel subpackage
Supplements: tox Supplements: tox
%if %{without bootstrap} %if %{without bootstrap} || %{without main_python}
# Generators run on the main Python 3 so we can take this dependency out of the bootstrap loop
Requires: (python3-rpm-generators if rpm-build) Requires: (python3-rpm-generators if rpm-build)
%endif %endif
@ -616,7 +614,6 @@ The debug runtime additionally supports debug builds of C-API extensions
(with the "d" ABI flag) for debugging issues in those extensions. (with the "d" ABI flag) for debugging issues in those extensions.
%endif # with debug_build %endif # with debug_build
# ====================================================== # ======================================================
# The prep phase of the build: # The prep phase of the build:
# ====================================================== # ======================================================
@ -1107,7 +1104,6 @@ CheckPython optimized
%endif # with tests %endif # with tests
%files -n %{pkgname} %files -n %{pkgname}
%doc README.rst %doc README.rst
@ -1605,113 +1601,48 @@ CheckPython optimized
# ====================================================== # ======================================================
%changelog %changelog
* Fri Jan 06 2023 Miro Hrončok <mhroncok@redhat.com> - 3.11.1-3 * Tue Dec 13 2022 Charalampos Stratakis <cstratak@redhat.com> - 3.11.1-1
- Fix `asyncio` subprocess losing `stderr` and `stdout` output - Initial package
- Remove any deprecation warnings in asyncio.get_event_loop() - Fedora contributions by:
Björn Esser <besser82@fedoraproject.org>
* Wed Dec 07 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.1-1 Charalampos Stratakis <cstratak@redhat.com>
- Update to 3.11.1 Dan Horák <dan@danny.cz>
David Malcolm <dmalcolm@redhat.com>
* Mon Oct 24 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0-1 Dennis Gilmore <dennis@ausil.us>
- Update to 3.11.0 Florian Weimer <fweimer@redhat.com>
Gwyn Ciesla <limb@fedoraproject.org>
* Tue Sep 13 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~rc2-1 Igor Gnatenko <ignatenkobrain@fedoraproject.org>
- Update to 3.11.0rc2 Iryna Shcherbina <shcherbina.iryna@gmail.com>
Jaroslav Škarvada <jskarvad@redhat.com>
* Tue Aug 09 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~rc1-2 Jason ティビツ <tibbs@fedoraproject.org>
- Don't use custom installation schemes Kalev Lember <klember@redhat.com>
- Fixes rhbz#2026979 Karsten Hopp <karsten@redhat.com>
- Fixes rhbz#2097183 Lumir Balhar <lbalhar@redhat.com>
Marcel Plch <marcel.plch@protonmail.com>
* Mon Aug 08 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~rc1-1 Matej Stuchlik <mstuchli@redhat.com>
- Update to 3.11.0rc1 Michal Cyprian <m.cyprian@gmail.com>
Michal Toman <mtoman@fedoraproject.org>
* Tue Jul 26 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b5-1 Miro Hrončok <miro@hroncok.cz>
- Update to 3.11.0b5 Nicolas Chauvet <kwizart@gmail.com>
Orion Poplawski <orion@cora.nwra.com>
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.11.0~b4-2 Patrik Kopkan <pkopkan@redhat.com>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Peter Robinson <pbrobinson@gmail.com>
Petr Šplíchal <psplicha@redhat.com>
* Mon Jul 11 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b4-1 Petr Viktorin <pviktori@redhat.com>
- Update to 3.11.0b4 Rex Dieter <rdieter@fedoraproject.org>
Richard W.M. Jones <rjones@redhat.com>
* Fri Jul 08 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-8 Robert Kuska <rkuska@gmail.com>
- Finish bootstrap of the re module speed regression fix Sahana Prasad <sahana@redhat.com>
Slavek Kabrda <bkabrda@redhat.com>
* Fri Jul 08 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-7 Stephen Gallagher <sgallagh@redhat.com>
- Fix speed regression in the re module which prevented chromium from building Than Ngo <than@redhat.com>
Thomas Spura <tomspur@fedoraproject.org>
* Fri Jun 24 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b3-6 Till Maas <opensource@till.name>
- Clear and reset sqlite3 statements properly in cursor iternext (fixes rhbz#2099049) Tomáš Hrnčiar <thrnciar@redhat.com>
- Revert a problematic fix of threading._shutdown() again (fixes rhbz#2100282) Tomas Mraz <tmraz@fedoraproject.org>
Tomas Orsava <torsava@redhat.com>
* Tue Jun 21 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-5 Tomas Radej <tradej@redhat.com>
- Build Python with the optimized Blake2 library libb2 Toshio Kuratomi <toshio@fedoraproject.org>
Victor Stinner <vstinner@python.org>
* Tue Jun 21 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-4 Ville Skyttä <ville.skytta@iki.fi>
- Make C++ version of _Py_CAST work with 0/NULL Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
* Mon Jun 13 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b3-3
- Finish bootstrapping for Python 3.11 mass rebuild
* Mon Jun 13 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b3-2
- Initial bootstrap for Python 3.11 mass rebuild
* Wed Jun 01 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b3-1
- Update to 3.11.0b3
* Tue May 31 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~b2-1
- Update to 3.11.0b2
* Tue May 10 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b1-2
- Finish bootstrapping 3.11.0b1
* Sun May 08 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~b1-1
- Update to 3.11.0b1
* Wed Apr 20 2022 Tomas Orsava <torsava@redhat.com> - 3.11.0~a7-3
- Build Python 3.11 with subpackages
- `python(abi)` is still not Provided for alternative Python versions
- Drop old no-longer-needed Obsoletes of python311 and python3-tools
- Move _sysconfigdata_d_linux*.py to the debug subpackage
- Resolves: rhbz#2063227
* Thu Apr 07 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a7-2
- Finish bootstrapping 3.11.0a7
* Wed Apr 06 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a7-1
- Update to 3.11.0a7
* Tue Mar 08 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~a6-2
- Finish bootstrapping 3.11.0a6
* Mon Mar 07 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~a6-1
- Update to 3.11.0a6
* Fri Feb 04 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a5-1
- Update to 3.11.0a5
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.11.0~a4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Jan 17 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a4-1
- Update to 3.11.0a4
* Sat Jan 08 2022 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~a3-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34
* Mon Dec 13 2021 Miro Hrončok <mhroncok@redhat.com> - 3.11.0~a3-2
- Supplement tox
* Fri Dec 10 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a3-1
- Update to 3.11.0a3
* Mon Nov 15 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a2-1
- Update to 3.11.0a2
- Patch 251 was updated to include specific install scheme for virtualenv
* Fri Nov 12 2021 Björn Esser <besser82@fedoraproject.org> - 3.11.0~a1-2
- Rebuild(libnsl2)
* Wed Oct 06 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a1-1
- Initial Python 3.11 package forked from Python 3.10