From 7a9076d0e10b7d2fe2bda9a7e7da202d5a016628 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: May 14 2022 08:44:32 +0000 Subject: Build Python 3.11 with subpackages (by disabling the flatpackage bcond) No change in not providing `python(abi)` for alternative Python versions Resolves: rhbz#2063227 --- diff --git a/python3.10.spec b/python3.10.spec index 9558721..caa1e8f 100644 --- a/python3.10.spec +++ b/python3.10.spec @@ -40,13 +40,10 @@ License: Python %endif # Flat package, i.e. no separate subpackages -# Default (in Fedora): if this is a main Python, it is not a flatpackage +# Default (in Fedora): don't use the flatpackage structure for Python 3.11 and +# higher, remove the bcond from the spec in the future # Not supported: Combination of flatpackage enabled and main_python enabled -%if %{with main_python} %bcond_with flatpackage -%else -%bcond_without flatpackage -%endif # When bootstrapping python3, we need to build setuptools. # but setuptools BR python3-devel and that brings in python3-rpm-generators; @@ -327,6 +324,13 @@ Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-g # Descriptions, and metadata for subpackages # ========================================== +%if %{without main_python} +# We'll not provide this, on purpose +# No package in Fedora shall ever depend on a alternative Python via this +%global __requires_exclude ^python\\(abi\\) = 3\\..+ +%global __provides_exclude ^python\\(abi\\) = 3\\..+ +%endif # without main_python + # this if branch is ~300 lines long and contains subpackages' definitions %if %{without flatpackage} %if %{with main_python} @@ -371,9 +375,11 @@ Recommends: %{_bindir}/python Provides: python%{pyshortver} = %{version}-%{release} Obsoletes: python%{pyshortver} < %{version}-%{release} +%if %{with main_python} # Packages with Python modules in standard locations automatically # depend on python(abi). Provide that here. Provides: python(abi) = %{pybasever} +%endif # with main_python Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} @@ -480,7 +486,10 @@ Requires: (python3-rpm-generators if rpm-build) %endif Provides: %{pkgname}-2to3 = %{version}-%{release} + +%if %{with main_python} Provides: 2to3 = %{version}-%{release} +%endif Conflicts: %{pkgname} < %{version}-%{release} @@ -498,8 +507,10 @@ Summary: A basic graphical development environment for Python Requires: %{pkgname} = %{version}-%{release} Requires: %{pkgname}-tkinter = %{version}-%{release} +%if %{with main_python} Provides: idle3 = %{version}-%{release} Provides: idle = %{version}-%{release} +%endif Provides: %{pkgname}-tools = %{version}-%{release} Provides: %{pkgname}-tools%{?_isa} = %{version}-%{release} @@ -577,11 +588,6 @@ The debug runtime additionally supports debug builds of C-API extensions %else # with flatpackage -# We'll not provide this, on purpose -# No package in Fedora shall ever depend on flatpackage via this -%global __requires_exclude ^python\\(abi\\) = 3\\..+ -%global __provides_exclude ^python\\(abi\\) = 3\\..+ - # Python interpreter packages used to be named (or provide) name pythonXY (e.g. # python39). However, to align it with the executable names and to prepare for # Python 3.10, they were renamed to pythonX.Y (e.g. python3.9, python3.10). We