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

VERSION=1.6.6
PROGNAME="sudo $VERSION"
DESC="\
sudo (give limited root privileges to certain users)                   \n\
                                                                       \n\
'sudo' is a command that allows users to execute some commands as      \n\
root.  The /etc/sudoers file (edited with 'visudo') specifies which    \n\
users have access to sudo and which commands they can run.  'sudo'     \n\
logs all its activities to /var/log/ so the system administrator       \n\
can keep an eye on things."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=ftp://ftp.sudo.ws/pub/sudo/
PKGNAME=sudo-$VERSION-s390-$BUILD
TAG=REC

compile() {
   tar -xvzf $CWD/sudo-$VERSION.tar.gz
   cd sudo-$VERSION/

   ./configure --prefix=/usr --sbindir=/usr/sbin --with-getpass --with-C2
   make
}

install() {
   make install DESTDIR=/package-sudo

   mv /package-sudo/etc/sudoers /package-sudo/etc/sudoers.new

   mkdir -p /package-sudo/usr/doc/sudo-$VERSION
   cp -a BUGS CHANGES HISTORY INSTALL PORTING README RUNSON \
         TODO TROUBLESHOOTING \
       /package-sudo/usr/doc/sudo-$VERSION

   ( cd /package-sudo/usr/man
     for dir in 5 8; do
       ( cd man$dir 
         rm -f *.gz
         gzip -9 *.$dir
       )
     done
   )
}
attributes() {
   chown -R root.bin $PKG/package-sudo/usr/bin \
                     $PKG/package-sudo/usr/sbin
   chmod 4711 $PKG/package-sudo/usr/bin/sudo
   chmod 755 $PKG/package-sudo/usr/sbin/visudo
   chmod 644 $PKG/package-sudo/usr/man/man5/* \
             $PKG/package-sudo/usr/man/man8/*
}

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

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

   cat <<EOF >> $CTL/doinst.sh
if [ ! -r etc/sudoers ]; then
   mv etc/sudoers.new etc/sudoers
fi
EOF
}

