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

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

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"mate-file-manager (file manager and graphical shell for MATE)"
"mate-file-manager is the official file manager for the MATE desktop."
"It allows to browse directories, preview files and launch applications"
"associated with them. It is also responsible for handling the icons"
"on the MATE desktop. It works on local and remote filesystems."
)


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

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

	./autogen.sh --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc --build=$arch-slackware-linux --disable-static --disable-schemas-install --disable-tests --with-mateconf-source="xml::/etc/mateconf/mateconf.xml.defaults" --disable-gtk-doc --enable-unique --disable-update-mimedb --disable-introspection
	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

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