Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=9eedbe6600d1d556bd3223612f1f42b2fbcd0507

commit 9eedbe6600d1d556bd3223612f1f42b2fbcd0507
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Mon Mar 22 17:47:20 2010 +0000

mediatomb-0.11.0-1-i686
*new package

diff --git a/source/network-extra/mediatomb/FrugalBuild 
b/source/network-extra/mediatomb/FrugalBuild
new file mode 100644
index 0000000..ba341b9
--- /dev/null
+++ b/source/network-extra/mediatomb/FrugalBuild
@@ -0,0 +1,33 @@
+# Compiling Time: 0.11 SBU
+# Maintainer: bouleetbil <bouleet...@frogdev.info>
+
+pkgname=mediatomb
+pkgver=0.11.0
+pkgrel=1
+pkgdesc="MediaTomb is an open source (GPL) UPnP MediaServer"
+depends=('taglib' 'libexif' 'ffmpeg' 'curl' 'spidermonkey' 'sqlite3' 'id3lib')
+groups=('network-extra')
+archs=('i686')
+options=('scriptlet')
+Finclude sourceforge
+url=http://mediatomb.cc
+source=($source README.Frugalware rc.mediatomb mediatomb.sysconfig 
'mediatomb.config' \
+       glibc.diff curl.diff ffmpeg.diff)
+signatures=("http://mediatomb.cc/$pkgver/$pkgname-$pkgver.tar.gz.asc"; "" "" "" 
\
+       "" "" "" "")
+install=$pkgname.install
+backup=(etc/mediatomb/config.xml etc/sysconfig/mediatomb)
+
+build() {
+       Fpatchall
+       Fautoreconf
+       Fmake
+       Fmakeinstall
+       Fmkdir etc/sysconfig
+       Ffile mediatomb.sysconfig /etc/sysconfig/mediatomb
+       Frcd2 mediatomb
+       Fmkdir etc/mediatomb
+       Fcp mediatomb.config etc/mediatomb/config.xml
+}
+
+# optimization OK
diff --git a/source/network-extra/mediatomb/README.Frugalware 
b/source/network-extra/mediatomb/README.Frugalware
new file mode 100644
index 0000000..7d4d1d7
--- /dev/null
+++ b/source/network-extra/mediatomb/README.Frugalware
@@ -0,0 +1,7 @@
+The MediaTomb Web UI can be reached at:
+http://localhost:49152/
+To start MediaTomb:
+# service mediatomb start
+To start MediaTomb at boot:
+# service mediatomb add
+
diff --git a/source/network-extra/mediatomb/curl.diff 
b/source/network-extra/mediatomb/curl.diff
new file mode 100644
index 0000000..e17716c
--- /dev/null
+++ b/source/network-extra/mediatomb/curl.diff
@@ -0,0 +1,14 @@
+Index: mediatomb-0.11.0/src/url.cc
+===================================================================
+--- mediatomb-0.11.0.orig/src/url.cc
++++ mediatomb-0.11.0/src/url.cc
+@@ -75,7 +75,7 @@
+
+     if (only_header)
+     {
+-        curl_easy_setopt(curl_handle, CURLOPT_NOBODY);
++        curl_easy_setopt(curl_handle, CURLOPT_NOBODY, TRUE);
+         curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, URL::dl);
+         curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA,
+                          (void *)buffer.getPtr());
+
diff --git a/source/network-extra/mediatomb/ffmpeg.diff 
b/source/network-extra/mediatomb/ffmpeg.diff
new file mode 100644
index 0000000..7b4a0a3
--- /dev/null
+++ b/source/network-extra/mediatomb/ffmpeg.diff
@@ -0,0 +1,78 @@
+Index: mediatomb-0.11.0/configure.ac
+===================================================================
+--- mediatomb-0.11.0.orig/configure.ac
++++ mediatomb-0.11.0/configure.ac
+@@ -2340,9 +2340,14 @@ if test "x$FFMPEG_OK" = xyes; then
+                 ]
+         )
+     else
+-        AC_CHECK_HEADER(ffmpeg/avformat.h,
+-            [],
++        AC_CHECK_HEADERS([ffmpeg/avformat.h libavformat/avformat.h],
++            [ffmpeg_found=yes; break;], [],
+             [
++                #define __STDC_CONSTANT_MACROS
++                #include <stdint.h>
++            ]
++        )
++      if test "x$ffmpeg_found" != "xyes"; then
+                 CPPFLAGS="-I$SEARCH_DIR_HEADERS"
+                 unset ac_cv_header_ffmpeg_avformat_h
+                 AC_CHECK_HEADER($SEARCH_DIR_HEADERS/ffmpeg/avformat.h,
+@@ -2357,12 +2362,7 @@ if test "x$FFMPEG_OK" = xyes; then
+                         #include <stdint.h>
+                     ]
+                 )
+-            ],
+-            [
+-                #define __STDC_CONSTANT_MACROS
+-                #include <stdint.h>
+-            ]
+-        )
++      fi
+     fi
+ fi
+
+@@ -2447,7 +2447,11 @@ if test "x$FFMPEG_OK" = xyes; then
+             [
+                 #define __STDC_CONSTANT_MACROS
+                 #include <stdint.h>
++              #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
++              #include <libavformat/avformat.h>
++              #else
+                 #include <ffmpeg/avformat.h>
++              #endif
+             ],
+             [
+                 av_register_all();
+@@ -2462,7 +2466,11 @@ if test "x$FFMPEG_OK" = xyes; then
+                     #define __STDC_CONSTANT_MACROS
+                     #include <stdint.h>
+                     extern "C" {
+-                        #include <ffmpeg/avformat.h>
++                        #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
++                      #include <libavformat/avformat.h>
++                      #else
++                      #include <ffmpeg/avformat.h>
++                      #endif
+                     }
+                 ],
+                 [
+Index: mediatomb-0.11.0/src/metadata/ffmpeg_handler.cc
+===================================================================
+--- mediatomb-0.11.0.orig/src/metadata/ffmpeg_handler.cc
++++ mediatomb-0.11.0/src/metadata/ffmpeg_handler.cc
+@@ -56,7 +56,11 @@ extern "C"
+ {
+ #endif
+
+-#include <ffmpeg/avformat.h>
++#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
++# include <libavformat/avformat.h>
++#else
++# include <ffmpeg/avformat.h>
++#endif
+
+ #ifdef FFMPEG_NEEDS_EXTERN_C
+ } // extern "C"
+
diff --git a/source/network-extra/mediatomb/glibc.diff 
b/source/network-extra/mediatomb/glibc.diff
new file mode 100644
index 0000000..a2ad64f
--- /dev/null
+++ b/source/network-extra/mediatomb/glibc.diff
@@ -0,0 +1,25 @@
+Index: src/tools.cc
+===================================================================
+--- src/tools.cc       (revisione 2018)
++++ src/tools.cc       (copia locale)
+@@ -303,8 +303,8 @@
+     Ref<StringBuffer> buf(new StringBuffer(len / 2));
+     for (int i = 0; i < len; i += 2)
+     {
+-        char *chi = strchr(HEX_CHARS, ptr[i]);
+-        char *clo = strchr(HEX_CHARS, ptr[i + 1]);
++        const char *chi = strchr(HEX_CHARS, ptr[i]);
++        const char *clo = strchr(HEX_CHARS, ptr[i + 1]);
+         int hi, lo;
+
+         if (chi)
+@@ -397,7 +397,7 @@
+             char clo = data[i++];
+             int hi, lo;
+
+-            char *pos;
++            const char *pos;
+
+             pos = strchr(hex, chi);
+             if (!pos)
+
diff --git a/source/network-extra/mediatomb/mediatomb.config 
b/source/network-extra/mediatomb/mediatomb.config
new file mode 100644
index 0000000..5d8741a
--- /dev/null
+++ b/source/network-extra/mediatomb/mediatomb.config
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<config version="1" xmlns="http://mediatomb.cc/config/1"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://mediatomb.cc/config/1 
http://mediatomb.cc/config/1.xsd";>
+  <server>
+    <ui enabled="yes">
+      <accounts enabled="no" session-timeout="30">
+        <account user="mediatomb" password="mediatomb"/>
+      </accounts>
+    </ui>
+    <name>MediaTomb</name>
+    <udn></udn>
+    <home>/var/lib/mediatomb</home>
+    <webroot>/usr/share/mediatomb/web</webroot>
+    <storage>
+      <sqlite3 enabled="yes">
+        <database-file>mediatomb.db</database-file>
+      </sqlite3>
+      <mysql enabled="no">
+        <host>localhost</host>
+        <database>mediatomb</database>
+        <username>mediatomb</username>
+        <password>mediatomb</password>
+      </mysql>
+    </storage>
+    <protocolInfo extend="no"/>
+  </server>
+  <import hidden-files="no">
+    <scripting script-charset="UTF-8">
+      <common-script>/usr/share/mediatomb/js/common.js</common-script>
+      <playlist-script>/usr/share/mediatomb/js/playlists.js</playlist-script>
+      <virtual-layout type="builtin">
+        <import-script>/usr/share/mediatomb/js/import.js</import-script>
+      </virtual-layout>
+    </scripting>
+    <mappings>
+      <extension-mimetype ignore-unknown="no">
+        <map from="mp3" to="audio/mpeg"/>
+        <map from="ogg" to="application/ogg"/>
+        <map from="asf" to="video/x-ms-asf"/>
+        <map from="asx" to="video/x-ms-asf"/>
+        <map from="wma" to="audio/x-ms-wma"/>
+        <map from="wax" to="audio/x-ms-wax"/>
+        <map from="wmv" to="video/x-ms-wmv"/>
+        <map from="wvx" to="video/x-ms-wvx"/>
+        <map from="wm" to="video/x-ms-wm"/>
+        <map from="wmx" to="video/x-ms-wmx"/>
+        <map from="m3u" to="audio/x-mpegurl"/>
+        <map from="pls" to="audio/x-scpls"/>
+        <map from="flv" to="video/x-flv"/>
+      </extension-mimetype>
+      <mimetype-upnpclass>
+        <map from="audio/*" to="object.item.audioItem.musicTrack"/>
+        <map from="video/*" to="object.item.videoItem"/>
+        <map from="image/*" to="object.item.imageItem"/>
+      </mimetype-upnpclass>
+      <mimetype-contenttype>
+        <treat mimetype="audio/mpeg" as="mp3"/>
+        <treat mimetype="application/ogg" as="ogg"/>
+        <treat mimetype="audio/x-flac" as="flac"/>
+        <treat mimetype="image/jpeg" as="jpg"/>
+        <treat mimetype="audio/x-mpegurl" as="playlist"/>
+        <treat mimetype="audio/x-scpls" as="playlist"/>
+        <treat mimetype="audio/x-wav" as="pcm"/>
+        <treat mimetype="audio/L16" as="pcm"/>
+        <treat mimetype="video/x-msvideo" as="avi"/>
+      </mimetype-contenttype>
+    </mappings>
+  </import>
+</config>
+
diff --git a/source/network-extra/mediatomb/mediatomb.install 
b/source/network-extra/mediatomb/mediatomb.install
new file mode 100644
index 0000000..4b7708f
--- /dev/null
+++ b/source/network-extra/mediatomb/mediatomb.install
@@ -0,0 +1,32 @@
+post_install() {
+        if ! grep -q 'mediatomb' /etc/group; then
+               #create group
+               /usr/sbin/groupadd -g 66 mediatomb 2>/dev/null
+               #create user
+               /usr/sbin/useradd -s /bin/false -c "daemon system user 
mediatomb" -d /var/lib/mediatomb -u 66 -g mediatomb mediatomb 2>/dev/null
+        fi
+       mkdir -p /var/run/mediatomb 2>/dev/null
+       chown -R mediatomb.mediatomb /var/run/mediatomb
+       mkdir -p /var/lib/mediatomb 2>/dev/null
+       chown -R mediatomb.mediatomb /var/lib/mediatomb
+       chown mediatomb.mediatomb /etc/mediatomb/config.xml
+
+}
+
+post_upgrade()
+{
+       post_install
+}
+
+pre_remove()
+{
+       rm -rf /var/run/mediatomb 2>/dev/null
+       rm -rf /var/lib/mediatomb 2>/dev/null
+       userdel mediatomb 2>/dev/null
+       groupdel mediatomb 2>/dev/null
+
+}
+
+op=$1
+shift
+$op $*
diff --git a/source/network-extra/mediatomb/mediatomb.sysconfig 
b/source/network-extra/mediatomb/mediatomb.sysconfig
new file mode 100644
index 0000000..75db860
--- /dev/null
+++ b/source/network-extra/mediatomb/mediatomb.sysconfig
@@ -0,0 +1,31 @@
+# See the mediatomb(1) manpage for more info.
+
+# MediaTomb Web UI port.
+# NOTE: The minimum value allowed is 49152
+MEDIATOMB_PORT=49152
+
+# Bind MediaTomb to this interface
+MEDIATOMB_INTERFACE="eth0"
+
+# Run MediaTomb as this user.
+# NOTE: It is not recommended to run MediaTomb as root for
+#       security reasons.
+MEDIATOMB_USER="mediatomb"
+
+# Run MediaTomb as this group.
+# NOTE: It is not recommended to run MediaTomb as root for
+#       security reasons.
+MEDIATOMB_GROUP="mediatomb"
+
+# Path to MediaTomb config file.
+MEDIATOMB_CONFIG="/etc/mediatomb/config.xml"
+
+# Path to MediaTomb log file.
+MEDIATOMB_LOGFILE="/var/log/mediatomb.log"
+
+# Path to MediaTomb pid file.
+MEDIATOMB_PIDFILE="/var/run/mediatomb/mediatomb.pid"
+
+# Other options you want to pass to MediaTomb.
+MEDIATOMB_OPTIONS=""
+
diff --git a/source/network-extra/mediatomb/rc.mediatomb 
b/source/network-extra/mediatomb/rc.mediatomb
new file mode 100644
index 0000000..79c59be
--- /dev/null
+++ b/source/network-extra/mediatomb/rc.mediatomb
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# (c) 2010 bouleetbil <bouleet...@frogdev.info>
+# rc.mediatomb for FrugalWare
+# distributed under GPL License
+
+# chkconfig: 2345 99 02
+# description: UPnP MediaServer.
+
+source /lib/initscripts/functions
+TEXTDOMAIN=mediatomb
+TEXTDOMAINDIR=/lib/initscripts/messages
+daemon="mediatomb"
+
+actions=(restart start status stop)
+
+pid="pidof /usr/bin/mediatomb 2> /dev/null"
+[ -e /etc/sysconfig/mediatomb ] && . /etc/sysconfig/mediatomb
+
+rc_start()
+{
+       start_msg
+       if [ -z "$(eval $pid)" ]; then
+               /usr/bin/mediatomb \
+               --config $MEDIATOMB_CONFIG \
+               --daemon \
+               --user $MEDIATOMB_USER \
+               --group $MEDIATOMB_GROUP \
+               --logfile $MEDIATOMB_LOGFILE \
+               --port $MEDIATOMB_PORT \
+               --pidfile $MEDIATOMB_PIDFILE \
+               --interface $MEDIATOMB_INTERFACE $MEDIATOMB_OPTIONS
+               ok $?
+       else
+               ok 999
+       fi
+
+}
+
+rc_stop()
+{
+       stop_msg
+       if [ ! -z "$(eval $pid)" ] ;then
+               kill $(eval $pid) 2>/dev/null 1>/dev/null
+               ok $?
+       else
+               ok 999
+       fi
+}
+
+rc_exec $1
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to