#!/bin/sh
CWD=`pwd`
VERSION=0.22.0
ARCH=x86_64
BUILD=3

cat << EOF

This is one of those [silly] things that will only build under X...

EOF
sleep 5

PKG=/tmp/package-gdk-pixbuf
rm -rf /tmp/gdk-pixbuf-$VERSION
rm -rf $PKG

cd /tmp
tar xjvf $CWD/gdk-pixbuf-$VERSION.tar.bz2
cd gdk-pixbuf-$VERSION
#cat $CWD/tons-of-patches-from-fedora.patch | patch -p1

CFLAGS="-O2 -I/usr/include/gtk-2.0/gdk" ./configure \
           --prefix=/usr --disable-mmx $ARCH-pc-linux
make
make install DESTDIR=$PKG
mkdir -p $PKG/usr/doc/gdk-pixbuf-$VERSION
cp -a AUTHORS COPYING COPYING.LIB INSTALL NEWS README TODO \
   $PKG/usr/doc/gdk-pixbuf-$VERSION
chown -R root.root $PKG/usr/doc/gdk-pixbuf-$VERSION
chmod 644 $PKG/usr/doc/gdk-pixbuf-$VERSION/*
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
makepkg -l y -c n gdk-pixbuf-$VERSION-$ARCH-$BUILD.tgz
mv gdk-pixbuf-$VERSION-$ARCH-$BUILD.tgz /tmp
echo "Package in /tmp"

