Skip to contentSkip to conversation

kbuild: rpm-pkg: add libelf-devel as alternative for BuildRequires

PATCH In review Masahiro Yamada 4 participants 4 messages Dec 28, 2022 – Dec 29, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 8818039f959b ("kbuild: add ability to make source rpm buildable using koji"). The relevant package name in openSUSE is libelf-devel.

Add it 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.

Fixes 8818039f959b ("kbuild: add ability to make source rpm buildable using koji")

---

 scripts/package/mkspec | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/package/mkspec +2 -1
index dda00a948a01..adab28fa7f89 100755
@@ -51,7 +51,8 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
 	URL: https://www.kernel.org
 $S	Source: kernel-$__KERNELRELEASE.tar.gz
 	Provides: $PROVIDES
-$S	BuildRequires: bc binutils bison dwarves elfutils-libelf-devel flex
+$S	BuildRequires: bc binutils bison dwarves
+$S	BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
 $S	BuildRequires: gcc make openssl openssl-devel perl python3 rsync
 
 	# $UTS_MACHINE as a fallback of _arch in case
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 lines · Masahiro Yamada

Guoqing Jiang reports that openSUSE cannot compile the kernel rpm due to "BuildRequires: elfutils-libelf-devel" added by commit 8818039f959b ("kbuild: add ability to make source rpm buildable using koji"). The relevant package name in openSUSE is libelf-devel.

Add it 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.

Quoted 4 lines
Fixes 8818039f959b ("kbuild: add ability to make source rpm buildable using koji")
Quoted 22 lines

---

 scripts/package/mkspec | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/package/mkspec +2 -1
index dda00a948a01..adab28fa7f89 100755
@@ -51,7 +51,8 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
 	URL: https://www.kernel.org
 $S	Source: kernel-$__KERNELRELEASE.tar.gz
 	Provides: $PROVIDES
-$S	BuildRequires: bc binutils bison dwarves elfutils-libelf-devel flex
+$S	BuildRequires: bc binutils bison dwarves
+$S	BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
 $S	BuildRequires: gcc make openssl openssl-devel perl python3 rsync
 
 	# $UTS_MACHINE as a fallback of _arch in case
Signature · 1 line
2.34.1
Tested-by on v1 1/1
#2 lore raw
In reply to Masahiro Yamada
Quoted 42 lines · Masahiro Yamada

Guoqing Jiang reports that openSUSE cannot compile the kernel rpm due to "BuildRequires: elfutils-libelf-devel" added by commit 8818039f959b ("kbuild: add ability to make source rpm buildable using koji"). The relevant package name in openSUSE is libelf-devel.

Add it 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.

Fixes 8818039f959b ("kbuild: add ability to make source rpm buildable using koji")

---

  scripts/package/mkspec | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
scripts/package/mkspec +0 -0
index dda00a948a01..adab28fa7f89 100755

scripts/package/mkspec sed -e '/^DEL/d' -e 's/^\t*//' <<EOF · line 58

Quoted 9 lines
scripts/package/mkspec +2 -1
@@ -51,7 +51,8 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
  	URL: https://www.kernel.org
  $S	Source: kernel-$__KERNELRELEASE.tar.gz
  	Provides: $PROVIDES
-$S	BuildRequires: bc binutils bison dwarves elfutils-libelf-devel flex
+$S	BuildRequires: bc binutils bison dwarves
+$S	BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
  $S	BuildRequires: gcc make openssl openssl-devel perl python3 rsync
 
  	# $UTS_MACHINE as a fallback of _arch in case

Thanks for the quick fix! I verified the above works for openSUSE leap 15.4.

Thanks,
Guoqing

Acked-by on v1 1/1
#3 lore raw
In reply to Masahiro Yamada
Quoted 28 lines · Masahiro Yamada

Guoqing Jiang reports that openSUSE cannot compile the kernel rpm due to "BuildRequires: elfutils-libelf-devel" added by commit 8818039f959b ("kbuild: add ability to make source rpm buildable using koji"). The relevant package name in openSUSE is libelf-devel.

Add it 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.

Quoted 4 lines
Fixes 8818039f959b ("kbuild: add ability to make source rpm buildable using koji")