[c5c522c] | 1 | #!/bin/bash |
---|
| 2 | #DEP:lzo |
---|
| 3 | #DEP:ncurses |
---|
| 4 | |
---|
| 5 | NAME=grub |
---|
| 6 | VER=0.97 |
---|
| 7 | CWD=`pwd` |
---|
| 8 | PKGTMP=/tmp/pkgtmp |
---|
| 9 | |
---|
| 10 | mkdir -p $PKGTMP &>/dev/null |
---|
| 11 | |
---|
| 12 | tar -xzf $NAME-$VER.tar.gz || exit 1 |
---|
| 13 | |
---|
| 14 | #gentoo patches, grub development loopt achter ivm grub2 |
---|
| 15 | #tar -xjf $NAME-$VER-patches-1.4.tar.bz2 || exit 1 |
---|
| 16 | #tar -xjf $NAME-$VER-patches-1.2.tar.bz2 || exit 1 |
---|
| 17 | tar -xjf $NAME-$VER-patches-1.9.tar.bz2 || exit 1 |
---|
| 18 | rm patch/*netboot* |
---|
| 19 | |
---|
| 20 | cd $NAME-$VER |
---|
| 21 | |
---|
| 22 | #filter patches we DONT want: |
---|
| 23 | rm ../patch/850_all_grub-0.97_ext4.patch || exit 1 |
---|
| 24 | |
---|
| 25 | #apply patches |
---|
| 26 | for PATCH in ../patch/*.patch; do |
---|
| 27 | echo "patch $PATCH" |
---|
| 28 | if ! patch -p1 < $PATCH; then |
---|
| 29 | echo "OOPS - Trying to patch again, with -p0 this time..." |
---|
| 30 | patch -p0 < $PATCH || exit 1 |
---|
| 31 | fi |
---|
| 32 | done |
---|
| 33 | |
---|
| 34 | #fix for newer automakes |
---|
| 35 | fgrep -rlZ pkglib_DATA --include Makefile.am . | xargs -0 sed -i 's/pkglib_DATA/pkgdata_DATA/g' |
---|
| 36 | |
---|
| 37 | export CFLAGS="-fgnu89-inline" |
---|
| 38 | |
---|
| 39 | #deze ac dingen zijn nodig, omdat we zojuist een patch gedaan hebben op configure.ac: |
---|
| 40 | aclocal || exit 1 |
---|
| 41 | autoheader || exit 1 |
---|
| 42 | automake -a|| exit 1 |
---|
| 43 | autoconf || exit 1 |
---|
| 44 | ./configure --prefix=/usr --disable-auto-linux-mem-opt || exit 1 |
---|
| 45 | make || exit 1 |
---|
| 46 | make DESTDIR=$PKGTMP install || exit 1 |
---|
| 47 | |
---|
| 48 | #somehow this moved with newer buildtools |
---|
| 49 | mkdir -p $PKGTMP/usr/lib/grub/i386-pc/ |
---|
| 50 | mv $PKGTMP/usr/share/grub/* $PKGTMP/usr/lib/grub/i386-pc/ || exit 1 |
---|
| 51 | rmdir $PKGTMP/usr/share/grub |
---|
| 52 | |
---|
| 53 | #mkdir -p $PKGTMP/etc/postinst.d || exit 1 |
---|
| 54 | #cp post.grub $PKGTMP/etc/postinst.d || exit 1 |
---|
| 55 | mkdir -p $PKGTMP/boot/grub || exit 1 |
---|
| 56 | |
---|
| 57 | cp -a $CWD/*.lst $PKGTMP/boot/grub || exit 1 |
---|
| 58 | ln -s menu-B.lst $PKGTMP/boot/grub/menu.lst || exit 1 |
---|
| 59 | |
---|
| 60 | mkdir $PKGTMP/sbin |
---|
| 61 | cp $CWD/syn3-install-grub $PKGTMP/sbin || exit 1 |
---|
| 62 | chmod +x $PKGTMP/sbin/syn3-install-grub || exit 1 |
---|
| 63 | |
---|
| 64 | mkdir -p $PKGTMP/etc/postinst.d |
---|
| 65 | cp $CWD/post.grub $PKGTMP/etc/postinst.d || exit 1 |
---|
| 66 | chmod +x $PKGTMP/etc/postinst.d/post.grub || exit 1 |
---|
| 67 | |
---|
| 68 | cp $CWD/syn3splash.xpm.gz $PKGTMP/boot/grub || exit 1 |
---|
| 69 | |
---|
| 70 | cd "$PKGTMP" || exit 1 |
---|
| 71 | makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && |
---|
| 72 | echo $VER > $CWD/$NAME.version && |
---|
| 73 | arch > $CWD/$NAME.arch |
---|
| 74 | |
---|