#!/bin/bash #DEP:lzo #DEP:ncurses NAME=grub VER=0.97 CWD=`pwd` PKGTMP=/tmp/pkgtmp mkdir -p $PKGTMP &>/dev/null tar -xzf $NAME-$VER.tar.gz || exit 1 #gentoo patches, grub development loopt achter ivm grub2 #tar -xjf $NAME-$VER-patches-1.4.tar.bz2 || exit 1 #tar -xjf $NAME-$VER-patches-1.2.tar.bz2 || exit 1 tar -xjf $NAME-$VER-patches-1.9.tar.bz2 || exit 1 rm patch/*netboot* cd $NAME-$VER #filter patches we DONT want: rm ../patch/850_all_grub-0.97_ext4.patch || exit 1 #apply patches for PATCH in ../patch/*.patch; do echo "patch $PATCH" if ! patch -p1 < $PATCH; then echo "OOPS - Trying to patch again, with -p0 this time..." patch -p0 < $PATCH || exit 1 fi done #fix for newer automakes fgrep -rlZ pkglib_DATA --include Makefile.am . | xargs -0 sed -i 's/pkglib_DATA/pkgdata_DATA/g' export CFLAGS="-fgnu89-inline" #deze ac dingen zijn nodig, omdat we zojuist een patch gedaan hebben op configure.ac: aclocal || exit 1 autoheader || exit 1 automake -a|| exit 1 autoconf || exit 1 ./configure --prefix=/usr --disable-auto-linux-mem-opt || exit 1 make || exit 1 make DESTDIR=$PKGTMP install || exit 1 #somehow this moved with newer buildtools mkdir -p $PKGTMP/usr/lib/grub/i386-pc/ mv $PKGTMP/usr/share/grub/* $PKGTMP/usr/lib/grub/i386-pc/ || exit 1 rmdir $PKGTMP/usr/share/grub #mkdir -p $PKGTMP/etc/postinst.d || exit 1 #cp post.grub $PKGTMP/etc/postinst.d || exit 1 mkdir -p $PKGTMP/boot/grub || exit 1 cp -a $CWD/*.lst $PKGTMP/boot/grub || exit 1 ln -s menu-B.lst $PKGTMP/boot/grub/menu.lst || exit 1 mkdir $PKGTMP/sbin cp $CWD/syn3-install-grub $PKGTMP/sbin || exit 1 chmod +x $PKGTMP/sbin/syn3-install-grub || exit 1 mkdir -p $PKGTMP/etc/postinst.d cp $CWD/post.grub $PKGTMP/etc/postinst.d || exit 1 chmod +x $PKGTMP/etc/postinst.d/post.grub || exit 1 cp $CWD/syn3splash.xpm.gz $PKGTMP/boot/grub || exit 1 cd "$PKGTMP" || exit 1 makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && echo $VER > $CWD/$NAME.version && arch > $CWD/$NAME.arch