#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-ash VERSION=0.4.0 ARCH=i386 BUILD=1 if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi echo "+===============+" echo "| ash-$VERSION |" echo "+===============+" cd $TMP tar xzvf $CWD/ash-$VERSION.tar.gz cd ash-$VERSION chown -R root.root . ( cd $CWD/patches for file in ash-builtin.patch.gz ash-echo.patch.gz ash-getcwd.patch.gz ash-getopt.patch.gz ash-glob.patch.gz ash-jobs.patch.gz ash-kill.patch.gz ash-makefile.patch.gz ash-manpage.patch.gz ash-hetio.patch.gz ash-memout.patch.gz ash-misc.patch.gz ash-redir.patch.gz ash-setmode.patch.gz ash-syntax.patch.gz ash-test.patch.gz ash-times.patch.gz ash-debian.patch.gz ash-ppid.patch.gz ash-freebsd.patch.gz ash-sighup.patch.gz ; do zcat $file done ) | patch -p1 --verbose make strip sh mkdir -p $PKG/bin cat sh > $PKG/bin/ash chmod 755 $PKG/bin/ash chown -R root.bin $PKG/bin mkdir -p $PKG/usr/man/man1 cat sh.1 | gzip -9c > $PKG/usr/man/man1/ash.1.gz mkdir -p $PKG/usr/doc/ash-$VERSION chmod 644 TOUR cp -a TOUR $PKG/usr/doc/ash-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat << EOF > $PKG/install/doinst.sh if grep "bin/ash" etc/shells 1> /dev/null 2> /dev/null; then true else echo "/bin/ash" >> etc/shells fi EOF # Build the package: cd $PKG makepkg -l y -c n $TMP/ash-$VERSION-i386-1.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/ash-linux-$VERSION rm -rf $PKG fi