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

VERSION=2.1.0
PROGNAME="getty-ps $VERSION"
DESC="\
getty-ps                                                               \n\
                                                                       \n\
/sbin/getty and /sbin/uugetty.                                         \n\
These control the process of logging into your system, and may be used \n\
instead of 'agetty', which is the default getty included with the      \n\
util-linux package. getty-ps supports a number of enhancements such as \n\
ringback support.                                                      \n\
                                                                       \n\
getty-ps was originally written by Paul Sutcliffe, Jr, and is          \n\
currently maintained by Christine Jamison."

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

compile() {
   tar -zxvf $CWD/getty_ps-$VERSION.tar.gz
   cd getty_ps-$VERSION/
   chown -R root.root .

   make clean    # get rid of x86 object modules shipped with source
   rm getty uugetty
   # This package does not compile with gcc 3.3
   make CC=gcc-2.95.3
}

install() {
   mkdir -p /package-getty-ps/etc/default/ \
            /package-getty-ps/usr/doc/getty-ps-$VERSION/Examples/default/ \
            /package-getty-ps/usr/man/man1/ \
            /package-getty-ps/usr/man/man5/ \
            /package-getty-ps/sbin

   cp -a getty uugetty /package-getty-ps/sbin/
   cp -a Examples/gettydefs /package-getty-ps/etc/gettydefs
   cp -a Examples/default/* /package-getty-ps/etc/default

   cat man/getty.1 | gzip -9c > /package-getty-ps/usr/man/man1/getty.1.gz
   ( cd /package-getty-ps/usr/man/man1/
     rm -f uugetty.1.gz ; ln -sf getty.1.gz uugetty.1.gz
   )

   cat man/gettydefs.5 | gzip -9c > /package-getty-ps/usr/man/man5/gettydefs.5.gz

   cp -a ANNOUNCE ChangeLog README.* Examples *.lsm INSTALL \
       /package-getty-ps/usr/doc/getty-ps-$VERSION
}

attributes() {
   chown -R root.bin $PKG/package-getty-ps/sbin
   chmod 644 $PKG/package-getty-ps/etc/gettydefs
}

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

   chown root.bin $PKG/sbin/*

   cd $CTL
   cat $CWD/slack-desc > slack-desc
   sed -e 's%package-getty-ps/%%' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

