PATCH; tidy up make rpm

Alan Cox
2003-03-21T18:51:44Z

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/Makefile linux-2.5.65-ac2/Makefile
--- linux-2.5.65/Makefile 2003-03-18 16:46:45.000000000 +0000
+++ linux-2.5.65-ac2/Makefile 2003-03-20 18:02:29.000000000 +0000
@@ -164,6 +164,8 @@
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
AWK = awk
+RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
+ else echo rpm; fi)
GENKSYMS = scripts/genksyms/genksyms
DEPMOD = /sbin/depmod
KALLSYMS = scripts/kallsyms
@@ -768,9 +770,7 @@
rm $(KERNELPATH) ; \
cd $(TOPDIR) ; \
$(CONFIG_SHELL) $(srctree)/scripts/mkversion > .version ; \
- RPM=`which rpmbuild`; \
- if [ -z "$$RPM" ]; then RPM=rpm; fi; \
- $$RPM -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+ $(RPM) -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
rm $(TOPDIR)/../$(KERNELPATH).tar.gz

# Brief documentation of the typical targets used