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

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

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"libmateweather (a library to access weather information)"
"libmateweather is a library to access weather information from online"
"services for numerous locations."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./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"
	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

	# put icons in hicolor dir, not everyone has to use the mate
	# icon theme
	mkdir -p $startdir/pkg/usr/share/icons/hicolor
	mv $startdir/pkg/usr/share/icons/mate/* $startdir/pkg/usr/share/icons/hicolor/
	rmdir $startdir/pkg/usr/share/icons/mate
}