[packages/rpm-build-macros] - remove memoization from kernel related macros, this will allow us to build multiple packages for
baggins
baggins at pld-linux.org
Sun Oct 20 21:53:44 CEST 2013
commit 5d21b4adcdd0a871ca543f4999c8d53348ee9cc8
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sun Oct 20 21:51:42 2013 +0200
- remove memoization from kernel related macros, this will allow us to
build multiple packages for different kernels in one rpmbuild pass
rpm.macros | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/rpm.macros b/rpm.macros
index 35b09a8..f02cb32 100644
--- a/rpm.macros
+++ b/rpm.macros
@@ -429,8 +429,8 @@ CXXFLAGS="%{rpmcxxflags}" \
%__kernel_qf() %(R=$(cd %{_kernelsrcdir} 2>/dev/null && LC_ALL=C rpm -q --qf '%*' -f include/linux/version.h 2>/dev/null | grep -v 'is not'); echo ${R:-ERROR})
# kernel %{name} and kernel %{epoch}:%{version}-%{release} macro respecing alt_kernel
-%kernel_name %{expand:%%global kernel_name %(N=%{__kernel_qf %{N}};echo ${N%%-headers})}%kernel_name
-%kernel_version %{expand:%%global kernel_version %{__kernel_qf %|E?{%{E}:}|%{V}-%{R}}}%kernel_version
+%kernel_name %(N=%{__kernel_qf %{N}}; echo ${N%%-headers})
+%kernel_version %{__kernel_qf %|E?{%{E}:}|%{V}-%{R}}
# -n drm to generate kernel%{_alt_kernel}-drm dependency
%releq_kernel(n:) %{kernel_name}%{?-n:-%{-n*}} = %{kernel_version}
@@ -443,19 +443,19 @@ CXXFLAGS="%{rpmcxxflags}" \
%requires_releq_kernel_smp(s:n:) Requires%{-s:(%{-s*})}: %releq_kernel_smp
# kernel version-release handling
-%__kernel_ver %{expand:%%global __kernel_ver %( \\
+%__kernel_ver %( \\
Z=$([ -f '%{_kernelsrcdir}/include/generated/utsrelease.h' ] && awk -F'"' '/UTS_RELEASE/{print $2}' %{_kernelsrcdir}/include/{linux/version,generated/utsrelease}.h 2>/dev/null || awk -F'"' '/UTS_RELEASE/{print $2}' %{_kernelsrcdir}/include/linux/{version,utsrelease}.h 2>/dev/null); \\
Z=${Z:-$(awk -F' = ' '/^VERSION/{v=$2} /^PATCHLEVEL/{p=$2} /^SUBLEVEL/{s=$2} /^EXTRAVERSION/{e=$2} END {printf("%d.%d.%d%s", v, p, s, e)}' %{_kernelsrcdir}/Makefile 2>/dev/null)}; \\
echo ${Z:-ERROR}; \\
-)}%__kernel_ver
+)
-%__kernel_rel %{expand:%%global __kernel_rel %{__kernel_qf %{R}}}%__kernel_rel
-%__kernel_rpmvr %{expand:%%global __kernel_rpmvr %{__kernel_qf %{V}-%{R}}}%__kernel_rpmvr
-%_kernel_ver %{expand:%%global _kernel_ver %{__kernel_ver}%{?with_dist_kernel:%(echo %{__kernel_ver} | grep -q -e - || echo -%{__kernel_rel})}}%_kernel_ver
-%_kernel_ver_str %{expand:%%global _kernel_ver_str %(echo %{!?_without_dist_kernel:%{__kernel_rpmvr}}%{?_without_dist_kernel:%{__kernel_ver}} | sed -e 's/-/_/g')}%_kernel_ver_str
+%__kernel_rel %{__kernel_qf %{R}}
+%__kernel_rpmvr %{__kernel_qf %{V}-%{R}}
+%_kernel_ver %{__kernel_ver}%{?with_dist_kernel:%(echo %{__kernel_ver} | grep -q -e - || echo -%{__kernel_rel})}
+%_kernel_ver_str %(echo %{!?_without_dist_kernel:%{__kernel_rpmvr}}%{?_without_dist_kernel:%{__kernel_ver}} | sed -e 's/-/_/g')
# `uname -r` to be used in @release field
-%_kernel_vermagic %{expand:%%global _kernel_vermagic %(echo %{_kernel_ver} | sed -e 's/-/_/g')}%_kernel_vermagic
+%_kernel_vermagic %(echo %{_kernel_ver} | sed -e 's/-/_/g')
# Requires name = version-release
%requires_releq() %{!?1:ERROR}%{?2:ERROR}%{?1:%{!?2:%{expand:%%requires_eq_to -r %1 %1}}}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-macros.git/commitdiff/80efc9beedc8891a566c33a1771d534f17ea6fdf
More information about the pld-cvs-commit
mailing list