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

pkgname=inkblot
pkgver=0.99.9
pkgrel=1gv
arch=i486
source=(http://www.mikegtn.net/packages/inkblot/inkblot-$pkgver.tar.gz)
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://www.mikegtn.net/1154
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"inkblot reports on the remaining ink levels of connected printers"
"Inkblot reports on the remaining ink levels in a wide variety of USB"
"and Parallel connected printers. Inkblot provides an ink status"
"notification, and can provide a more detailed dialog showing the"
"level of ink remaining to your printer. Inkblot uses libinklevel to"
"detect your printer on first run. Where available, the status of"
"individual colour ink reservoirs is shown. Inkblot lives in the"
"notification area, and uses session management to ensure it remains"
"available once added to your setup."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc --disable-schemas-install --with-gconf-source="xml::/etc/gconf/gconf.xml.defaults"
	make || return 1
	make install DESTDIR=$startdir/pkg
	sed -i "s/.png//" $startdir/pkg/usr/share/applications/inkblot.desktop
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps/
	mv $startdir/pkg/usr/share/pixmaps/inkblot.png $startdir/pkg/usr/share/icons/hicolor/48x48/apps/
	rmdir $startdir/pkg/usr/share/pixmaps

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