#Packager: George Vlahavas <vlahavas~at~gmail~dot~com>

pkgname=gthumb
pkgver=2.12.2
pkgrel=1gv
source=("http://ftp.gnome.org/pub/GNOME/sources/gthumb/2.12/$pkgname-$pkgver.tar.bz2" "gthumb-2.12.2-nohelp.patch")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "maintainers")
options=('noautodotnew')
url="http://gthumb.sourceforge.net/"

doinst() {
# Update the scrollkeeper database (remove stale sections)
if [ -x usr/bin/scrollkeeper-update ]; then
    usr/bin/scrollkeeper-update > /dev/null 2>&1
fi
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gthumb (image viewer and browser for the Gnome enviroment)"
"gThumb is an image viewer for the Gnome enviroment. It allows you"
"to browse your hard disk, showing thumbnails of image files. It allows"
"access to digital cameras using libgphoto2. Supports slideshows,"
"catalogues, printing images, setting a desktop background."
)


build() {
	cd $startdir/src/$pkgname-$pkgver

	patch -p1 < $startdir/src/gthumb-2.12.2-nohelp.patch || exit 1

	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc --disable-static --disable-schemas-install --disable-scrollkeeper --build=$arch-slackware-linux
	make || return 1
	make install DESTDIR=$startdir/pkg
	export GCONF_CONFIG_SOURCE="xml::$startdir/pkg/etc/gconf/gconf.xml.defaults"
	if [ -d $startdir/pkg/etc/gconf/schemas ]; then
		install -v -d -m755 $startdir/pkg/etc/gconf/gconf.xml.defaults
		SCHEMAS=$startdir/pkg/etc/gconf/schemas
		for schema in $SCHEMAS/*.schemas; do
        		gconftool-2 --makefile-install-rule $schema
		done
		# Reset / Verify correct permissions
		( cd $startdir/pkg/etc/gconf ; find . -type d -exec chmod 755 {} \; )
		( cd $startdir/pkg/etc/gconf ; find . -type f -exec chmod 644 {} \; )
	fi

	# No help files needed
	rm -rf $startdir/pkg/usr/share/gnome
	rm -rf $startdir/pkg/usr/share/omf
}