From bb3291006275c174bac50f4f57bcef0c14f586a2 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Jun 07 2023 23:21:04 +0000 Subject: Move %py3_check_import def to macros.zzz-epel-override Relates: https://bugzilla.redhat.com/2207631 --- diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 5757d66..6bd950b 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 39 +Release: 40 Summary: Extra Packages for Enterprise Linux RPM macros License: GPLv2 @@ -126,6 +126,10 @@ install -Dpm 644 %{SOURCE152} \ %changelog +* Wed Jun 07 2023 Maxwell G - 8-40 +- Move %%py3_check_import definition to macros.zzz-epel-override. +- Relates: #2207631 + * Fri Apr 07 2023 Miro HronĨok - 8-39 - Prepare support for Python 3.11 diff --git a/macros.zzz-epel-override b/macros.zzz-epel-override index b8c5d96..9a7f9bf 100644 --- a/macros.zzz-epel-override +++ b/macros.zzz-epel-override @@ -25,3 +25,21 @@ else end print(bin) } + +# Only python3.11-rpm-macros in RHEL 8 has %%py3_check_import defined, +# but the definition is broken (https://bugzilla.redhat.com/2207631). +# Once this issue is resolved, we can move this definition back to macros.epel +# so the python3.11-rpm-macros version overrides this definition but it remains +# available for older Python versions. + +%py3_check_import(e:tf:) %{expand:\\\ + %{-e:echo 'WARNING: The -e option of %%%%py3_check_import is not currently supported on EPEL.' >&2} + %{-t:echo 'WARNING: The -t option of %%%%py3_check_import is not currently supported on EPEL.' >&2} + %{-f:echo 'WARNING: The -f option of %%%%py3_check_import is not currently supported on EPEL.' >&2} + (cd %{_topdir} &&\\\ + PATH="%{buildroot}%{_bindir}:$PATH"\\\ + PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\ + PYTHONDONTWRITEBYTECODE=1\\\ + %{__python3} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" + ) +}