From 4ca9d478d4497c16c8eef4a84b355994aa8aa1d7 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 15 Apr 2024 16:43:44 +0200 Subject: [PATCH] spec: sanlock 3.7 with version >fc27 and >rh7.4 Decode minor version for rhel. --- spec/macros.inc | 5 +++++ spec/source.inc | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/macros.inc b/spec/macros.inc index 4d8f77bdb..cd776a168 100644 --- a/spec/macros.inc +++ b/spec/macros.inc @@ -82,6 +82,11 @@ fi \ : \ %%{nil} +# Resolve RHEL minor version from redhat-release +%define rhel_minor_version %(rhel_version_file="/etc/redhat-release"; +if [ -f $rhel_version_file ]; then cat $rhel_version_file | +cut -f2 -d. | cut -f1 -d' '; else echo 0; fi) + ############################################################# # # Disable event_activation when creating packages for system diff --git a/spec/source.inc b/spec/source.inc index c24ff82ad..dd6c17588 100644 --- a/spec/source.inc +++ b/spec/source.inc @@ -60,11 +60,14 @@ %global enable_editline 0 %endif -%if %{fedora} >= 24 || %{rhel} >= 7 +%if %{fedora} >= 27 || %{rhel} >= 7 %service lvmlockd 1 +# For RH7 require 7.4 for sanlock + %if %{rhel} != 7 || 0%{?rhel_minor_version} > 4 + %global enable_lvmlockd_sanlock 1 + %endif %global sanlock_version 3.7.0-1 %global enable_lvmlockd_dlm 1 - %global enable_lvmlockd_sanlock 1 # FIXME: Check these conditions against RHEL builds! %if %{rhel} %ifnarch i686 x86_64 s390x