From 1fd5b2447c7c2b2759c7cded770c548854aa1b01 Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Sun, 18 Dec 2011 18:46:10 -0600 Subject: multimedia/mediatomb: Patched for new ffmpeg and moved from Network Signed-off-by: Robby Workman --- multimedia/mediatomb/README | 7 ++ multimedia/mediatomb/config.xml | 151 +++++++++++++++++++++++++++ multimedia/mediatomb/doinst.sh | 29 +++++ multimedia/mediatomb/libav_0.7_support.patch | 64 ++++++++++++ multimedia/mediatomb/mediatomb.SlackBuild | 121 +++++++++++++++++++++ multimedia/mediatomb/mediatomb.info | 10 ++ multimedia/mediatomb/rc.mediatomb | 80 ++++++++++++++ multimedia/mediatomb/rc.mediatomb.conf | 21 ++++ multimedia/mediatomb/slack-desc | 19 ++++ 9 files changed, 502 insertions(+) create mode 100644 multimedia/mediatomb/README create mode 100644 multimedia/mediatomb/config.xml create mode 100644 multimedia/mediatomb/doinst.sh create mode 100644 multimedia/mediatomb/libav_0.7_support.patch create mode 100644 multimedia/mediatomb/mediatomb.SlackBuild create mode 100644 multimedia/mediatomb/mediatomb.info create mode 100644 multimedia/mediatomb/rc.mediatomb create mode 100644 multimedia/mediatomb/rc.mediatomb.conf create mode 100644 multimedia/mediatomb/slack-desc (limited to 'multimedia') diff --git a/multimedia/mediatomb/README b/multimedia/mediatomb/README new file mode 100644 index 000000000000..8faecd79d0fb --- /dev/null +++ b/multimedia/mediatomb/README @@ -0,0 +1,7 @@ +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 optionally depends on ffmpeg, libmp4v2, lastfmlib, +and ffmpegthumbnailer. diff --git a/multimedia/mediatomb/config.xml b/multimedia/mediatomb/config.xml new file mode 100644 index 000000000000..497ae5d2d945 --- /dev/null +++ b/multimedia/mediatomb/config.xml @@ -0,0 +1,151 @@ + + + + + + + + + MediaTomb + + /var/lib/mediatomb + /usr/share/mediatomb/web + + + mediatomb.db + + + localhost + mediatomb + mediatomb + + + + + + + + + + 128 + 5 + yes + no + 8 + + + * + + video + + + + lastfmuser + lastfmpass + + + + + + /usr/share/mediatomb/js/common.js + /usr/share/mediatomb/js/playlists.js + + /usr/share/mediatomb/js/import.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + audio/L16 + no + yes + no + + + + + video/mpeg + yes + yes + yes + + + + + + \ No newline at end of file diff --git a/multimedia/mediatomb/doinst.sh b/multimedia/mediatomb/doinst.sh new file mode 100644 index 000000000000..adc456f74f25 --- /dev/null +++ b/multimedia/mediatomb/doinst.sh @@ -0,0 +1,29 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +# Prepare the new configuration files +config etc/mediatomb/config.xml.new +config etc/rc.d/rc.mediatomb.conf.new +preserve_perms etc/rc.d/rc.mediatomb.new + diff --git a/multimedia/mediatomb/libav_0.7_support.patch b/multimedia/mediatomb/libav_0.7_support.patch new file mode 100644 index 000000000000..e25697c5021b --- /dev/null +++ b/multimedia/mediatomb/libav_0.7_support.patch @@ -0,0 +1,64 @@ +=== modified file 'src/metadata/ffmpeg_handler.cc' +--- old/src/metadata/ffmpeg_handler.cc 2010-08-25 17:07:03 +0000 ++++ new/src/metadata/ffmpeg_handler.cc 2011-05-19 04:33:32 +0000 +@@ -89,6 +89,33 @@ + + Ref sc = StringConverter::m2i(); + ++ /* Tabs are 4 characters here */ ++ typedef struct {const char *avname; metadata_fields_t field;} mapping_t; ++ static const mapping_t mapping[] = ++ { ++ {"title", M_TITLE}, ++ {"artist", M_ARTIST}, ++ {"album", M_ALBUM}, ++ {"date", M_DATE}, ++ {"genre", M_GENRE}, ++ {"comment", M_DESCRIPTION}, ++ {"track", M_TRACKNUMBER}, ++ {NULL, M_MAX}, ++ }; ++ ++ if (!pFormatCtx->metadata) ++ return; ++ for (const mapping_t *m = mapping; m->avname != NULL; m++) ++ { ++ AVMetadataTag *tag = NULL; ++ tag = av_metadata_get(pFormatCtx->metadata, m->avname, NULL, 0); ++ if (tag && tag->value && tag->value[0]) ++ { ++ log_debug("Added metadata %s: %s\n", m->avname, tag->value); ++ item->setMetadata(MT_KEYS[m->field].upnp, sc->convert(tag->value)); ++ } ++ } ++ /* Old algorithm (doesn't work with libav >= 0.7) + if (strlen(pFormatCtx->title) > 0) + { + log_debug("Added metadata title: %s\n", pFormatCtx->title); +@@ -131,6 +158,7 @@ + item->setMetadata(MT_KEYS[M_TRACKNUMBER].upnp, + sc->convert(String::from(pFormatCtx->track))); + } ++ */ + } + + // ffmpeg library calls +@@ -178,7 +206,7 @@ + for(i=0; inb_streams; i++) + { + AVStream *st = pFormatCtx->streams[i]; +- if((st != NULL) && (videoset == false) && (st->codec->codec_type == CODEC_TYPE_VIDEO)) ++ if((st != NULL) && (videoset == false) && (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)) + { + if (st->codec->codec_tag > 0) + { +@@ -209,7 +237,7 @@ + *y = st->codec->height; + } + } +- if(st->codec->codec_type == CODEC_TYPE_AUDIO) ++ if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO) + { + // Increase number of audiochannels + audioch++; + diff --git a/multimedia/mediatomb/mediatomb.SlackBuild b/multimedia/mediatomb/mediatomb.SlackBuild new file mode 100644 index 000000000000..62fa78c034d4 --- /dev/null +++ b/multimedia/mediatomb/mediatomb.SlackBuild @@ -0,0 +1,121 @@ +#!/bin/sh + +# Slackware build script for mediatomb + +# Copyright 2010 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=mediatomb +VERSION=0.12.1 +BUILD=${BUILD:-2} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +if ! grep ^mediatomb: /etc/group 2>&1 > /dev/null; then + echo " Must have a mediatomb group to run this script." + echo " # groupadd -g 241 mediatomb" + echo " Or something similar." + exit 1 +elif ! grep ^mediatomb: /etc/passwd 2>&1 > /dev/null; then + echo " Must have a mediatomb user to run this script." + echo " # useradd -u 241 -g mediatomb -d /var/lib/mediatomb mediatomb" + echo " Or something similar." + exit 1 +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +# Fix building with newer ffmpeg releases +patch -p1 -i $CWD/libav_0.7_support.patch + +# We need LDFLAGS="-ldl" for proper sqlite detection +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +LDFLAGS="-ldl" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --build=$ARCH-slackware-linux + +make +make install-strip DESTDIR=$PKG + +mkdir -p $PKG/etc/rc.d +cp $CWD/rc.mediatomb $PKG/etc/rc.d/rc.mediatomb.new +cp $CWD/rc.mediatomb.conf $PKG/etc/rc.d/rc.mediatomb.conf.new + +mkdir -p $PKG/etc/mediatomb +install -m 644 $CWD/config.xml $PKG/etc/mediatomb/config.xml.new +chown -R mediatomb:mediatomb $PKG/etc/mediatomb + +mkdir -p $PKG/var/{lib,log,run}/mediatomb +chown mediatomb:mediatomb $PKG/var/{lib,log,run}/mediatomb + +find $PKG/usr/man -type f -exec gzip -9 {} \; + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS ChangeLog COPYING INSTALL NEWS README TODO \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/multimedia/mediatomb/mediatomb.info b/multimedia/mediatomb/mediatomb.info new file mode 100644 index 000000000000..2ffe0063418c --- /dev/null +++ b/multimedia/mediatomb/mediatomb.info @@ -0,0 +1,10 @@ +PRGNAM="mediatomb" +VERSION="0.12.1" +HOMEPAGE="http://mediatomb.cc/" +DOWNLOAD="http://downloads.sourceforge.net/mediatomb/mediatomb-0.12.1.tar.gz" +MD5SUM="e927dd5dc52d3cfcebd8ca1af6f0d3c2" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Heinz Wiesinger" +EMAIL="pprkut@liwjatan.at" +APPROVED="rworkman" diff --git a/multimedia/mediatomb/rc.mediatomb b/multimedia/mediatomb/rc.mediatomb new file mode 100644 index 000000000000..92804835b987 --- /dev/null +++ b/multimedia/mediatomb/rc.mediatomb @@ -0,0 +1,80 @@ +#!/bin/sh +# Start/stop/restart mediatomb. +# $Id: rc.mediatomb,v 1.0 2010/11/01 +# Authors: Heinz Wiesinger +# --------------------------------------------------------------------------- + +MEDIATOMB_PIDFILE="/var/run/mediatomb/mediatomb.pid" +MEDIATOMB_LOGFILE="/var/log/mediatomb/mediatomb.log" + +# Get additional configuration information from /etc/rc.d/rc.mediatomb.conf: +. /etc/rc.d/rc.mediatomb.conf + +mediatomb_start() +{ + echo -n "Starting mediatomb ... " + if [ -e "${MEDIATOMB_PIDFILE}" ]; then + echo "already running!" + else + if [ "${MEDIATOMB_INTERFACE}" != "" ]; then + MEDIATOMB_OPTIONS="$MEDIATOMB_OPTIONS --interface ${MEDIATOMB_INTERFACE}" + fi + if [ "${MEDIATOMB_PORT}" != "" ]; then + MEDIATOMB_OPTIONS="$MEDIATOMB_OPTIONS --port ${MEDIATOMB_PORT}" + fi + /usr/bin/mediatomb \ + --daemon \ + --user ${MEDIATOMB_USER} \ + --group ${MEDIATOMB_GROUP} \ + --pidfile ${MEDIATOMB_PIDFILE} \ + --logfile ${MEDIATOMB_LOGFILE} \ + --config ${MEDIATOMB_CONFIG} \ + ${MEDIATOMB_OPTIONS} + echo "done!" + fi +} + +mediatomb_stop() +{ + echo -n "Stopping mediatomb ... " + if [ -e "${MEDIATOMB_PIDFILE}" ]; then + kill -TERM $(cat ${MEDIATOMB_PIDFILE}) > /dev/null 2>&1 + echo "done!" + rm -f "${MEDIATOMB_PIDFILE}" + else + echo "not running!" + fi +} + +mediatomb_restart() +{ + mediatomb_stop + sleep 1 + mediatomb_start +} + +mediatomb_status() +{ + if [ -e "${MEDIATOMB_PIDFILE}" ]; then + echo "mediatomb is running!" + else + echo "mediatomb is not running!" + fi +} + +case "$1" in +'start') + mediatomb_start + ;; +'stop') + mediatomb_stop + ;; +'status') + mediatomb_status + ;; +'restart') + mediatomb_restart + ;; +*) + echo "usage $0 start|stop|restart|status" +esac diff --git a/multimedia/mediatomb/rc.mediatomb.conf b/multimedia/mediatomb/rc.mediatomb.conf new file mode 100644 index 000000000000..af5ea4feef9c --- /dev/null +++ b/multimedia/mediatomb/rc.mediatomb.conf @@ -0,0 +1,21 @@ +# /etc/rc.d/rc.mediatomb.conf +# +# This file contains the configuration settings for mediatomb. + +# Main configuration file that should be used for mediatomb +MEDIATOMB_CONFIG="/etc/mediatomb/config.xml" + +# The user under which mediatomb should run +MEDIATOMB_USER="mediatomb" + +# The group under which mediatomb should run +MEDIATOMB_GROUP="mediatomb" + +# Network Interface to bind to +MEDIATOMB_INTERFACE="" + +# Server port (the SDK only permits values >= 49152) +MEDIATOMB_PORT="" + +# Additional mediatomb options +MEDIATOMB_OPTIONS="" diff --git a/multimedia/mediatomb/slack-desc b/multimedia/mediatomb/slack-desc new file mode 100644 index 000000000000..ddfff1fd22c3 --- /dev/null +++ b/multimedia/mediatomb/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------| +mediatomb: mediatomb (UPnP Media Server) +mediatomb: +mediatomb: MediaTomb is an open source (GPL) UPnP MediaServer with a nice +mediatomb: web user interface, it allows you to stream your digital media +mediatomb: through your home network and listen to/watch it on a variety +mediatomb: of UPnP compatible devices. +mediatomb: +mediatomb: Homepage: http://mediatomb.cc/ +mediatomb: +mediatomb: +mediatomb: -- cgit v1.2.3