From 4ce1a695cf72d3bc6e24496257788f35a88ae4ea Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 27 Oct 2021 09:42:49 +0200 Subject: [PATCH] Add -f, -t, -e options to %%py_check_import macros The options were introduced to python-rpm-macros in Fedora. Adding them to EPEL prevents failures when processing Fedora specfiles. The actual functionality was not backported to EPEL. When used, the options emit warning. --- epel-rpm-macros.spec | 5 ++++- macros.epel-rpm-macros | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index fdf354a..ac377e0 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 8 -Release: 25 +Release: 26 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -72,6 +72,9 @@ install -Dpm 644 %{SOURCE150} \ %changelog +* Wed Oct 27 2021 Karolina Surma - 8-26 +- Add -t, -f, -e options to %%py_check_import which emit warning when used + * Tue Oct 26 2021 Tomas Orsava - 8-25 - Define a new macros %%python_wheel_dir and %%python_wheel_pkg_prefix diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 6c08775..58ef1ac 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -86,7 +86,10 @@ # try to import the given Python module(s). # Useful as a smoke test in %%check when running tests is not feasible. # Use spaces or commas as separators. -%py_check_import() %{expand:\\\ +%py_check_import(e:tf:) %{expand:\\\ + %{-e:echo 'WARNING: The -e option of %%%%py_check_import is not currently supported on EPEL.' >&2} + %{-t:echo 'WARNING: The -t option of %%%%py_check_import is not currently supported on EPEL.' >&2} + %{-f:echo 'WARNING: The -f option of %%%%py_check_import is not currently supported on EPEL.' >&2} (cd %{_topdir} &&\\\ PATH="%{buildroot}%{_bindir}:$PATH"\\\ PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python_sitearch}:%{buildroot}%{python_sitelib}}"\\\ @@ -94,7 +97,10 @@ %{__python} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" ) } -%py2_check_import() %{expand:\\\ +%py2_check_import(e:tf:) %{expand:\\\ + %{-e:echo 'WARNING: The -e option of %%%%py2_check_import is not currently supported on EPEL.' >&2} + %{-t:echo 'WARNING: The -t option of %%%%py2_check_import is not currently supported on EPEL.' >&2} + %{-f:echo 'WARNING: The -f option of %%%%py2_check_import is not currently supported on EPEL.' >&2} (cd %{_topdir} &&\\\ PATH="%{buildroot}%{_bindir}:$PATH"\\\ PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python2_sitearch}:%{buildroot}%{python2_sitelib}}"\\\ @@ -102,7 +108,10 @@ %{__python2} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}" ) } -%py3_check_import() %{expand:\\\ +%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}}"\\\