#Maintainer: Maximus (maximuus[at]gmail[dot]com)

pkgname=shotwell
pkgver=0.8.1
pkgrel=1mb
source=(http://yorba.org/download/shotwell/0.8/shotwell-0.8.1.tar.bz2)
sourcetemplate=http://people.salixos.org/maximus/$pkgname/$pkgver
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://www.yorba.org/shotwell/
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"shotwell - a digital photo organizer designed for the GNOME desktop"
"Shotwell is a digital photo organizer designed for the GNOME desktop"
"environment.  It allows you to import photos from disk or camera,"
"organize them in various ways, view them in full-window or fullscreen"
"mode, and export them to share with others."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./configure \
	--prefix=/usr \
	--libdir=/usr/lib${LIBDIRSUFFIX} \
	--localstatedir=/var \
	--sysconfdir=/etc \
	--release \
	--with-gconf-schema-file-dir=/etc/gconf/schemas \
	--disable-schemas-install \
	--disable-desktop-update \
	--disable-icon-update
	
	make || return 1
	make install DESTDIR=$startdir/pkg
	
	#install png icon for DE's wihthout svg support
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	convert $startdir/src/$pkgname-$pkgver/icons/shotwell.svg -resize 48x48 $startdir/pkg/usr/share/icons/hicolor/48x48/shotwell.png

	# gconf stuff
	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

}