OSDN Git Service

kbuild: rpm-pkg: define _arch conditionally
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 22 Jul 2023 04:47:48 +0000 (13:47 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 24 Jul 2023 15:59:32 +0000 (00:59 +0900)
Commit 3089b2be0cce ("kbuild: rpm-pkg: fix build error when _arch is
undefined") does not work as intended; _arch is always defined as
$UTS_MACHINE.

The intention was to define _arch to $UTS_MACHINE only when it is not
defined.

Fixes: 3089b2be0cce ("kbuild: rpm-pkg: fix build error when _arch is undefined")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/package/mkspec

index 8049f0e..c9299f9 100755 (executable)
@@ -57,7 +57,7 @@ $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.
-       %define _arch %{?_arch:$UTS_MACHINE}
+       %{!?_arch: %define _arch $UTS_MACHINE}
        %define __spec_install_post /usr/lib/rpm/brp-compress || :
        %define debug_package %{nil}