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

pkgname=gnome-media
pkgver=2.32.0
pkgrel=1gv
source=("http://ftp.acc.umu.se/pub/GNOME/sources/gnome-media/2.32/gnome-media-2.32.0.tar.bz2" "gstreamer-properties-nohelp.patch")
docs=("readme" "install" "copying" "copying-docs" "changelog" "authors" "news" "todo" "maintainers")
url=www.gnome.org
options=('noautodotnew')

doinst() {
# Update the scrollkeeper database (Remove stale pieces)
if [ -x usr/bin/scrollkeeper-update ]; then
        usr/bin/scrollkeeper-update > /dev/null 2>&1
fi
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gnome-media (GNOME media utilities)"
"gnome-media provides gstreamer-properties which is a GUI for selecting"
"the input and output systems that will be used for audio and video"
"applications using the gstreamer media framework."
)


build() {
	cd $startdir/src/gnome-media-$pkgver

	patch -p1 < $startdir/src/gstreamer-properties-nohelp.patch || exit 1

	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--disable-profiles \
		--enable-gstprops \
		--disable-gstmix \
		--disable-grecord \
		--disable-schemas-install \
		--disable-scrollkeeper \
		--disable-static \
		--with-gconf-source="xml::/etc/gconf/gconf.xml.defaults" \
		--build=$arch-slackware-linux
	make || return 1
	make install DESTDIR=$startdir/pkg
	
	sed -i "/NoDisplay=true/d" $startdir/pkg/usr/share/applications/gstreamer-properties.desktop
	echo "OnlyShowIn=GNOME;" >> $startdir/pkg/usr/share/applications/gnome-volume-control.desktop

	# gconf stuff
	export GCONF_CONFIG_SOURCE="xml::$startdir/pkg/etc/gconf/gconf.xml.defaults"
	if [ -d $startdir/pkg/etc/gconf/schemas ]; then
		install -v -d -m755 $startdir/pkg/etc/gconf/gconf.xml.defaults
		SCHEMAS=$startdir/pkg/etc/gconf/schemas
		for schema in $SCHEMAS/*.schemas; do
			gconftool-2 --makefile-install-rule $schema
		done
		# Reset / Verify correct permissions
		( cd $startdir/pkg/etc/gconf ; find . -type d -exec chmod 755 {} \; )
		( cd $startdir/pkg/etc/gconf ; find . -type f -exec chmod 644 {} \; )
	fi

	# unneeded stuff
	rm -rf $startdir/pkg/usr/share/omf
	rm -rf $startdir/pkg/usr/share/gnome
	# wtf?
	rm -f $startdir/pkg/usr/share/applications/gnome-volume-control.desktop
}