#Maintainer: George Vlahavas (vlahavas~at~gmail~dot~com, gapan@zenwalk forums)

pkgname=evolution
pkgver=2.26.0
zenver=60
pkgrel=1
arch=i486
source=("http://ftp.acc.umu.se/pub/GNOME/sources/evolution/2.26/evolution-2.26.0.tar.bz2" "http://pnboy.pinguix.com/gapan/gnome/$pkgname/gtkrc" "http://pnboy.pinguix.com/gapan/gnome/$pkgname/evolution-launch")
sourcetemplate=http://pnboy.pinguix.com/gapan/gnome/$pkgname
docs=("readme" "install" "copying*" "changelog*" "authors" "news*" "todo" "hacking" "maintainers")
url=ftp://ftp.gnome.org/pub/gnome/sources/evolution
options=('norequiredbuilder' 'keepdepfile' 'noautodotnew')

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

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"evolution - groupware suite with mail client and organizer"
"Evolution is a groupware suite which integrates mail, calendar,"
"address book, to-do list and memo tools. Additional features include"
"integration with Exchange and Groupwise servers, newsgroup client,"
"LDAP support, web calendars and synchronization with Palm devices."
)


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

	./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --disable-scrollkeeper --enable-nntp --enable-cairo-calendar  --enable-exchange --enable-plugins=all --with-openldap --disable-schemas-install --with-omf-dir=/usr/share/omf --with-krb4=/usr --with-krb5=/usr --with-nspr-includes=/usr/include/nspr --with-nss-includes=/usr/include/nss --with-gconf-source="xml::/etc/gconf/gconf.xml.defaults" --disable-static
	make || return 1
	make install DESTDIR=$startdir/pkg
	
	# Jump through hoops to make evolution show all its icons when not running inside gnome
	mv $startdir/pkg/usr/bin/evolution $startdir/pkg/usr/bin/evolution-bin
	cp $startdir/src/evolution-launch $startdir/pkg/usr/bin/evolution
	chmod a+x $startdir/pkg/usr/bin/evolution
	chown root:root $startdir/pkg/usr/bin/evolution
	cp $startdir/src/gtkrc $startdir/pkg/usr/share/evolution
	
	# 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
} 
