From 1a404c23b34945b13d04334ee7b057f277821cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 7 Feb 2023 13:58:43 +0100 Subject: [PATCH] CI: Adjust spec conditionals for F35 EOL Also, use %elif instead of a nested %if. Related: rhbz#2168193 --- tests/double-install.spec | 16 ++++++++-------- tests/python-ldap.spec | 15 +++++---------- tests/python-userpath.spec | 2 +- tests/tldr.spec | 10 +++++----- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/tests/double-install.spec b/tests/double-install.spec index 1db103f..a065774 100644 --- a/tests/double-install.spec +++ b/tests/double-install.spec @@ -46,20 +46,20 @@ cd .. %check # Internal check for the value of %%{pyproject_build_lib} -%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10 -cd markupsafe-%{markupsafe_version} -%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10 -test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/markupsafe-%{markupsafe_version}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}" +%if 0%{?rhel} == 9 +for dir in . markupsafe-%{markupsafe_version} tldr-%{tldr_version}; do + (cd $dir && test "%{pyproject_build_lib}" == "$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib.%{python3_platform}-%{python3_version}):$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib)") +done %else +cd markupsafe-%{markupsafe_version} +%if 0%{?fedora} == 36 test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/markupsafe-%{markupsafe_version}/build/lib.%{python3_platform}-%{python3_version}" +%else +test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/markupsafe-%{markupsafe_version}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}" %endif cd ../tldr-%{tldr_version} test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/tldr-%{tldr_version}/build/lib" cd .. -%else -for dir in . markupsafe-%{markupsafe_version} tldr-%{tldr_version}; do - (cd $dir && test "%{pyproject_build_lib}" == "$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib.%{python3_platform}-%{python3_version}):$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib)") -done %endif diff --git a/tests/python-ldap.spec b/tests/python-ldap.spec index db8274a..9f6da1e 100644 --- a/tests/python-ldap.spec +++ b/tests/python-ldap.spec @@ -40,12 +40,9 @@ Summary: %{summary} %prep %autosetup - -%if 0%{?fedora} >= 36 || 0%{?rhel} >= 9 # Hack: We remove tests that are broken by OpenLDAP 2.5+ # Don't do this in the regular Fedora package, please rm Tests/t_ldapobject.py Tests/t_cext.py Tests/t_edit.py Tests/t_ldap_sasl.py Tests/t_ldap_syncrepl.py Tests/t_slapdobject.py Tests/t_bind.py Tests/t_ldap_options.py Tests/t_ldap_schema_subentry.py -%endif %generate_buildrequires @@ -97,14 +94,12 @@ grep -E '/site-packages/__pycache__$' %{pyproject_files} && exit 1 || true grep -E '/site-packages/__pycache__/$' %{pyproject_files} && exit 1 || true # Internal check for the value of %%{pyproject_build_lib} in an archful package -%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10 -%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10 -test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}" -%else -test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version}" -%endif -%else +%if 0%{?rhel} == 9 test "%{pyproject_build_lib}" == "$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib.%{python3_platform}-%{python3_version})" +%elif 0%{?fedora} == 36 +test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version}" +%else +test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}" %endif diff --git a/tests/python-userpath.spec b/tests/python-userpath.spec index b26c8fd..69ca8ab 100644 --- a/tests/python-userpath.spec +++ b/tests/python-userpath.spec @@ -49,7 +49,7 @@ sed -Ei '/^(coverage)$/d' requirements-dev.txt %check %pytest -%if 0%{?fedora} > 35 || 0%{?rhel} > 9 +%if 0%{?fedora} || 0%{?rhel} > 9 # Internal check that license file was recognized correctly with hatchling 1.9.0+ grep '^%%license' %{pyproject_files} > tested.license echo '%%license %{python3_sitelib}/userpath-%{version}.dist-info/licenses/LICENSE.txt' > expected.license diff --git a/tests/tldr.spec b/tests/tldr.spec index 3788821..6b24d5d 100644 --- a/tests/tldr.spec +++ b/tests/tldr.spec @@ -11,7 +11,7 @@ BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros -%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10 +%if 0%{?rhel} != 9 # Internal check for our macros: test that we can install to a custom prefix BuildRequires: python3-rpm-macros >= 3.10-18 %global _prefix /app @@ -49,13 +49,13 @@ head -n1 %{buildroot}%{_bindir}/%{name}.py | grep -E '#!\s*%{python3}\s+%{py3_sh test ! -e %{buildroot}%{python3_sitelib}/*.dist-info/direct_url.json # Internal check for the value of %%{pyproject_build_lib} in a noarch package -%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10 -test "%{pyproject_build_lib}" == "${PWD}/build/lib" -%else +%if 0%{?rhel} == 9 test "%{pyproject_build_lib}" == "$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib)" +%else +test "%{pyproject_build_lib}" == "${PWD}/build/lib" %endif -%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10 +%if 0%{?rhel} != 9 # Internal check for custom prefix grep '^/usr' %{pyproject_files} && exit 1 || true grep '^/app' %{pyproject_files}