aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package/Makefile
diff options
context:
space:
mode:
authorJim Davis <jim.epost@gmail.com>2015-06-08 16:19:08 -0400
committerMichal Marek <mmarek@suse.cz>2015-06-15 10:08:05 -0400
commit21a59991ce0cd9a0b54b135305e3fcf880f2aaf1 (patch)
treef7e408c7e94ff90197f5deb4c20d315db5bd0de4 /scripts/package/Makefile
parenta37161c0588c0d3ff4afb08ef83106a80bde604e (diff)
scripts/package/Makefile: rpmbuild is needed for rpm targets
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> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/package/Makefile')
-rw-r--r--scripts/package/Makefile8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 99ca6e76eb0a..8b11d5adec7f 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -21,10 +21,6 @@
21# Note that the rpm-pkg target cannot be used with KBUILD_OUTPUT, 21# Note that the rpm-pkg target cannot be used with KBUILD_OUTPUT,
22# but the binrpm-pkg target can; for some reason O= gets ignored. 22# but the binrpm-pkg target can; for some reason O= gets ignored.
23 23
24# Do we have rpmbuild, otherwise fall back to the older rpm
25RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
26 else echo rpm; fi)
27
28# Remove hyphens since they have special meaning in RPM filenames 24# Remove hyphens since they have special meaning in RPM filenames
29KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE)) 25KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
30# Include only those top-level files that are needed by make, plus the GPL copy 26# Include only those top-level files that are needed by make, plus the GPL copy
@@ -51,7 +47,7 @@ rpm-pkg rpm: FORCE
51 rm -f $(objtree)/.scmversion 47 rm -f $(objtree)/.scmversion
52 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version 48 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
53 mv -f $(objtree)/.tmp_version $(objtree)/.version 49 mv -f $(objtree)/.tmp_version $(objtree)/.version
54 $(RPM) $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz 50 rpmbuild --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz
55 rm $(KERNELPATH).tar.gz kernel.spec 51 rm $(KERNELPATH).tar.gz kernel.spec
56 52
57# binrpm-pkg 53# binrpm-pkg
@@ -62,7 +58,7 @@ binrpm-pkg: FORCE
62 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version 58 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
63 mv -f $(objtree)/.tmp_version $(objtree)/.version 59 mv -f $(objtree)/.tmp_version $(objtree)/.version
64 60
65 $(RPM) $(RPMOPTS) --define "_builddir $(objtree)" --target \ 61 rpmbuild --define "_builddir $(objtree)" --target \
66 $(UTS_MACHINE) -bb $(objtree)/binkernel.spec 62 $(UTS_MACHINE) -bb $(objtree)/binkernel.spec
67 rm binkernel.spec 63 rm binkernel.spec
68 64