#Packager: Shador <futur~DOT~andy~AT~googlemail.com>

pkgname=mediatomb
pkgver=0.12.1
pkgrel=3ab
source=("http://downloads.sourceforge.net/mediatomb/mediatomb-0.12.1.tar.gz"
        "mediatomb-reopen-log.patch")
sourcetemplate="http://gaia.homelinux.org/salix/slkbuilds/$pkgname/"
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "readme.utf_8")
url='http://mediatomb.cc/'

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (Free UPnP MediaServer)"
"MediaTomb is an open source (GPL) UPnP MediaServer with a nice web"
"user interface, it allows you to stream your digital media through"
"your home network and listen to/watch it on a variety of UPnP"
"compatible devices."
"MediaTomb implements the UPnP MediaServer V 1.0 specification that can"
"be found on http://www.upnp.org/. The current implementation focuses"
"on parts that are required by the specification, however we look into"
"extending the functionality to cover the optional parts of the spec as"
"well."
)


build() {
	set -e

	cd $startdir/src/$pkgname-$pkgver
	patch -p0 -i $startdir/src/mediatomb-reopen-log.patch

	export LDFLAGS="$LDFLAGS -ldl"  # this fixes weird linking errors with sqlite3
	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--mandir=/usr/man \
		--enable-db-autocreate \
		--enable-atomic-pthread \
		--enable-sighup \
		--enable-mrreg-service \
		--enable-external-transcoding \
		--enable-youtube \
		--enable-sqlite-backup-defaults \
		--enable-protocolinfo-extension \
		--enable-curl \
		--enable-largefile \
		--disable-rpl-malloc \
		--enable-zlib \
		--enable-sqlite3 \
		--disable-mysql \
		--disable-libjs \
		--enable-libmagic \
		--disable-id3lib \
		--enable-taglib \
		--disable-libextractor \
		--enable-ffmpeg \
		--enable-ffmpegthumbnailer \
		--disable-lastfmlib \
		--enable-ImageMagick \
		--enable-libexif \
		--enable-libmp4v2 \
		--enable-inotify \
		--enable-libdvdnav \
		--build=$arch-slackware-linux || return 1
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg || return 1

	set +e
}