* [PATCH] scripts/package/Makefile: rpmbuild is needed for rpm targets
[not found] <CA+r1ZhiyQbakrxr4saPE_mFjwjGG4aJxLHm3oCvqD=4=ByBA_w@mail.gmail.com>
@ 2015-06-08 20:19 ` Jim Davis
2015-06-15 14:12 ` Michal Marek
0 siblings, 1 reply; 2+ messages in thread
From: Jim Davis @ 2015-06-08 20:19 UTC (permalink / raw)
To: mmarek, linux-kbuild, linux-kernel; +Cc: Jim Davis
Before rpm release 4.1, in 2002, either the rpm command or the
rpmbuild command could be used in the rpm-pkg or binrpm-pkg targets,
and the Makefile chose the rpm command if the rpmbuild command wasn't
found.
After release 4.1, however, the rpm command could no longer be used in
place of the rpmbuild command. As the rpmbuild command is not
installed by default, this can lead to failures with the rpm-pkg and
binrpm-pkg targets:
rpm --define "_builddir ." --target \
x86_64 -bb ./binkernel.spec
rpm --target: unknown option
scripts/package/Makefile:60: recipe for target 'binrpm-pkg' failed
Change the Makefile to use rpmbuild unconditionally to avoid this.
Signed-off-by: Jim Davis <jim.epost@gmail.com>
---
scripts/package/Makefile | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 99ca6e7..8b11d5a 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -21,10 +21,6 @@
# Note that the rpm-pkg target cannot be used with KBUILD_OUTPUT,
# but the binrpm-pkg target can; for some reason O= gets ignored.
-# Do we have rpmbuild, otherwise fall back to the older rpm
-RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
- else echo rpm; fi)
-
# Remove hyphens since they have special meaning in RPM filenames
KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
# Include only those top-level files that are needed by make, plus the GPL copy
@@ -51,7 +47,7 @@ rpm-pkg rpm: FORCE
rm -f $(objtree)/.scmversion
$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
mv -f $(objtree)/.tmp_version $(objtree)/.version
- $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz
+ rpmbuild --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz
rm $(KERNELPATH).tar.gz kernel.spec
# binrpm-pkg
@@ -62,7 +58,7 @@ binrpm-pkg: FORCE
$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
mv -f $(objtree)/.tmp_version $(objtree)/.version
- $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \
+ rpmbuild --define "_builddir $(objtree)" --target \
$(UTS_MACHINE) -bb $(objtree)/binkernel.spec
rm binkernel.spec
--
2.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scripts/package/Makefile: rpmbuild is needed for rpm targets
2015-06-08 20:19 ` [PATCH] scripts/package/Makefile: rpmbuild is needed for rpm targets Jim Davis
@ 2015-06-15 14:12 ` Michal Marek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2015-06-15 14:12 UTC (permalink / raw)
To: Jim Davis, linux-kbuild, linux-kernel
On 2015-06-08 22:19, Jim Davis wrote:
> Before rpm release 4.1, in 2002, either the rpm command or the
> rpmbuild command could be used in the rpm-pkg or binrpm-pkg targets,
> and the Makefile chose the rpm command if the rpmbuild command wasn't
> found.
>
> After release 4.1, however, the rpm command could no longer be used in
> place of the rpmbuild command. As the rpmbuild command is not
> installed by default, this can lead to failures with the rpm-pkg and
> binrpm-pkg targets:
>
> rpm --define "_builddir ." --target \
> x86_64 -bb ./binkernel.spec
> rpm --target: unknown option
> scripts/package/Makefile:60: recipe for target 'binrpm-pkg' failed
>
> Change the Makefile to use rpmbuild unconditionally to avoid this.
>
> Signed-off-by: Jim Davis <jim.epost@gmail.com>
I agree that compatibility with rpm < 4.1 is not an issue nowadays and
"rpmbuild: command not found" is a lot more informative error message. I
applied the patch to kbuild.git#misc.
thanks,
Michal
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-15 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CA+r1ZhiyQbakrxr4saPE_mFjwjGG4aJxLHm3oCvqD=4=ByBA_w@mail.gmail.com>
2015-06-08 20:19 ` [PATCH] scripts/package/Makefile: rpmbuild is needed for rpm targets Jim Davis
2015-06-15 14:12 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).