From 6ee731ba1a78221d9e08ce55e8317e02c04b03c3 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 19 Apr 2024 20:45:15 +0200 Subject: [PATCH] spec: define rhel_version_file for rhel only Do not define rhel_minor_version on non-rhel systems. --- spec/macros.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/macros.inc b/spec/macros.inc index cd776a168..6be100f6d 100644 --- a/spec/macros.inc +++ b/spec/macros.inc @@ -83,9 +83,11 @@ fi \ %%{nil} # Resolve RHEL minor version from redhat-release +%if 0%{?rhel} > 0 %define rhel_minor_version %(rhel_version_file="/etc/redhat-release"; -if [ -f $rhel_version_file ]; then cat $rhel_version_file | +if [ -f "$rhel_version_file" ]; then cat "$rhel_version_file" | cut -f2 -d. | cut -f1 -d' '; else echo 0; fi) +%endif ############################################################# #