lkml.org 
[lkml]   [2001]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPatch to scripts/mkspec
Hey,

I've changed my patch a bit.

+ tarball is called: kernel-2.4.8-ac7.tar.gz
package: kernel-2.4.8_ac7-15.i386.rpm
kernel image: kernel-2.4.8-ac7-15
kernel itself: kernel-2.4.8-ac7

(I rather have the kernel named kernel-2.4.8-ac7-15 too so modules
don't conflict if you've got several builds from the same tree)

+ seperate documentation package
(I rather put this in a seperate spec-file and add a make doc-rpm)

+ .config is added to the package

+ use of macros (which is allowed since rpm v3 I think)
Alan, I know you disapprove this, but I'm not sure it matters
Documentation of RPM is bad though.

+ package now is eg. i686 if kernel is built for i686


Advantages:

+ you can install kernels that only differ in release-nr (except for modules)
+ packages build on the same tree (for different machines) have a unique
name (otherwise it is a sysadmin hell)


Todo:

+ make it not i386-specific (as we use bzImage, right ?)
+ if the kernel is SMP, the package should say so
+ add the .version in the Makefile to KERNELRELEASE (so that the tarball
and modules-dir have a unique name for each build)
+ build the DocBook-stuff for the documentation (although you need more
dependencies, so moving it to a seperate spec-file makes sense)
+ add builddependencies (although this could be a distro-nightmare)


Could you give me feedback (as I didn't get a reply on my previous mail).

Thanks in advance,

-- dag wieers, dag@wieers.com, http://dag.wieers.com/ --
«Onder voorbehoud van hetgeen niet uitdrukkelijk wordt erkend»
--- linux/Makefile.orig Sat Aug 18 17:09:23 2001
+++ linux/Makefile Sat Aug 18 18:24:39 2001
@@ -5,8 +5,6 @@

KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)

-KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//")
-
# SUBARCH tells the usermode build what the underlying arch is. That is set
# first, and if a usermode build is happening, the "ARCH=um" on the command
# line overrides the setting of ARCH below. If a native build is happening,
@@ -539,6 +537,7 @@
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
+ ln -sf $(TOPDIR) kernel-$(KERNELRELEASE) ; \
+ tar cfz kernel-$(KERNELRELEASE).tar.gz kernel-$(KERNELRELEASE)/.
+ set -e; \
+ rpm -tb $(TOPDIR)/../kernel-$(KERNELRELEASE).tar.gz
--- linux/scripts/mkspec.orig Sat Aug 18 17:09:18 2001
+++ linux/scripts/mkspec Sun Aug 19 08:21:15 2001
@@ -6,41 +6,62 @@
# The only gothic bit here is redefining install_post to avoid
# stripping the symbols from files in the kernel which we want
#
+# TODO:
+# + Add -smp to packagename if SMP
+# + Make it non i386-specific
+#
+echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
+echo -n "%define arch "
+echo $CFLAGS | sed "s/^.*[:space:]\?-march=\(.*\)[:space:]\?.*$/\1/"
+echo
echo "Name: kernel"
echo "Summary: The Linux Kernel"
-echo "Version: "$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION | sed -e "s/-//"
+echo "Version: "$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION | sed -e "s/-/_/"
echo -n "Release: "
cat .version
echo "License: GPL"
echo "Group: System Environment/Kernel"
echo "Vendor: The Linux Community"
-echo "URL: http://www.kernel.org"
-echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL"
-echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//"
-echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root"
-echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
-echo ""
+echo "URL: http://www.kernel.org/"
+echo "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION.tar.gz"
+echo "BuildRoot: %{_tmppath}/%{name}-%{version}"
+echo "BuildArch: %{arch}"
+echo "Requires: binutils"
+echo
echo "%description"
echo "The Linux Kernel, the operating system core itself"
-echo ""
+echo
+echo "%package doc"
+echo "Summary: The Linux Kernel documentation"
+echo "Group: Documentation"
+echo "BuildArch: noarch"
+echo
+echo "%description doc"
+echo "The Linux Kernel documentation."
+echo
echo "%prep"
-echo "%setup -q"
-echo ""
+echo "%setup -q -n kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
+echo
echo "%build"
echo "make oldconfig dep clean bzImage modules"
-echo ""
+echo
echo "%install"
-echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
-echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make modules_install'
-echo 'cp arch/i386/boot/bzImage $RPM_BUILD_ROOT'"/boot/vmlinuz-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
-echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
-echo ""
+echo "rm -rf %{buildroot}"
+echo "mkdir -p %{buildroot}/boot %{buildroot}/lib/modules"
+echo "INSTALL_MOD_PATH=%{buildroot} make modules_install"
+echo "cp arch/$ARCH/boot/bzImage %{buildroot}/boot/kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION-%{release}"
+echo "cp System.map %{buildroot}/boot/System.map-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION-%{release}"
+echo "cp .config %{buildroot}/boot/config-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION-%{release}"
+echo
echo "%clean"
-echo '#echo -rf $RPM_BUILD_ROOT'
-echo ""
+echo "rm -rf %{buildroot}"
+echo
echo "%files"
-echo '%defattr (-, root, root)'
+echo "%defattr (-, root, root)"
+echo "%doc COPYING CREDITS MAINTAINERS README REPORTING-BUGS"
echo "%dir /lib/modules"
echo "/lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
echo "/boot/*"
-echo ""
+echo
+echo "%files doc"
+echo "%doc Documentation/*/*/*"
\
 
 \ /
  Last update: 2005-03-22 12:57    [W:0.386 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site