IGNOREPATH=/etc:/home:/var:/dev:/boot:/root:/tmp:/usr/local:/bin:/sbin:/tmp:/mnt:/usr/src
STRIPLIB=n
STRIPBIN=n

VERSION=2.4.22
PROGNAME="Linux kernel $VERSION source"
DESC="\
kernel-source (Linux kernel source)                                    \n\
                                                                       \n\
Source code for Linus Torvalds' Linux kernel.                          \n\
                                                                       \n\
This is the complete source code for the Linux kernel, along with      \n\
IBM's patches for S/390 and zSeries."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=ftp://ftp.us.kernel.org/pub/linux/kernel/v2.4
PKGNAME=kernel-default-$VERSION-s390-$BUILD
TAG=REC

compile() {
   echo Nothing for the compile step
}

install() {
   mkdir -p usr/src/
   cd usr/src/
if true  ;then
   tar -xyf $CWD/../../k/linux-$VERSION.tar.bz2

   chown -R root.root linux-$VERSION

   ( cd linux-$VERSION
echo ----- linux-$VERSION.diff.gz
     zcat $CWD/../../k/kernel/linux-$VERSION.diff.gz | patch -p1 --backup --suffix=.orig
   )
fi
   ### setup source tree
   ( cd linux-$VERSION
     make mrproper
     cp $CWD/../../k/kernel/s390.default.$VERSION.config .config
     yes "
" |  make oldconfig
     make dep
     make clean
     make image

   mkdir -p /package-kernel-default/boot
   cp -p arch/s390/boot/image /package-kernel-default/boot/image-$VERSION
   cp -p System.map /package-kernel-default/boot/System.map-$VERSION
   cp -p $CWD/../../k/kernel/s390.default.$VERSION.config /package-kernel-default/boot/config-$VERSION
   )

   ( cd /package-kernel-default/boot
     rm -f System.map  ; ln -s System.map-$VERSION System.map
     rm -f image       ; ln -s image-$VERSION image
     rm -f config      ; ln -s config-$VERSION config
   )
}

special() {
   cd $PKG
   mv package-kernel-default/* ./
   rmdir package-kernel-default

   cd $CTL
   cat $CWD/slack-desc.s390 > slack-desc

   sed -e 's%package-kernel-default/%%g' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

