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

pkgname=mate-window-manager
pkgver=1.4.0
pkgrel=1rl
source=("http://pub.mate-desktop.org/releases/1.4/mate-window-manager-1.4.0.tar.xz")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"mate-window-manager (A lightweight GTK2 based Window Manager)"
"MATE Window Manager is a small window manager, using gtk2 to do"
"everything. As the author says, MATE Window Manager is a Boring window"
"manager for the adult in you. Many window managers are like"
"Marshmallow Froot Loops; MATE Window Manager is like Cheerios. "
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./autogen.sh \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-schemas-install \
		--enable-compositor \
		--disable-static \
		--with-mateconf-source="xml::/etc/mateconf/mateconf.xml.defaults" \
		--build=$arch-slackware-linux
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg

	# Install mateconf schemas in the package
        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

	# compositing disabled by default
	mateconftool-2 --direct --config-source xml::$startdir/pkg/etc/mateconf/mateconf.xml.defaults --type bool --set /apps/marco/general/compositing_manager false
	# set default theme
	mateconftool-2 --direct --config-source xml::$startdir/pkg/etc/mateconf/mateconf.xml.defaults --type string --set /apps/marco/general/theme ClearlooksRe

}