IGNOREPATH=/etc:/home:/var:/dev:/boot:/root:/tmp:/usr/local:/sbin:/mnt:/usr/src
STRIPLIB=y
STRIPBIN=y

VERSION=0.4.0
PROGNAME="ash $VERSION"
DESC="\
ash (Kenneth Almquist's ash shell)                                     \n\
                                                                       \n\
A lightweight (92K) Bourne compatible shell.  Great for machines with  \n\
low memory, but does not provide all the extras of shells like bash,   \n\
tcsh, and zsh.  Runs most shell scripts compatible with the Bourne     \n\
shell.  Note that under Linux, most scripts seem to use at least some  \n\
bash-specific syntax.  The Slackware setup scripts are a notable       \n\
exception, since ash is the shell used on the install disks.  NetBSD   \n\
uses ash as its /bin/sh."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=unknown
PKGNAME=ash-$VERSION-s390-$BUILD
TAG=OPT

compile() {
   tar -xvzf $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
}

install() {
   mkdir -p /package-ash/bin
   cat sh > /package-ash/bin/ash
   mkdir -p /package-ash/usr/man/man1
   cat sh.1 | gzip -9c > /package-ash/usr/man/man1/ash.1.gz
   mkdir -p /package-ash/usr/doc/ash-$VERSION
   cp -a TOUR /package-ash/usr/doc/ash-$VERSION
}

attributes() {
   chown -R root.bin $PKG/package-ash/bin
   chmod 755 $PKG/package-ash/bin/*
}

special() {
   cd $PKG
   mv package-ash/* ./
   rmdir package-ash

   cd $CTL
   cat $CWD/slack-desc > slack-desc

   cat <<EOF >> doinst.sh
if grep "bin/ash" etc/shells 1> /dev/null 2> /dev/null; then
  true
else
  echo "/bin/ash" >> etc/shells
fi
EOF
}

