#!/bin/sh # Modified stock Slackware build script for grub # to support splash image PRGNAM=grub VERSION=0.97 ARCH=${ARCH:-i486} GCVER=1.28 BUILD=6a CWD=`pwd` TMP="/home/public/builds/slackware-packages/tmp" PKG=$TMP/package-$PRGNAM OUTPUT=$CWD if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf $PRGNAM-$VERSION tar xzvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1 cd $PRGNAM-$VERSION # This is needed for the optional (but now default) increase in # inode size from 128 to 256 bytes with ext2 and ext3: zcat $CWD/grub_support_256byte_inode.patch.gz | patch -p1 --verbose || exit 1 # Add splashimage support to stage2: zcat $CWD/01-cvs-sync.diff.gz | patch -p1 --verbose || exit 1 zcat $CWD/02-splashimage.diff.gz | patch -p1 --verbose || exit 1 zcat $CWD/03-xpmjunk.diff.gz | patch -p1 --verbose || exit 1 # Other grub patches # zcat $CWD/04-hidden-menu-tweak.diff.gz | patch -p1 --verbose || exit 1 # zcat $CWD/05-set-root.diff.gz | patch -p1 --verbose || exit 1 # zcat $CWD/06-ntfs.diff.gz | patch -p1 --verbose || exit 1 chown -R root:root . 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 {} \; # Rebuild the config files on-the-fly. # Do this or the stage2 file will not compile correctly. # To ensure the stage2 file compiled correctly, after # compiling run 'grep splash stage2' and verify # something is returned from the search. If the result # is empty then the compile failed. # ------------------------------------------------------ echo "Rebuilding/automaking the config files..." echo aclocal -I . 2> /dev/null 1> /dev/null autoheader 2> /dev/null 1> /dev/null automake -a --force --copy --foreign 2> /dev/null 1> /dev/null autoconf 2> /dev/null # ------------------------------------------------------ rm -rf autom4te.cache rm -rf .deps rm -f .deps rm -f config.status rm -f config.cache CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --infodir=/usr/info \ --disable-auto-linux-mem-opt \ --disable-minix \ --disable-md5-password \ --disable-hercules \ --disable-serial \ --disable-packet-retransmission \ --enable-pci-direct \ # --enable-preset-menu=preset_menu.lst \ --mandir=/usr/man make -j3 || exit 1 make install DESTDIR=$PKG || exit 1 ( 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 ) # 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 # Compress info pages and purge "dir" file from the package: if [ -d $PKG/usr/info ]; then ( cd $PKG/usr/info rm -f dir gzip -9 * ) fi mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ AUTHORS BUGS COPYING INSTALL MAINTENANCE NEWS README THANKS TODO \ $PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Add Kent's grubconfig tool: cd $TMP rm -rf grubconfig-$GCVER tar xzf $CWD/grubconfig-${GCVER}.tar.gz cd grubconfig-$GCVER zcat $CWD/grubconfig_localefix.patch.gz | patch || exit 1 chown -R root:root . chmod 644 README chmod 755 grubconfig mkdir -p $PKG/usr/doc/grubconfig-${GCVER} cp -a README $PKG/usr/doc/grubconfig-${GCVER} cp -a grubconfig $PKG/usr/sbin/grubconfig cd $PKG makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD.tgz # cleanup rm -fr $TMP/*