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

VERSION=0.22.0
PROGNAME="GdkPixBuf Library"
DESC="\
gdk-pixbuf                                                       \n\
                                                                 \n\
The GdkPixBuf library provides a number of features, including : \n\
   o  GdkPixbuf structure for representing images.               \n\
   o  Image loading facilities.                                  \n\
   o  Rendering of a GdkPixBuf into various formats:             \n\
      drawables (windows, pixmaps), GdkRGB buffers.              \n\
   o  Fast scaling and compositing of pixbufs.                   \n\
   o  Simple animation loading (ie. animated gifs)               \n\
                                                                 \n\
GdkPixBuf is required by many GTK+ programs such as GNOME and xfce."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=ftp://ftp.gnome.org/pub/GNOME/stable/sources/
PKGNAME=gdk-pixbuf-$VERSION-s390-$BUILD
TAG=OPT

compile() {
   tar -yxvf $CWD/gdk-pixbuf-$VERSION.tar.bz2
   cd gdk-pixbuf-$VERSION/

   CFLAGS=-O2 ./configure --prefix=/usr \
                          --disable-gtk-doc \
                          --build=s390-slackware-linux \
                          --host=s390-slackware-linux \
                          --target=s390-slackware-linux
   make
   # kludge alert.  Working around a bug in libtool.
   pushd gdk-pixbuf/.libs
   LIBLIST=`/bin/ls libgdk_pixbuf.*so*`
   cp -av $LIBLIST /usr/local/lib/
   ldconfig
   popd
}

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

  # Get rid of the kludge as soon as all the installs are done.
  ( cd $TMP/gdk-pixbuf-$VERSION/gdk-pixbuf/.libs
    LIBLIST=`/bin/ls libgdk_pixbuf.*so*`
    pushd /usr/local/lib
    ls -l
    echo rm -rf $LIBLIST
    rm -rf $LIBLIST
    popd
   )

   mkdir -p /package-gdkpixbuf/usr/doc/gdk-pixbuf-$VERSION
   cp -a AUTHORS COPYING COPYING.LIB INSTALL NEWS README TODO \
      /package-gdkpixbuf/usr/doc/gdk-pixbuf-$VERSION
}

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

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

   chown -R root.bin usr/bin

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

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

