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