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

VERSION=0.50.3
PROGNAME="aspell $VERSION"
DESC="\
aspell (spell checker)                                                 \n\
                                                                       \n\
GNU Aspell is a spell checker designed to eventually replace Ispell.   \n\
It can either be used as a library or as an independent spell checker."

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

compile() {
   tar -zxvf $CWD/aspell-$VERSION.tar.gz
   cd aspell-$VERSION/
   chown -R root.root .
   find . -perm 664 -exec chmod 644 {} \;

   # This fix is needed to work with gcc 3.3
   cat $CWD/checker_string.hpp.diff | patch -p1

   CFLAGS=-O2 CXXFLAGS=-O2 \
   ./configure --prefix=/usr
   make
}

install() {
   # This is a very ugly hack that gets around a bug in libtool.
   # When the "make install" is done, libtool tries to relink the libpspell
   # library, but winds up screwing things up and then doesn't do it right.
   # Copying the dynamic libs to /usr/local/lib for the duration of the
   # "make install" seems to fix things.  Sigh.  We will delete them from there
   # once we're done.
   ( cd $TMP/aspell-$VERSION/lib/.libs/
     names=`/bin/ls *.so*`
     cp -vp $names /usr/local/lib
   )
   make install DESTDIR=/package-aspell

   ( cd $TMP/aspell-$VERSION/lib/.libs/
     names=`/bin/ls *.so*`
     cd /usr/local/lib
     rm -v $names
   )

   mkdir -p /package-aspell/usr/doc/aspell-$VERSION
   cp -a COPYING README TODO \
       /package-aspell/usr/doc/aspell-$VERSION
   mv /package-aspell/usr/share/doc/aspell/*html /package-aspell/usr/doc/aspell-$VERSION
   rm -rf /package-aspell/usr/share/doc
}

attributes() {
   chown -R root.bin $PKG/package-aspell/usr/bin/
}

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

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

