From b9849c5d129e08b419b86f44af060bcc88501c15 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 14 May 2021 16:05:43 +0200 Subject: [PATCH] Add virtual provides for the bundled libmpdec Related: rhbz#1950291 --- python3.9.spec | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/python3.9.spec b/python3.9.spec index b6d0a3e..ee10e06 100644 --- a/python3.9.spec +++ b/python3.9.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 4%{?dist} +Release: 5%{?dist} License: Python @@ -178,6 +178,12 @@ License: Python # foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc %global bytecode_suffixes .cpython-%{pyshortver}*.pyc +# libmpdec (mpdecimal package) is not availble in RHEL so we keep +# the bundled version. +# The version information can be found at Modules/_decimal/libmpdec/mpdecimal.h +# defined as MPD_VERSION. +%global libmpdec_version 2.5.0 + # Python's configure script defines SOVERSION, and this is used in the Makefile # to determine INSTSONAME, the name of the libpython DSO: # LDLIBRARY='libpython$(VERSION).so' @@ -509,6 +515,10 @@ Provides: bundled(python3dist(pip)) = %{pip_version} Provides: bundled(python3dist(setuptools)) = %{setuptools_version} %endif +# Provides for the bundled libmpdec +Provides: bundled(mpdecimal) = %{libmpdec_version} +Provides: bundled(libmpdec) = %{libmpdec_version} + # There are files in the standard library that have python shebang. # We've filtered the automatic requirement out so libs are installable without # the main package. This however makes it pulled in by default. @@ -705,6 +715,10 @@ Provides: bundled(python3dist(pip)) = %{pip_version} Provides: bundled(python3dist(setuptools)) = %{setuptools_version} %endif +# Provides for the bundled libmpdec +Provides: bundled(mpdecimal) = %{libmpdec_version} +Provides: bundled(libmpdec) = %{libmpdec_version} + # The zoneinfo module needs tzdata Requires: tzdata @@ -1188,6 +1202,11 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do esac done +# Verify that the bundled libmpdec version python was compiled with, is the same version we have virtual +# provides for in the SPEC. +test "$($(pwd)/build/optimized/python -c 'import decimal; print(decimal.__libmpdec_version__)')" = \ + "%{libmpdec_version}" + # ====================================================== # Running the upstream test suite @@ -1753,6 +1772,9 @@ CheckPython optimized # ====================================================== %changelog +* Wed Jun 09 2021 Charalampos Stratakis - 3.9.5-5 +- Add virtual provides for the bundled libmpdec + * Thu Jun 03 2021 Charalampos Stratakis - 3.9.5-4 - Stop Recommending setuptools and move the pip Recommendation to python3-devel Resolves: rhbz#1947857