summaryrefslogtreecommitdiff
path: root/system/grub4dos/grub4dos.SlackBuild
diff options
context:
space:
mode:
authorSteven Pledger <slacker4life@rocketmail.com>2010-06-12 06:26:45 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-06-12 07:47:28 -0500
commita6437a16c93a92fcf2a29834dbc651c2ba835110 (patch)
tree078842e99e180717f3c500c0b1d7bfc70af59b7c /system/grub4dos/grub4dos.SlackBuild
parentd27790a735adcbf92b57bc65912f211b5c276c35 (diff)
downloadslackbuilds-a6437a16c93a92fcf2a29834dbc651c2ba835110.tar.gz
system/grub4dos: Added (bootloader based on GNU GRUB)
GRUB4DOS is a universal boot loader based on GNU GRUB with bugfixes and new features such as built-in BIOS disk emulation, ATAPI CDROM driver, and Chinese support. It can be loaded from DOS/LINUX, via Windows boot manager/syslinux/lilo, or from MBR/CD. Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/grub4dos/grub4dos.SlackBuild')
-rw-r--r--system/grub4dos/grub4dos.SlackBuild95
1 files changed, 95 insertions, 0 deletions
diff --git a/system/grub4dos/grub4dos.SlackBuild b/system/grub4dos/grub4dos.SlackBuild
new file mode 100644
index 0000000000..4c9d628f87
--- /dev/null
+++ b/system/grub4dos/grub4dos.SlackBuild
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+# Slackware build script for grub4dos
+
+# Written by Steven Pledger <slacker4life@rocketmail.com>
+
+PRGNAM=grub4dos
+VERSION=${VERSION:-0.4.4}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+# Build Chinese version
+CHINESE="${CHINESE:-no}"
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+unzip $CWD/$PRGNAM-$VERSION-src.zip
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Included patch that translates to Chinese
+[ "$CHINESE" = "yes" ] && patch -p1 < patch-chinese.diff
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+sh configure \
+ --enable-preset-menu=preset_menu.lst \
+ --build=$ARCH-slackware-linux
+
+make
+
+# "make install" installs a lot of Grub legacy stuff not used by grub4dos, so install manually
+
+# hybrid DOS/Linux executable for installing grub4dos
+mkdir -p $PKG/usr/sbin
+install -m 0755 stage2/bootlace.com $PKG/usr/sbin
+
+mkdir -p $PKG/usr/share/$PRGNAM
+cp -a \
+ config.sys default menu.lst grub.pif stage2/grldr stage2/grub.exe \
+ stage2/badgrub.exe stage2/grldr.mbr stage2/hmload.com \
+ $PKG/usr/share/$PRGNAM
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ COPYING README_GRUB4DOS.txt ChangeLog_GRUB4DOS.txt \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}