From 09a2e790693cdcaefa8707096bb3367eb30db47b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 3 Mar 2018 15:11:33 -0800 Subject: [PATCH] scst.spec, scst-dkms.spec: Use version of running kernel if %{kdir} has not been set --- scst-dkms.spec.in | 12 +----------- scst.spec.in | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/scst-dkms.spec.in b/scst-dkms.spec.in index 0230e30ab..e8d89372e 100644 --- a/scst-dkms.spec.in +++ b/scst-dkms.spec.in @@ -2,18 +2,8 @@ # kversion: Kernel version as it appears under /lib/modules. # The algorithm for setting the variable kversion is as follows: # - If the variable kversion has been set, use its value. -# - If an RPM with the name kernel-headers exists (RHEL / CentOS), use the -# version number of the kernel that package is based on. This provides the -# version number when building on a koji build server. # - Otherwise use the version number of the running kernel. -%{!?kversion:%define kversion %{expand:%%( - if rpm --quiet -q kernel-headers; then - rpm -q --qf '%%%%{version}-%%%%{release}.%%%%{arch}\\n' \\ - kernel-headers | head -n1; - else - uname -r; - fi - )}} +%{!?kversion:%define kversion %{expand:%%(uname -r)}} %{echo:kversion=%{kversion} } # kernel_rpm: Name of the kernel RPM if the kernel is available as an RPM. diff --git a/scst.spec.in b/scst.spec.in index 19b2cc624..4aec82b90 100644 --- a/scst.spec.in +++ b/scst.spec.in @@ -3,22 +3,12 @@ # The algorithm for setting the variable kversion is as follows: # - If the variable kversion has been set, use its value. # - If the variable kdir has been set, derive the kernel version from kdir. -# - If an RPM with the name kernel-headers exists (RHEL / CentOS), use the -# version number of the kernel that package is based on. This provides the -# version number when building on a koji build server. # - Otherwise use the version number of the running kernel. %{!?kversion: %{?kdir:%define kversion %{expand:%%( make -sC "%{kdir}" kernelversion | grep -v ^make)}} %{!?kdir: - %define kversion %{expand:%%( - if rpm --quiet -q kernel-headers; then - rpm -q --qf '%%%%{BUILDTIME} %%%%{version}-%%%%{release}.%%%%{arch}\\n' \\ - kernel-headers | sort | tail -n1 | { read a b; echo $b; }; - else - uname -r; - fi - )}}} + %define kversion %{expand:%%(uname -r)}}} %{echo:kversion=%{kversion} } # kernel_rpm: Name of the kernel RPM if the kernel is available as an RPM.