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

pkgname=gnumeric
pkgver=1.12.51
_majorver=`echo $pkgver | cut -d'.' -f1,2`
pkgrel=1gv
source=("http://ftp.gnome.org/pub/GNOME/sources/gnumeric/$_majorver/gnumeric-$pkgver.tar.xz")
docs=("readme" "install" "copying" "*changelog*" "authors" "news" "todo" "beverages" "bugs" "hacking" "maintainers")
url=http://projects.gnome.org/gnumeric/
options=('noautodotnew')

dotnew() {
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gnumeric (The Gnome office spreadsheet)"
"The goal of Gnumeric is to be the best possible spreadsheet. We are"
"not attempting to clone existing applications. However, Gnumeric can"
"read files saved with other spreadsheets and we offer a customizable"
"feel that attempts to minimize the costs of transition."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./configure --prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-static \
		--disable-schemas-install \
		--build=$arch-slackware-linux
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg

	# 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
} 
