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

VERSION=4.3
PROGNAME="GNU readline library $VERSION"
DESC="\
readline (line input library with editing features)                    \n\
                                                                       \n\
The GNU Readline library provides a set of functions for use by        \n\
applications that allow users to edit command lines as they are typed  \n\
in.  Both Emacs and vi editing modes are available.  The Readline      \n\
library includes additional functions to maintain a list of previously \n\
entered command lines, to recall and perhaps edit those lines, and     \n\
perform csh-like history expansion on previous commands."

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

compile() {
   tar -xvzf $CWD/readline-$VERSION.tar.gz
   cd readline-$VERSION/
   chown -R root.root .
   find . -perm 664 | xargs chmod 644
   find . -perm 775 | xargs chmod 755

   for file in $CWD/patches/readline*gz ; do
     zcat $file | patch -p0 --verbose
   done

   CFLAGS=-O2 \
   ./configure --prefix=/usr \
               --with-curses \
               --build=s390-slackware-linux \
               --host=s390-slackware-linux \
               --target=s390-slackware-linux

   make static shared
}

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

   mkdir -p /package-readline/usr/doc/readline-$VERSION
   cp -a CHANGELOG CHANGES COPYING INSTALL MANIFEST README USAGE examples \
         /package-readline/usr/doc/readline-$VERSION

   ( cd /package-readline/usr/info
     rm -f *.gz
     gzip -9 *
   )

   ( cd /package-readline/usr/man/man3
     rm -f *.gz
     gzip -9 *.3
   )
}

attributes() {
   chmod 755 $PKG/package-readline/usr/lib/*.so*
}

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

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

   sed -e 's%package-readline/%%g' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

