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

pkgname=gnucash
pkgver=2.4.3
pkgrel=1gv
source=("http://downloads.sourceforge.net/sourceforge/gnucash/gnucash-$pkgver.tar.bz2")
docs=("readme*" "install" "copying" "changelog" "authors" "news" "todo" "documenters" "hacking" "license")
url=http://www.gnucash.org/
dotnew=('etc/gnucash/config')
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gnucash (personal and small-business financial-accounting software)"
"Designed to be easy to use, yet powerful and flexible, GnuCash allows"
"you to track bank accounts, stocks, income and expenses. As quick and"
"intuitive to use as a checkbook register, it is based on professional"
"accounting principles to ensure balanced books and accurate reports."
)


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

	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-dbi \
		--disable-schemas-install \
		--with-gconf-source="xml::/etc/gconf/gconf.xml.defaults" \
		--build=$arch-slackware-linux
	make || 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
}