#!/bin/sh # Heavily based on the Slackware 11.0 SlackBuild # http://www.gnu.org/software/grub # packager: mauro.sacchetto@alice.it # Added BootSplash Patch By Andrea Sciucca.gohanz at infinito .it # Required for Reiser4 Support: Libaal; Reiser4prog CWD=`pwd` if ["$TMP" = ""]; then TMP=/tmp fi PKG=$TMP/package-grub NAME=grub VERSION=0.97 TARGET=i486 SNAME=grubconfig SVERSION=1.26 ARCH=${ARCH:-i486} BUILD=4ms if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O3 -march=i686 -pipe -fomit-frame-pointer" elif [ "$ARCH" = "athlon64" ]; then SLKCFLAGS="-O2 -march=athlon64 -pipe" elif [ "$ARCH" = "athlonxp" ]; then SLKCFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi echo "+---------------------------------+" echo "| Start SlackBuild $NAME-$VERSION |" echo "+---------------------------------+" cd $TMP tar xzvf $CWD/grub-0.97-reiser4-20050808.tar.gz cd $NAME-$VERSION # Add BootSplash Support cat $CWD/grub-0.97-graphics.patch | patch -p1 -E --verbose find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; autoconf aclocal automake CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --mandir=/usr/man \ --infodir=/usr/info \ --disable-debug \ --program-prefix="" \ --program-suffix="" \ $TARGET-slackware-linux make make install DESTDIR=$PKG mkdir -p $PKG/boot/grub cp $CWD/*.xpm.gz $PKG/boot/grub cp $CWD/menu.lst.sample $PKG/boot/grub ( cd $PKG/boot/grub ln -s menu.lst grub.conf ) mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS BUGS ChangeLog COPYING INSTALL MAINTENANCE NEWS README THANKS TODO \ $PKG/usr/doc/$NAME-$VERSION ( 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 ) gzip -9 $PKG/usr/man/*/* rm -f $PKG/usr/info/dir gzip -9 $PKG/usr/info/* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Add Kent's grubconfig tool: cd $TMP tar xzf $CWD/$SNAME-$SVERSION.tar.gz cd $SNAME-$SVERSION chmod 644 README mkdir -p $PKG/usr/doc/$SNAME-$SVERSION cp -a README $PKG/usr/doc/$SNAME-$SVERSION chmod 755 grubconfig cp -a grubconfig $PKG/usr/sbin/grubconfig cd $PKG chown -R root:root . requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$NAME-$VERSION rm -rf $TMP/$SNAME-$SVERSION rm -rf $PKG fi