Skip to content

Commit 02a893b

Browse files
committed
kbuild: rpm-pkg: add libelf-devel as alternative for BuildRequires
Guoqing Jiang reports that openSUSE cannot compile the kernel rpm due to "BuildRequires: elfutils-libelf-devel" added by commit 8818039 ("kbuild: add ability to make source rpm buildable using koji"). The relevant package name in openSUSE is libelf-devel. Add it as an alternative package. BTW, if it is impossible to solve the build requirement, the final resort would be: $ make RPMOPTS=--nodeps rpm-pkg This passes --nodeps to the rpmbuild command so it will not verify build dependencies. This is useful to test rpm builds on non-rpm system. On Debian/Ubuntu, for example, you can install rpmbuild by 'apt-get install rpm'. NOTE1: Likewise, it is possible to bypass the build dependency check for debian package builds: $ make DPKG_FLAGS=-d deb-pkg NOTE2: The 'or' operator is supported since RPM 4.13. So, old distros such as CentOS 7 will break. I suggest installing newer rpmbuild in such cases. Link: https://lore.kernel.org/linux-kbuild/ee227d24-9c94-bfa3-166a-4ee6b5dfea09@linux.dev/T/#u Fixes: 8818039 ("kbuild: add ability to make source rpm buildable using koji") Reported-by: Guoqing Jiang <guoqing.jiang@linux.dev> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Guoqing Jiang <guoqing.jiang@linux.dev> Acked-by: Jonathan Toppins <jtoppins@redhat.com>
1 parent 63ffe00 commit 02a893b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/package/mkspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
5151
URL: https://www.kernel.org
5252
$S Source: kernel-$__KERNELRELEASE.tar.gz
5353
Provides: $PROVIDES
54-
$S BuildRequires: bc binutils bison dwarves elfutils-libelf-devel flex
54+
$S BuildRequires: bc binutils bison dwarves
55+
$S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
5556
$S BuildRequires: gcc make openssl openssl-devel perl python3 rsync
5657
5758
# $UTS_MACHINE as a fallback of _arch in case

0 commit comments

Comments
 (0)