2002-12-17 10:29:35

by peter

[permalink] [raw]
Subject: [PATCH] fix for RPM build target under newer versions

--- /usr/src/linux-2.4.19/Makefile 2002-12-15 19:04:20.000000000 -0500
+++ /home/pete/Makefile.new 2002-12-17 04:36:49.000000000 -0500
@@ -567,5 +567,16 @@
rm $(KERNELPATH) ; \
cd $(TOPDIR) ; \
. scripts/mkversion > .version ; \
- rpmbuild -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+
+# RedHat split the RPM build process into a separate
+# utility called "rpmbuild", leading to a broken
+# "make rpm" target in the kernel Makefile;
+# this patch fixes that.
+
+ if [ `rpm --version | cut -b 12-15 | tr -d .` -ge '41' ] ;
+ then
+ rpmbuild -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+ else
+ rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+ fi ; \
rm $(TOPDIR)/../$(KERNELPATH).tar.gz


Attachments:
Makefile.patch (697.00 B)

Subject: Re: [PATCH] fix for RPM build target under newer versions

peter <[email protected]> writes:

>--- /usr/src/linux-2.4.19/Makefile 2002-12-15 19:04:20.000000000 -0500
>+++ /home/pete/Makefile.new 2002-12-17 04:36:49.000000000 -0500
>@@ -567,5 +567,16 @@
> rm $(KERNELPATH) ; \
> cd $(TOPDIR) ; \
> . scripts/mkversion > .version ; \
>- rpmbuild -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
>+
>+# RedHat split the RPM build process into a separate
>+# utility called "rpmbuild", leading to a broken
>+# "make rpm" target in the kernel Makefile;
>+# this patch fixes that.
>+
>+ if [ `rpm --version | cut -b 12-15 | tr -d .` -ge '41' ] ;
>+ then
>+ rpmbuild -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
>+ else
>+ rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
>+ fi ; \

Ugh. How about

--- cut ---
RPM=`which rpmbuild`
if [ -z "$RPM" ]; then
RPM=rpm
fi
$RPM -ta $(TOPDIR)/../$(KERNELPATH).tar.gz
--- cut ---

Looks less fragile. On RH 7.3 (and RH 6.x with upgrades) you also have
a rpmbuild binary (but rpm still does building, this got deprecated
and later removed on 8.0).

Regards
Henning

--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH [email protected]

Am Schwabachgrund 22 Fon.: 09131 / 50654-0 [email protected]
D-91054 Buckenhof Fax.: 09131 / 50654-20