From 6073e4f0062e4076028a803e3427a942009c0714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 30 May 2023 18:19:42 +0200 Subject: [PATCH] --without rpmwheels: Declare bundled() provides and a complex License tag --- python3.12.spec | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/python3.12.spec b/python3.12.spec index f94d213..65af7b7 100644 --- a/python3.12.spec +++ b/python3.12.spec @@ -74,6 +74,57 @@ License: Python-2.0.1 %global pip_version 23.1.2 %global setuptools_version 67.6.1 %global wheel_version 0.40.0 +# All of those also include a list of indirect bundled libs: +# pip +# $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) +%global pip_bundled_provides %{expand: +Provides: bundled(python3dist(cachecontrol)) = 0.12.11 +Provides: bundled(python3dist(certifi)) = 2022.12.7 +Provides: bundled(python3dist(chardet)) = 5.1 +Provides: bundled(python3dist(colorama)) = 0.4.6 +Provides: bundled(python3dist(distlib)) = 0.3.6 +Provides: bundled(python3dist(distro)) = 1.8 +Provides: bundled(python3dist(idna)) = 3.4 +Provides: bundled(python3dist(msgpack)) = 1.0.5 +Provides: bundled(python3dist(packaging)) = 21.3 +Provides: bundled(python3dist(platformdirs)) = 3.2 +Provides: bundled(python3dist(pygments)) = 2.14 +Provides: bundled(python3dist(pyparsing)) = 3.0.9 +Provides: bundled(python3dist(pyproject-hooks)) = 1 +Provides: bundled(python3dist(requests)) = 2.28.2 +Provides: bundled(python3dist(resolvelib)) = 1.0.1 +Provides: bundled(python3dist(rich)) = 13.3.3 +Provides: bundled(python3dist(setuptools)) = 67.7.2 +Provides: bundled(python3dist(six)) = 1.16 +Provides: bundled(python3dist(tenacity)) = 8.2.2 +Provides: bundled(python3dist(tomli)) = 2.0.1 +Provides: bundled(python3dist(typing-extensions)) = 4.5 +Provides: bundled(python3dist(urllib3)) = 1.26.15 +Provides: bundled(python3dist(webencodings)) = 0.5.1 +} +# setuptools +# vendor.txt files not in .whl +# $ %%{_rpmconfigdir}/pythonbundles.py \ +# <(curl -L https://github.com/pypa/setuptools/raw/v%%{setuptools_version}/setuptools/_vendor/vendored.txt) \ +# <(curl -L https://github.com/pypa/setuptools/raw/v%%{setuptools_version}/pkg_resources/_vendor/vendored.txt) +%global setuptools_bundled_provides %{expand: +Provides: bundled(python3dist(importlib-metadata)) = 6 +Provides: bundled(python3dist(importlib-resources)) = 5.10.2 +Provides: bundled(python3dist(jaraco-text)) = 3.7 +Provides: bundled(python3dist(more-itertools)) = 8.8 +Provides: bundled(python3dist(ordered-set)) = 3.1.1 +Provides: bundled(python3dist(packaging)) = 23 +Provides: bundled(python3dist(platformdirs)) = 2.6.2 +Provides: bundled(python3dist(tomli)) = 2.0.1 +Provides: bundled(python3dist(typing-extensions)) = 4.0.1 +Provides: bundled(python3dist(typing-extensions)) = 4.4 +Provides: bundled(python3dist(zipp)) = 3.7 +} +# wheel +# $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheel-*.whl wheel/vendored/vendor.txt) +%global wheel_bundled_provides %{expand: +Provides: bundled(python3dist(packaging)) = 23 +} # Expensive optimizations (mainly, profile-guided optimizations) %bcond_without optimizations @@ -445,6 +496,9 @@ Summary: Python runtime libraries Requires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2 %else Provides: bundled(python3dist(pip)) = %{pip_version} +%pip_bundled_provides +# License manually combined form Python + pip +License: Python-2.0.1 AND MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) %endif %unversioned_obsoletes_of_python3_X_if_main libs @@ -568,7 +622,11 @@ Requires: %{python_wheel_pkg_prefix}-setuptools-wheel Requires: %{python_wheel_pkg_prefix}-wheel-wheel %else Provides: bundled(python3dist(setuptools)) = %{setuptools_version} +%setuptools_bundled_provides Provides: bundled(python3dist(wheel)) = %{wheel_version} +%wheel_bundled_provides +# License manually combined from Python + setuptools + wheel +License: Python-2.0.1 AND MIT AND Apache-2.0 AND (Apache-2.0 OR BSD-2-Clause) %endif %unversioned_obsoletes_of_python3_X_if_main test @@ -623,6 +681,14 @@ The debug runtime additionally supports debug builds of C-API extensions %gpgverify -k2 -s1 -d0 %autosetup -S git_am -n Python-%{upstream_version} +# Verify the second level of bundled provides is up to date +# Arguably this should be done in %%check, but %%prep has a faster feedback loop +# setuptools.whl does not contain the vendored.txt files +if [ -f %{_rpmconfigdir}/pythonbundles.py ]; then + %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) --compare-with '%pip_bundled_provides' + %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheel-*.whl wheel/vendored/vendor.txt) --compare-with '%wheel_bundled_provides' +fi + %if %{with rpmwheels} rm Lib/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl rm Lib/test/setuptools-%{setuptools_version}-py3-none-any.whl @@ -1597,6 +1663,7 @@ CheckPython optimized %changelog * Mon May 29 2023 Miro Hrončok - 3.12.0~b1-2 - Use wheels from RPMs, at least on Fedora 39+ +- On older Fedora releases, declare bundled() provides and a complex License tag * Tue May 23 2023 Tomáš Hrnčiar - 3.12.0~b1-1 - Update to 3.12.0b1