kbuild: rpm-pkg: use a dummy string for _arch when undefined

If this affects only %{buildroot}, it should be enough to use a fixed
string for _arch when it is undefined.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
Masahiro Yamada 2023-07-22 13:47:58 +09:00
parent d5d2d4cc60
commit d4f651277e

View File

@ -36,6 +36,8 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
%define ARCH ${ARCH} %define ARCH ${ARCH}
%define KERNELRELEASE ${KERNELRELEASE} %define KERNELRELEASE ${KERNELRELEASE}
# _arch is undefined if /usr/lib/rpm/platform/*/macros was not included.
%{!?_arch: %define _arch dummy}
%{!?make: %define make make} %{!?make: %define make make}
%define makeflags %{?_smp_mflags} ARCH=%{ARCH} %define makeflags %{?_smp_mflags} ARCH=%{ARCH}
@ -55,9 +57,6 @@ $S BuildRequires: bc binutils bison dwarves
$S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex $S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
$S BuildRequires: gcc make openssl openssl-devel perl python3 rsync $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync
# $UTS_MACHINE as a fallback of _arch in case
# /usr/lib/rpm/platform/*/macros was not included.
%{!?_arch: %define _arch $UTS_MACHINE}
%define __spec_install_post /usr/lib/rpm/brp-compress || : %define __spec_install_post /usr/lib/rpm/brp-compress || :
%define debug_package %{nil} %define debug_package %{nil}