#Maintainer: George Vlahavas (vlahavas~at~gmail~dot~com)

pkgname=libmate
pkgver=1.2.0
pkgrel=1gv
source=("http://pub.mate-desktop.org/releases/1.2/libmate-1.2.0.tar.xz")
docs=("readme" "install" "copying*" "changelog" "authors" "news" "todo" "maintainers")
options=('noautodotnew')


slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"libmate (libraries needed for MATE)"
"The libmate package includes libraries essential to running the mate"
"desktop environment and associated applications."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./autogen.sh
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var/lib --sysconfdir=/etc --enable-esd --disable-schemas-install --with-mateconf-source="xml::/etc/mateconf/mateconf.xml.defaults" --disable-static --build=$arch-slackware-linux
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg
	
	# mateconf stuff
	export MATECONF_CONFIG_SOURCE="xml::$startdir/pkg/etc/mateconf/mateconf.xml.defaults"
	if [ -d $startdir/pkg/etc/mateconf/schemas ]; then
		install -v -d -m755 $startdir/pkg/etc/mateconf/mateconf.xml.defaults
		SCHEMAS=$startdir/pkg/etc/mateconf/schemas
		for schema in $SCHEMAS/*.schemas; do
			mateconftool-2 --makefile-install-rule $schema
		done
		# Reset / Verify correct permissions
		( cd $startdir/pkg/etc/mateconf ; find . -type d -exec chmod 755 {} \; )
		( cd $startdir/pkg/etc/mateconf ; find . -type f -exec chmod 644 {} \; )
	fi
	
	# Enable esd by default
	mateconftool-2 --direct --config-source xml::$startdir/pkg/etc/mateconf/mateconf.xml.defaults --type boolean --set /desktop/mate/sound/enable_esd true

	# we don't really need these
	rm -rf $startdir/pkg/usr/share/gtk-doc
}