From 0c94eb96a6c76489effd8339f46818c5b231ed2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Mon, 9 Oct 2023 17:03:03 +0200 Subject: [PATCH] Convert from Fedora for the Python 3.12 stack in RHEL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Miro Hrončok Co-Authored-By: Charalampos Stratakis --- python3.12-wheel.spec | 283 ++++++++---------------------------------- 1 file changed, 49 insertions(+), 234 deletions(-) diff --git a/python3.12-wheel.spec b/python3.12-wheel.spec index 09ebe9f..99a6ec9 100644 --- a/python3.12-wheel.spec +++ b/python3.12-wheel.spec @@ -1,24 +1,30 @@ -# The function of bootstrap is that it disables the wheel subpackage -%bcond bootstrap 0 +%global __python3 /usr/bin/python3.12 +%global python3_pkgversion 3.12 + +# The function of bootstrap is that it installs the wheel by unzipping it +%bcond_without bootstrap # Default: when bootstrapping -> disable tests -%bcond tests %{without bootstrap} +%if %{with bootstrap} +%bcond_with tests +%else +%bcond_without tests +%endif # Similar to what we have in pythonX.Y.spec files. # If enabled, provides unversioned executables and other stuff. # Disable it if you build this package in an alternative stack. -%bcond main_python 1 +%bcond_with main_python %global pypi_name wheel %global python_wheel_name %{pypi_name}-%{version}-py3-none-any.whl -Name: python-%{pypi_name} +Name: python%{python3_pkgversion}-%{pypi_name} Version: 0.41.2 Release: 1%{?dist} -Epoch: 1 Summary: Built-package format for Python -# packaging is Apache-2.0 OR BSD-2-Clause -License: MIT AND (Apache-2.0 OR BSD-2-Clause) +# packaging is ASL 2.0 or BSD +License: MIT and (ASL 2.0 or BSD) URL: https://github.com/pypa/wheel Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz # This is used in bootstrap mode where we manually install the wheel and @@ -27,14 +33,17 @@ Source1: wheel-entrypoint BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-rpm-macros # python3 bootstrap: this is rebuilt before the final build of python3, which # adds the dependency on python3-rpm-generators, so we require it manually BuildRequires: python3-rpm-generators # Needed to manually build and unpack the wheel -%if %{with bootstrap} BuildRequires: python%{python3_pkgversion}-flit-core +%if %{with bootstrap} BuildRequires: unzip +%else +BuildRequires: python%{python3_pkgversion}-pip %endif %if %{with tests} @@ -45,6 +54,15 @@ BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: gcc %endif +# Virtual provides for the packages bundled by wheel. +# Actual version can be found in git history: +# https://github.com/pypa/wheel/commits/master/src/wheel/vendored/packaging/tags.py +%global bundled %{expand: +Provides: bundled(python%{python3_version}dist(packaging)) = 23 +} + +%{bundled} + %global _description %{expand: Wheel is the reference implementation of the Python wheel packaging standard, as defined in PEP 427. @@ -57,21 +75,6 @@ It has two different roles: %description %{_description} -# Virtual provides for the packages bundled by wheel. -# Actual version can be found in git history: -# https://github.com/pypa/wheel/commits/master/src/wheel/vendored/packaging/tags.py -%global bundled %{expand: -Provides: bundled(python3dist(packaging)) = 23 -} - - -%package -n python%{python3_pkgversion}-%{pypi_name} -Summary: %{summary} -%{bundled} - -%description -n python%{python3_pkgversion}-%{pypi_name} %{_description} - - %package -n %{python_wheel_pkg_prefix}-%{pypi_name}-wheel Summary: The Python wheel module packaged as a wheel %{bundled} @@ -84,19 +87,8 @@ A Python wheel of wheel to use with virtualenv. %autosetup -n %{pypi_name}-%{version} -p1 -%if %{without bootstrap} -%generate_buildrequires -%pyproject_buildrequires -%endif - - %build -%if %{with bootstrap} -%global _pyproject_wheeldir dist -%python3 -m flit_core.wheel -%else -%pyproject_wheel -%endif +%{python3} -m flit_core.wheel %install @@ -104,12 +96,14 @@ A Python wheel of wheel to use with virtualenv. # create the entrypoints manually. %if %{with bootstrap} mkdir -p %{buildroot}%{python3_sitelib} -unzip %{_pyproject_wheeldir}/%{python_wheel_name} \ +unzip dist/%{python_wheel_name} \ -d %{buildroot}%{python3_sitelib} -x wheel-%{version}.dist-info/RECORD install -Dpm 0755 %{SOURCE1} %{buildroot}%{_bindir}/wheel %py3_shebang_fix %{buildroot}%{_bindir}/wheel %else -%pyproject_install +%py3_install_wheel %{python_wheel_name} +# for consistency with %%pyproject_install: +rm %{buildroot}%{python3_sitelib}/wheel-*.dist-info/RECORD %endif mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python3_version}} @@ -119,7 +113,7 @@ ln -s %{pypi_name}-3 %{buildroot}%{_bindir}/%{pypi_name} %endif mkdir -p %{buildroot}%{python_wheel_dir} -install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir} +install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir} %check @@ -148,199 +142,20 @@ install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_w %{python_wheel_dir}/%{python_wheel_name} %changelog -* Tue Aug 15 2023 Tomáš Hrnčiar - 1:0.41.2-1 -- Update to 0.41.2 -- Fixes: rhbz#2224712 -- Fixes: rhbz#2233485 - -* Fri Jul 21 2023 Fedora Release Engineering - 1:0.40.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Fri Jun 16 2023 Python Maint - 1:0.40.0-3 -- Rebuilt for Python 3.12 - -* Tue Jun 13 2023 Python Maint - 1:0.40.0-2 -- Bootstrap for Python 3.12 - -* Tue Mar 14 2023 Maxwell G - 1:0.40.0-1 -- Update to 0.40.0. Fixes rhbz#2178246. - -* Fri Jan 20 2023 Fedora Release Engineering - 1:0.38.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Wed Dec 07 2022 Lumír Balhar - 1:0.38.4-1 -- Update to 0.38.4 (rhbz#2136627) - -* Fri Jul 22 2022 Fedora Release Engineering - 1:0.37.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Mon Jun 13 2022 Python Maint - 1:0.37.1-3 -- Rebuilt for Python 3.11 - -* Mon Jun 13 2022 Python Maint - 1:0.37.1-2 -- Bootstrap for Python 3.11 - -* Wed Mar 09 2022 Tomas Orsava - 1:0.37.1-1 -- Update to 0.37.1 -- Fixes: rhbz#2034895 - -* Fri Jan 21 2022 Fedora Release Engineering - 1:0.37.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Tue Aug 17 2021 Karolina Surma - 1:0.37.0-1 -- Update to 0.37.0 -- Fixes: rhbz#1991740 - -* Tue Jul 27 2021 Fedora Release Engineering - 1:0.36.2-5 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Wed Jun 02 2021 Python Maint - 1:0.36.2-4 -- Rebuilt for Python 3.10 - -* Tue Jun 01 2021 Python Maint - 1:0.36.2-3 -- Bootstrap for Python 3.10 - -* Wed Jan 27 2021 Fedora Release Engineering - 1:0.36.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Mon Jan 04 2021 Miro Hrončok - 1:0.36.2-1 -- Update to 0.36.2 -- Fixes: rhbz#1907227 -- Fixes: rhbz#1899553 - -* Thu Sep 10 2020 Tomas Hrnciar - 1:0.35.1-1 -- Update to 0.35.1 -- Fixes: rhbz#1868821 - -* Mon Aug 10 2020 Miro Hrončok - 1:0.34.2-1 -- Update to 0.34.2 -- Drops Python 3.4 support -- Fixes: rhbz#1795134 - -* Wed Jul 29 2020 Fedora Release Engineering - 1:0.33.6-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Fri May 22 2020 Miro Hrončok - 1:0.33.6-5 -- Rebuilt for Python 3.9 - -* Thu May 21 2020 Miro Hrončok - 1:0.33.6-4 -- Bootstrap for Python 3.9 - -* Thu Jan 30 2020 Fedora Release Engineering - 1:0.33.6-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Mon Sep 09 2019 Miro Hrončok - 1:0.33.6-2 -- Drop python2-wheel - -* Tue Aug 27 2019 Miro Hrončok - 1:0.33.6-1 -- Update to 0.33.6 (#1708194) -- Don't add the m ABI flag to wheel names on Python 3.8 - -* Thu Aug 15 2019 Miro Hrončok - 1:0.33.1-5 -- Rebuilt for Python 3.8 - -* Wed Aug 14 2019 Miro Hrončok - 1:0.33.1-4 -- Bootstrap for Python 3.8 - -* Fri Jul 26 2019 Fedora Release Engineering - 1:0.33.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Tue Jul 16 2019 Miro Hrončok - 1:0.33.1-2 -- Make /usr/bin/wheel Python 3 - -* Mon Feb 25 2019 Charalampos Stratakis - 1:0.33.1-1 -- Update to 0.33.1 - -* Sat Feb 02 2019 Fedora Release Engineering - 1:0.32.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Sun Sep 30 2018 Miro Hrončok - 1:0.32.0-1 -- Update to 0.32.0 - -* Wed Aug 15 2018 Miro Hrončok - 1:0.31.1-3 -- Create python-wheel-wheel package with the wheel of wheel - -* Sat Jul 14 2018 Fedora Release Engineering - 1:0.31.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Sat Jul 07 2018 Igor Gnatenko - 1:0.31.1-1 -- Update to 0.31.1 - -* Mon Jun 18 2018 Miro Hrončok - 1:0.30.0-3 -- Rebuilt for Python 3.7 - -* Wed Jun 13 2018 Miro Hrončok - 1:0.30.0-2 -- Bootstrap for Python 3.7 - -* Fri Feb 23 2018 Igor Gnatenko - 1:0.30.0-1 -- Update to 0.30.0 - -* Fri Feb 09 2018 Fedora Release Engineering - 0.30.0a0-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Tue Aug 29 2017 Tomas Orsava - 0.30.0a0-8 -- Switch macros to bcond's and make Python 2 optional to facilitate building - the Python 2 and Python 3 modules - -* Thu Jul 27 2017 Fedora Release Engineering - 0.30.0a0-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Feb 11 2017 Fedora Release Engineering - 0.30.0a0-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Tue Jan 03 2017 Charalampos Stratakis - 0.30.0a0-5 -- Enable tests - -* Fri Dec 09 2016 Charalampos Stratakis - 0.30.0a0-4 -- Rebuild for Python 3.6 without tests - -* Tue Dec 06 2016 Igor Gnatenko - 0.30.0a0-3 -- Add bootstrap method - -* Mon Sep 19 2016 Charalampos Stratakis - 0.30.0a0-2 -- Use the python_provide macro - -* Mon Sep 19 2016 Charalampos Stratakis - 0.30.0a0-1 -- Update to 0.30.0a0 -- Added patch to remove keyrings.alt dependency - -* Wed Aug 10 2016 Igor Gnatenko - 0.29.0-1 -- Update to 0.29.0 -- Cleanups and fixes - -* Tue Jul 19 2016 Fedora Release Engineering - 0.26.0-3 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - -* Thu Feb 04 2016 Fedora Release Engineering - 0.26.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Tue Oct 13 2015 Robert Kuska - 0.26.0-1 -- Update to 0.26.0 -- Rebuilt for Python3.5 rebuild - -* Thu Jun 18 2015 Fedora Release Engineering - 0.24.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Tue Jan 13 2015 Slavek Kabrda - 0.24.0-3 -- Make spec buildable in EPEL 6, too. -- Remove additional sources added to upstream tarball. - -* Sat Jan 03 2015 Matej Cepl - 0.24.0-2 -- Make python3 conditional (switched off for RHEL-7; fixes #1131111). - -* Mon Nov 10 2014 Slavek Kabrda - 0.24.0-1 -- Update to 0.24.0 -- Remove patches merged upstream - -* Sun Jun 08 2014 Fedora Release Engineering - 0.22.0-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Fri Apr 25 2014 Matej Stuchlik - 0.22.0-3 -- Another rebuild with python 3.4 - -* Fri Apr 18 2014 Matej Stuchlik - 0.22.0-2 -- Rebuild with python 3.4 - -* Thu Nov 28 2013 Bohuslav Kabrda - 0.22.0-1 +* Mon Oct 09 2023 Tomáš Hrnčiar - 0.41.2-1 - Initial package. +- Fedora contributions by: + Charalampos Stratakis + Dennis Gilmore + Haikel Guemar + Igor Gnatenko + Karolina Surma + Lumir Balhar + Matej Stuchlik + Maxwell G + Miro Hrončok + Robert Kuska + Slavek Kabrda + Tomáš Hrnčiar + Tomas Orsava +