#!/bin/sh # # KwortBuild for linux-2.6.24.3 # http://www.bluez.org # By Manuel Naranjo # set -e NAME=linux # Get the current and temporary directories CWD=$(pwd) if [ "$TMP" = "" ]; then TMP=/tmp fi if [ ! -d $TMP ] then mkdir -p $TMP fi PKG=$TMP/package-$NAME # Some useful variables about the package VERSION=${VERSION:-2.6.24.4} ARCH=${ARCH:-i486} BUILD=${BUILD:-2} PACKER=${PACKER:-aircable} CFILE=${CFILE:-config-aircable} cat $CFILE | grep CONFIG_LOCALVERSION > temp.file source temp.file rm temp.file VERSTRING=$VERSION$CONFIG_LOCALVERSION rm -rf $PKG mkdir -p $PKG mkdir -p $TMP cd $TMP if [ ! -f $CWD/${NAME}-${VERSION}.tar.bz2 ]; then wget -O $CWD/${NAME}-${VERSION}.tar.bz2 http://kernel.org/pub/linux/kernel/v2.6/${NAME}-${VERSION}.tar.bz2 fi if [ ! -d $NAME-$VERSION ]; then bunzip2 -c -d $CWD/${NAME}-${VERSION}.tar.bz2 | tar x || exit 1 cp $CWD/*.patch $NAME-$VERSION/ fi cd $NAME-$VERSION cp $CWD/$CFILE .config for i in $(ls *.patch); do patch -p1 < $i done make oldconfig make mkdir $PKG/boot mkdir $PKG/lib INSTALL_MOD_PATH=$PKG make modules_install INSTALL_PATH=$PKG/boot make install cp .config $PKG/boot/config for i in $(ls $PKG/boot); do mv $PKG/boot/$i $PKG/boot/$i-$VERSTRING done mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a \ COPYING MAINTAINERS README REPORTING-BUGS \ $CWD/$0 $PKG/usr/doc/$NAME-$VERSION # Compress and if needed symlink the man pages: if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man for manpagedir in $(find . -type d -name "man*") ; do ( cd $manpagedir for eachpage in $( find . -type l -maxdepth 1) ; do ln -s $( readlink $eachpage ).gz $eachpage.gz rm $eachpage done gzip -9 *.? ) done ) fi ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc echo "#!/bin/bash" > $PKG/install/doinst.sh echo "VERSION=$VERSTRING" >> $PKG/install/doinst.sh cat $CWD/doinst.sh >> $PKG/install/doinst.sh cd $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD$PACKER