From: Ronen Friedman Date: Thu, 1 Jan 2026 14:35:33 +0000 (+0000) Subject: scripts/build/ceph.spec.in: fix rhel version checks X-Git-Tag: testing/wip-pdonnell-testing-20260108.183402~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e042983a37c719fa021257477dc984a5acef378b;p=ceph-ci.git scripts/build/ceph.spec.in: fix rhel version checks Fixing multiple instances in this file where the RHEL version is checked - without properly ensuring that the OS is indeed RHEL. 0%{?rhel} is only defined on RHEL systems, and is '0' otherwise. That resulted, for example, in Fedora 43 having 'gts_version' incorrectly set to '13'. Signed-off-by: Ronen Friedman --- diff --git a/ceph.spec.in b/ceph.spec.in index 45435898907..9b154a72a9a 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -35,7 +35,7 @@ %bcond_with rbd_rwl_cache %endif %if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler} -%if 0%{?rhel} < 9 || 0%{?openEuler} +%if (0%{?rhel} && 0%{?rhel} < 9) || 0%{?openEuler} %bcond_with system_pmdk %else %ifarch s390x aarch64 @@ -150,7 +150,7 @@ %{!?python3_pkgversion: %global python3_pkgversion 3} %{!?python3_version_nodots: %global python3_version_nodots 3} %{!?python3_version: %global python3_version 3} -%if 0%{?rhel} < 10 +%if 0%{?rhel} && 0%{?rhel} < 10 %{!?gts_version: %global gts_version 13} %endif @@ -674,7 +674,7 @@ Requires: python%{python3_pkgversion}-cherrypy Requires: python%{python3_pkgversion}-routes %if 0%{?weak_deps} Recommends: python%{python3_pkgversion}-saml -%if 0%{?fedora} || 0%{?rhel} <= 8 +%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} <= 8) Recommends: python%{python3_pkgversion}-grpcio Recommends: python%{python3_pkgversion}-grpcio-tools %endif @@ -729,7 +729,7 @@ Requires: python%{python3_pkgversion}-PyYAML %endif # RHEL8 has python 3.6 and that lacks dataclasses in the stdlib, so pull in the # backport dataclasses module instead. -%if 0%{?rhel} <= 8 +%if 0%{?rhel} && 0%{?rhel} <= 8 Requires: python%{python3_pkgversion}-dataclasses %endif %if 0%{?weak_deps}