Added community/mediatomb

This commit is contained in:
Mike Staszel 2010-07-23 05:20:44 -07:00
parent d57bbbf060
commit 488378b69f
3 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,40 @@
# Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Nikhil Bysani <nikron@gmail.com>
# Contributor: Mika Hynnä <igheax@gmail.com>
# Maintainer: Desmond Cox <desmondgc@gmail.com>
pkgname=mediatomb
pkgver=0.12.1
pkgrel=1
pkgdesc="Free UPnP MediaServer"
arch=('i686' 'x86_64')
url="http://mediatomb.cc/"
license=('GPL')
depends=('libexif' 'taglib' 'sqlite3' 'expat' 'spidermonkey' 'curl' 'ffmpeg')
optdepends=('ffmpegthumbnailer: video thumbnail generation support')
backup=(etc/conf.d/mediatomb etc/mediatomb/mediatomb.conf)
source=(http://downloads.sourceforge.net/mediatomb/mediatomb-$pkgver.tar.gz
mediatomb.rc
mediatomb.conf)
md5sums=('e927dd5dc52d3cfcebd8ca1af6f0d3c2'
'16be23c425505160c031aaf239a8d9a4'
'81786546341fc357897d127fce51c8f4')
build() {
cd $startdir/src/mediatomb-$pkgver || return 1
./configure --prefix=/usr --disable-mysql --enable-libmagic --enable-libjs --enable-ffmpeg || return 1
make || return 1
make DESTDIR=$startdir/pkg install || return 1
# daemon script
mkdir -p $startdir/pkg/etc/rc.d/ || return 1
install -m0755 ../mediatomb.rc $startdir/pkg/etc/rc.d/mediatomb || return 1
# daemon config
mkdir -p $startdir/pkg/etc/conf.d/ || return 1
install -m0644 ../mediatomb.conf $startdir/pkg/etc/conf.d/mediatomb || return 1
# daemon database/config dir
mkdir -p $startdir/pkg/var/lib/mediatomb/ || return 1
}

View file

@ -0,0 +1,24 @@
## This is the configuration file for the MediaTomb daemon script
## /etc/rc.d/mediatomb
## User defined command line options that may be passed to the server
MT_OPTIONS=""
#MT_OPTIONS="-c /home/username/.mediatomb/config.xml"
## MediaTomb will be started on port 50500
MT_PORT="50500"
## MediaTomb will run as nobody
MT_USER="nobody"
MT_GROUP="nobody"
## Location of the PID file
MT_PIDFILE="/var/run/mediatomb.pid"
## Location of the log file
MT_LOGFILE="/var/log/mediatomb"
## Location of the config file/database
MT_HOME="/var/lib"
MT_CFGDIR="mediatomb"

View file

@ -0,0 +1,54 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/mediatomb
PID=$(cat $MT_PIDFILE 2> /dev/null)
MEDIATOMB="-d -u $MT_USER -g $MT_GROUP -P $MT_PIDFILE -l $MT_LOGFILE -m $MT_HOME -f $MT_CFGDIR -p $MT_PORT"
case "$1" in
start)
stat_busy "Starting MediaTomb UPnP MediaServer"
# Ensure the daemon is able to write into MT_CFGDIR
chown $MT_USER:$MT_GROUP "/$MT_HOME/$MT_CFGDIR"
# MediaTomb does not remove MT_PIDFILE on shutdown
[ -z "$(pidof -o %PPID /usr/bin/mediatomb)" ] && rm -f $MT_PIDFILE
[ -z "$(cat $MT_PIDFILE 2> /dev/null)" ] && /usr/bin/mediatomb $MEDIATOMB $MT_OPTIONS
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon mediatomb
stat_done
fi
;;
stop)
stat_busy "Stopping MediaTomb UPnP MediaServer"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm -f $MT_PIDFILE
rm_daemon mediatomb
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0