[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    [PATCH] make rpm fixes
From:       Eli Carter <eli () pflash ! com>
Date:       2001-08-31 22:51:55
[Download RAW message or body]

Alan (& etc.),

I really like the 'make rpm' target.  However, I noticed a couple of bugs 
with it.
1) 'uname' and rpm -q kernel did not agree on the build number.  (uname was 1 
greater than the rpm build number.)
2) IIRC, the build number incremented by 2 for each 'make rpm'.  (If I'm 
mistaken, please overlook. ;) )
3) The symlink and tarball were left over, which also yielded a 'linux -> .' 
symlink on later builds.
4) Those of us who use CVS would rather not tar up the CVS directories.

So, here is a patch (makerpm-6.patch, attached) to address those issues.  
Also, the order of commands in the Makefile is intended to maximize the 
amount of clean up done if the build is prematurely aborted.  If the 'rpm' 
command is stopped for whatever reason, the .version will still be updated.

It is against 2.4.8-ac7 since that is what I have on hand, but I expect it to 
apply cleanly to the latest -ac.  Let me know if you need it re-diff'ed for 
2.4.9-acx.

Questions, comments, suggestions?
(Please CC me; I'm subscribed at work, but not here at home.)

Eli 
---------------.
Eli Carter      \  (This is my home account; I am subscribed at work.)
eli(a)pflash.com `-------------------------------------------------------



["makerpm-6.patch" (text/x-diff)]

--- linux.orig/Makefile	Wed Aug 29 22:06:32 2001
+++ linux/Makefile	Fri Aug 31 14:59:52 2001
@@ -308,11 +308,7 @@
 $(TOPDIR)/include/linux/compile.h: include/linux/compile.h
 
 newversion:
-	@if [ ! -f .version ]; then \
-		echo 1 > .version; \
-	else \
-		expr 0`cat .version` + 1 > .version; \
-	fi
+	. scripts/mkversion > .version
 
 include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
 	@echo -n \#define UTS_VERSION \"\#`cat .version` > .ver
@@ -525,20 +521,23 @@
 #	If you do a make spec before packing the tarball you can rpm -ta it
 #
 spec:
-	[ -e .version ] || echo 1 > .version
 	. scripts/mkspec >kernel.spec
 
 #
-#	Build a tar ball , generate an rpm from it and pack the result
+#	Build a tar ball, generate an rpm from it and pack the result
 #	There arw two bits of magic here
 #	1) The use of /. to avoid tar packing just the symlink
 #	2) Removing the .dep files as they have source paths in them that
 #	   will become invalid
 #
-rpm:	clean newversion spec
+rpm:	clean spec
 	find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
 	set -e; \
 	cd $(TOPDIR)/.. ; \
 	ln -sf $(TOPDIR) $(KERNELPATH) ; \
-	tar cvfz $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
-	rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz
+	tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
+	rm $(KERNELPATH) ; \
+	cd $(TOPDIR) ; \
+	. scripts/mkversion > .version ; \
+	rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+	rm $(TOPDIR)/../$(KERNELPATH).tar.gz
diff -uN linux.orig/scripts/mkspec linux/scripts/mkspec
--- linux.orig/scripts/mkspec	Sun Aug 19 22:58:29 2001
+++ linux/scripts/mkspec	Thu Aug 30 21:52:19 2001
@@ -9,8 +9,9 @@
 echo "Name: kernel"
 echo "Summary: The Linux Kernel"
 echo "Version: "$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION | sed -e "s/-//"
-echo -n "Release: "
-cat .version
+# we need to determine the NEXT version number so that uname and
+# rpm -q will agree
+echo "Release: `. scripts/mkversion`"
 echo "License: GPL"
 echo "Group: System Environment/Kernel"
 echo "Vendor: The Linux Community"
diff -uN linux.orig/scripts/mkversion linux/scripts/mkversion
--- linux.orig/scripts/mkversion	Wed Dec 31 18:00:00 1969
+++ linux/scripts/mkversion	Wed Aug 29 20:34:55 2001
@@ -0,0 +1,6 @@
+if [ ! -f .version ]
+then
+    echo 1
+else
+    expr 0`cat .version` + 1
+fi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic