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

pkgname=gpass
pkgver=0.5.1
pkgrel=2gv
arch=i486
source=(http://projects.netlab.jp/gpass/release/gpass-0.5.1.tar.gz)
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://projects.netlab.jp/gpass
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gpass - a password manager"
"GPass is a simple application that lets you manage a collection of"
"passwords. The password collection is stored in an encrypted"
"(blowfish) file, protected by a master-password."
)


build() {
	export LDFLAGS='-export-dynamic'
	cd $startdir/src/$pkgname-$pkgver
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc --disable-static --disable-schemas-install --with-gconf-source="xml::/etc/gconf/gconf.xml.defaults"
	make || return 1
	make install DESTDIR=$startdir/pkg

	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	(
	cd $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	ln -s ../../../../pixmaps/gpass-icon.png gpass-icon.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
}