Browse Source

n/mediatomb: Add control and configuration files

slackware-14.2
Damien Goutte-Gattat 11 years ago
parent
commit
27be0b1586
  1. 14
      n/mediatomb/doinst.sh
  2. 18
      n/mediatomb/mediatomb.SlackBuild
  3. 26
      n/mediatomb/mediatomb.xml
  4. 34
      n/mediatomb/rc.mediatomb

14
n/mediatomb/doinst.sh

@ -10,10 +10,16 @@ config()
fi
}
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database ./usr/share/applications >/dev/null 2>&1
config etc/mediatomb.xml.new
if ! grep ^mediatomb /etc/group > /dev/null ; then
/usr/sbin/groupadd -g 272 mediatomb
fi
if [ -x /usr/bin/update-mime-database ]; then
/usr/bin/update-mime-database ./usr/share/mime >/dev/null 2>&1
if ! grep ^mediatomb /etc/passwd > /dev/null ; then
/usr/sbin/useradd -u 272 -c MediaTomb -d /var/lib/mediatomb -g mediatomb mediatomb
mkdir -p /var/lib/mediatomb
chown mediatomb:mediatomb /var/lib/mediatomb
fi
chown -f mediatomb:mediatomb etc/mediatomb.xml etc/mediatomb.xml.new

18
n/mediatomb/mediatomb.SlackBuild

@ -24,7 +24,7 @@
#
# Latest mediatomb sourcecode is available at: <http://mediatomb.cc/>.
#
# Recommends: xap/ffmpeg
# Optional: xap/ffmpeg, l/spidermonkey
# Source package infos
NAMESRC=${NAMESRC:-mediatomb}
@ -34,7 +34,7 @@ WGET=${WGET:-http://downloads.sourceforge.net/mediatomb/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-mediatomb}
BUILD=${BUILD:-1GGD}
BUILD=${BUILD:-2GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
@ -58,12 +58,14 @@ if [ ! -d $TMP ]; then
fi
# Compilation flags
LIBDIRSUFFIX=""
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
LIBDIRSUFFIX="64"
;;
*)
CPUOPT="-O2"
@ -78,11 +80,17 @@ fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
# Compile
# Extract
cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
# Support for SpiderMonkey 1.8.5
patch -p 1 < $CWD/mediatomb-0.12.1-mozjs185.patch
autoreconf
# Compile
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
LDFLAGS=-ldl \
@ -100,6 +108,10 @@ mkdir -p $PKG/usr/doc/$NAME
install -m 644 AUTHORS COPYING ChangeLog NEWS README TODO \
doc/*.txt $PKG/usr/doc/$NAME
# Install control script and default configuration file
install -D -m 644 $CWD/rc.mediatomb $PKG/etc/rc.d/rc.mediatomb
install -m 644 $CWD/mediatomb.xml $PKG/etc/mediatomb.xml.new
# Copy slack-desc and doinst.sh files
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
install -m 755 $CWD/doinst.sh $PKG/install/doinst.sh

26
n/mediatomb/mediatomb.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<config version="2" xmlns="http://mediatomb.cc/config/2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd">
<server>
<port>49152</port>
<ip>127.0.0.1</ip>
<interface>lo</interface>
<name>MediaTomb</name>
<udn />
<home>/var/lib/mediatomb</home>
<webroot>/usr/share/mediatomb/web</webroot>
<storage caching="yes">
<sqlite3 enabled="yes">
<database-file>mediatomb.db</database-file>
</sqlite3>
<mysql enabled="no">
<host>localhost</host>
<port>3306</port>
<username>mediatomb</username>
<password>mediatomb</password>
<database>mediatomb</database>
</mysql>
</storage>
</server>
</config>

34
n/mediatomb/rc.mediatomb

@ -0,0 +1,34 @@
#!/bin/sh
PIDFILE=/var/run/mediatomb.pid
case "$1" in
start)
/usr/bin/mediatomb -c /etc/mediatomb.xml -d \
-u mediatomb -g mediatomb -P $PIDFILE
;;
stop)
[ -f $PIDIFLE ] && kill -TERM `cat $PIDFILE`
rm -f $PIDFILE
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
if [ -f $PIDFILE ] && kill -0 `cat $PIDFILE` ; then
echo "Mediatomb is running"
else
echo "Mediatomb is not running"
fi
;;
*)
echo "usage: $0 {start|stop|restart}"
exit 1
;;
esac
Loading…
Cancel
Save