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

pkgname=mate-desktop
pkgver=1.16.1
_majorver=`echo $pkgver | sed "s/\(.*\)\.\(.*\)/\1/"`
pkgrel=1gv
source=("http://pub.mate-desktop.org/releases/${_majorver}/mate-desktop-${pkgver}.tar.xz" "mate-salix.xml" "salix14.2.patch")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
options=('noautodotnew')

doinst() {
# compile schemas
if [ -x /usr/bin/glib-compile-schemas ]; then
        /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas > /dev/null 2>&1
fi
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"mate-desktop (The MATE Desktop environment)"
"The mate-desktop package includes common files needed for MATE"
"desktop apps (Pixmaps, .desktop files and internationalization files,"
"as well default settings for the MATE desktop)."
)


build() {
	cd $startdir/src/$pkgname-$pkgver

	patch -p1 < $startdir/src/salix14.2.patch || exit 1

	./configure --prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--build=$arch-slackware-linux \
		--disable-schemas-compile \
		--with-gtk=2.0 \
		--disable-static \
		--disable-gtk-doc \
		--disable-gtk-doc-html \
		--disable-gtk-doc-pdf \
		--build=$arch-slackware-linux
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg

	# remove unnecessary help files
	rm -rf $startdir/pkg/usr/share/help
	rm -rf $startdir/pkg/usr/share/gtk-doc

	# symlink all backgrounds from the salix-artwork package in
	mkdir -p $startdir/pkg/usr/share/backgrounds/mate
	(
	cd $startdir/pkg/usr/share/backgrounds/mate/
	ln -sf /usr/share/xfce4/backdrops/ salix
	)

	mkdir $startdir/pkg/usr/share/mate-background-properties
	cp $startdir/src/mate-salix.xml $startdir/pkg/usr/share/mate-background-properties/
} 
