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

pkgname=gnome-inform7
pkgver=6G60
pkgrel=2rl
source=("http://downloads.sourceforge.net/project/gnome-inform7/gnome-inform7/6G60/I7_6G60_GNOME_Source.tar.gz" "http://inform7.com/download/content/6G60/I7_6G60_Linux_all.tar.gz")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://sourceforge.net/projects/gnome-inform7
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gnome-inform7 (an IDE for interactive fiction using natural language)"
"Inform is a design system for interactive fiction based on natural"
"language. It is a radical reinvention of the way interactive fiction"
"is designed, guided by contemporary work in semantics and by the"
"practical experience of some of the world's best-known writers of IF."
)


build() {
	cd $startdir/src/inform7-$pkgver
	./install-inform7.sh --prefix ./install

	cd $startdir/src/$pkgname-$pkgver
	cp $startdir/src/inform7-$pkgver/install/libexec/ni src/ni/

	export GCONF_SCHEMA_INSTALL_SOURCE="xml::/etc/gconf/gconf.xml.defaults"
	
	./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" \
		--build=$arch-slackware-linux
	
	sed -i "s|GCONF_SCHEMA_CONFIG_SOURCE = .*|GCONF_SCHEMA_CONFIG_SOURCE = xml::/etc/gconf/gconf.xml.defaults|" src/Makefile
	
	make -j $numjobs || return 1
	GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=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
}