# Exit on error:
set -e

wget https://launchpad.net/gnome-paint/trunk/0.4.0/+download/gnome-paint-0.4.0.tar.gz
tar xf gnome-paint-0.4.0.tar.gz
cd gnome-paint-0.4.0

# Fix a location bug:
# test -z "/doc/gnome-paint" || /usr/lib/pkgusr/mkdir -p "/doc/gnome-paint"
# /bin/mkdir: cannot create directory ‘/doc’: Permission denied
# Makefile:357: recipe for target 'install-gnome_paintdocDATA' failed
sed -i.orig '/gnome_paintdocdir =/s/prefix/datarootdir/' Makefile.am
sed -i.orig '/gnome_paintdocdir =/s/prefix/datarootdir/' Makefile.in
./configure --prefix=
make install
cd ..
rm -rf gnome-paint-0.4.0
rm gnome-paint-0.4.0.tar.gz

exit 0
