#!/bin/sh
GIMP_VER=1.2.3
EXTRAS_VER=1.2.0

# libXMHTML needs to be installed because the help browser plug-in needs it.
# This is part of gnome-libs.  So, installing the resulting GIMP package 
# without GNOME will result in no help (but GIMP will otherwise work).
# Oh well... not much we can do.  The GNOME libs resist static linking
# without hopping through more hoops than we're going to.

# Build the GIMP:
CWD=`pwd`
cd /tmp
tar xjvf $CWD/gimp-${GIMP_VER}.tar.bz2
cd gimp-${GIMP_VER}
# This is not a GNOME thing (well, not yet luckily) so it's going back
# into /usr.  (/usr/X11R6 won't work because it invites conflicts with
# the /usr/share/aclocal directory)
CFLAGS=-O2 ./configure \
            --prefix=/usr \
            --sysconfdir=/etc \
            --localstatedir=/var/lib \
            --with-gtk-prefix=/usr \
            --enable-threads
make
make install
ldconfig
mkdir -p /usr/doc/gimp-${GIMP_VER}
cp -a \
  ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL MAINTAINERS NEWS PLUGIN_MAINTAINERS README README.i18n README.perl README.win32 TODO \
  docs \
  /usr/doc/gimp-${GIMP_VER}
chown -R root.root /usr/doc/gimp-${GIMP_VER}
chmod -R 644 /usr/doc/gimp-${GIMP_VER}
find /usr/doc/gimp-${GIMP_VER} -type d -exec chmod 755 {} \;

# Add gimp-data-extras addons:
cd /tmp
tar xjvf $CWD/gimp-data-extras-${EXTRAS_VER}.tar.bz2
cd gimp-data-extras-${EXTRAS_VER}
./configure \
   --prefix=/usr
make install
mkdir -p /usr/doc/gimp-data-extras-${EXTRAS_VER}
cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README \
  /usr/doc/gimp-data-extras-${EXTRAS_VER}
chown root.root /usr/doc/gimp-data-extras-${EXTRAS_VER}/*
chmod 644 /usr/doc/gimp-data-extras-${EXTRAS_VER}/*

mkdir -p /install
cat $CWD/slack-desc > /install/slack-desc

