linux-old/scripts/mkspec
<<
>>
Prefs
   1#!/bin/sh
   2#
   3#       Output a simple RPM spec file that uses no fancy features requring
   4#       RPM v4. This is intended to work with any RPM distro.
   5#
   6#       The only gothic bit here is redefining install_post to avoid 
   7#       stripping the symbols from files in the kernel which we want
   8#
   9#       Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net>
  10#
  11# That's the voodoo to see if it's a x86.
  12ISX86=`arch | grep -ie i.86`
  13if [ ! -z $ISX86 ]; then
  14        PC=1
  15else
  16        PC=0
  17fi
  18# starting to output the spec
  19if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then
  20        PROVIDES=kernel-drm
  21fi
  22
  23PROVIDES="$PROVIDES kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
  24
  25echo "Name: kernel"
  26echo "Summary: The Linux Kernel"
  27echo "Version: "$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION | sed -e "s/-//g"
  28# we need to determine the NEXT version number so that uname and
  29# rpm -q will agree
  30echo "Release: `. scripts/mkversion`"
  31echo "License: GPL"
  32echo "Group: System Environment/Kernel"
  33echo "Vendor: The Linux Community"
  34echo "URL: http://www.kernel.org"
  35echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL"
  36echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//g"
  37echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root"
  38echo "Provides: $PROVIDES"
  39echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
  40echo ""
  41echo "%description"
  42echo "The Linux Kernel, the operating system core itself"
  43echo ""
  44echo "%prep"
  45echo "%setup -q"
  46echo ""
  47echo "%build"
  48# This is the first 'disagreement' between x86 and other archs.
  49if [ $PC = 1 ]; then 
  50        echo "make oldconfig dep clean bzImage modules"
  51else
  52        echo "make oldconfig dep clean vmlinux modules"
  53fi
  54# Back on track
  55echo ""
  56echo "%install"
  57echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
  58echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make modules_install'
  59# And that's the second
  60if [ $PC = 1 ]; then
  61        echo 'cp arch/i386/boot/bzImage $RPM_BUILD_ROOT'"/boot/vmlinuz-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
  62else
  63        echo 'cp vmlinux $RPM_BUILD_ROOT'"/boot/vmlinux-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
  64fi
  65# Back on track, again
  66echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
  67echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
  68echo ""
  69echo "%clean"
  70echo '#echo -rf $RPM_BUILD_ROOT'
  71echo ""
  72echo "%files"
  73echo '%defattr (-, root, root)'
  74echo "%dir /lib/modules"
  75echo "/lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
  76echo "/boot/*"
  77echo ""
  78
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.