linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Makefile 'rpm' target on Red Hat (8.0/9)
@ 2003-07-20 19:40 Oliver Pitzeier
  2003-07-20 19:58 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Pitzeier @ 2003-07-20 19:40 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

Hi folks!

Since Red Hat moved options like '-ta', '-ba' (all the _build_ targets) away from the command 'rpm' to 'rpmbuild', the 'rpm' target is 'broken' (this is true for - at least - 2.4.19 'til 2.4.21-pre5). This is of course not a really big bug, but it also can be easily solved, by simply changing 'rpm -ta' to 'rpmbuild -ta'.

I'm not sure about other distributions like SuSE, Mandrake...

If 'rpmbuild' doesn't work on other rpm-based distributions (like the two above) I would recommend checking for /etc/redhat-release... Patch for Makefile (from kver 2.4.21-pre5) attached.

Best regards,
 Oliver

[-- Attachment #2: Makefile.patch --]
[-- Type: application/octet-stream, Size: 1079 bytes --]

--- Makefile.old        2003-07-20 21:14:59.000000000 +0200
+++ Makefile    2003-07-20 21:36:47.000000000 +0200
@@ -13,6 +13,9 @@
          else echo sh; fi ; fi)
 TOPDIR := $(shell /bin/pwd)

+RPM := $(shell if [ -f /etc/redhat-release ]; then echo rpmbuild; \
+         else echo rpm; fi)
+
 HPATH          = $(TOPDIR)/include
 FINDHPATH      = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu

@@ -43,7 +46,8 @@

 export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
        CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
-       CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL
+       CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL \
+       RPM

 all:   do-it-all

@@ -570,5 +574,5 @@
        rm $(KERNELPATH) ; \
        cd $(TOPDIR) ; \
        . scripts/mkversion > .version ; \
-       rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+       $(RPM) -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
        rm $(TOPDIR)/../$(KERNELPATH).tar.gz

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Makefile 'rpm' target on Red Hat (8.0/9)
  2003-07-20 19:40 [PATCH] Makefile 'rpm' target on Red Hat (8.0/9) Oliver Pitzeier
@ 2003-07-20 19:58 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2003-07-20 19:58 UTC (permalink / raw)
  To: Oliver Pitzeier; +Cc: linux-kernel

On Sun, Jul 20, 2003 at 09:40:23PM +0200, Oliver Pitzeier wrote:
> If 'rpmbuild' doesn't work on other rpm-based distributions (like the two above) I would recommend checking for /etc/redhat-release... Patch for Makefile (from kver 2.4.21-pre5) attached.

That looks horrible.

In 2.6-test1 the following code is used:
RPM             := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
                        else echo rpm; fi)

I would suggest to do it this way, avoiding a distro specific check.
Also there is no reason to export the RPM variable

	Sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-20 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-20 19:40 [PATCH] Makefile 'rpm' target on Red Hat (8.0/9) Oliver Pitzeier
2003-07-20 19:58 ` Sam Ravnborg

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).