Browse Source

ap/sfrmc: Added.

slackware-14.2
Damien Goutte-Gattat 13 years ago
parent
commit
74c87144d5
  1. 1
      ap/sfrmc/mediacenter.tgz.sha1
  2. 426
      ap/sfrmc/patch.diff
  3. 46
      ap/sfrmc/rc.sfrmc
  4. 90
      ap/sfrmc/sfrmc.SlackBuild
  5. 12
      ap/sfrmc/slack-desc

1
ap/sfrmc/mediacenter.tgz.sha1

@ -0,0 +1 @@
fc3ca4f83f3efc8b35e0315bcfad0d5729ee4212 mediacenter.tgz

426
ap/sfrmc/patch.diff

@ -0,0 +1,426 @@
diff -Naur mediacenter.orig/configure mediacenter/configure
--- mediacenter.orig/configure 2007-12-05 16:36:21.000000000 +0100
+++ mediacenter/configure 2009-05-21 23:58:16.000000000 +0200
@@ -77,7 +77,7 @@
open(CONF, $SHARES_CONFIG);
open(NEWCONF, ">$SHARES_CONFIG.temp");
if (eof(CONF)) {
- print(NEWCONF "<?\n");
+ print(NEWCONF "<?php\n");
print(NEWCONF "addShareFolder($nextId, \"$name\", \"$path\");\n");
print(NEWCONF "?>\n");
} else {
diff -Naur mediacenter.orig/httpd/httpd.conf.template-linux mediacenter/httpd/httpd.conf.template-linux
--- mediacenter.orig/httpd/httpd.conf.template-linux 2007-11-27 15:37:09.000000000 +0100
+++ mediacenter/httpd/httpd.conf.template-linux 2009-05-21 23:58:54.000000000 +0200
@@ -26,7 +26,7 @@
<IfModule !log_config_module>
LoadModule log_config_module __LIBEXEC__/mod_log_config.so
</IfModule>
-LoadModule __PHPVERSION___module __LIBEXEC__/__PHPMODULE__
+LoadModule __PHPVERSION___module __PHPMODULE__
# Process settings
PidFile httpd.pid
@@ -47,11 +47,11 @@
LogLevel error
# Configuration file location
-SetEnv ConfigFile ../../data/shares.conf
+SetEnv ConfigFile ../data/shares.conf
SetEnv OSType linux
# Types MIME
-TypesConfig /etc/mime.types
+TypesConfig /etc/httpd/mime.types
DefaultType application/octet-stream
# Directory settings
diff -Naur mediacenter.orig/httpd/mp9ctl/browse.inc.php mediacenter/httpd/mp9ctl/browse.inc.php
--- mediacenter.orig/httpd/mp9ctl/browse.inc.php 2007-11-05 14:42:12.000000000 +0100
+++ mediacenter/httpd/mp9ctl/browse.inc.php 2009-05-21 23:59:21.000000000 +0200
@@ -108,31 +108,31 @@
echo '<?xml version="1.0" encoding="utf-8" ?>'."\n";
?>
-<browse<?= ($error ? " error=\"$error\"":"") ?>>
- <?= ($parentPath ? "<parentPath>$parentPath</parentPath>" : "") ?>
+<browse<?php echo ($error ? " error=\"$error\"":"") ?>>
+ <?php echo ($parentPath ? "<parentPath>$parentPath</parentPath>" : "") ?>
<folders>
<?php for($i=0; $i<count($folders); $i++) { ?>
<folder>
- <name><?= $folders[$i]["name"] ?></name>
- <path><?= $folders[$i]["path"] ?></path>
+ <name><?php echo $folders[$i]["name"] ?></name>
+ <path><?php echo $folders[$i]["path"] ?></path>
</folder>
<?php } ?>
</folders>
<medias>
<?php for($i=0; $i<count($medias); $i++) { ?>
- <media type="<?= $medias[$i]["type"] ?>" >
- <name><?= $medias[$i]["name"] ?></name>
+ <media type="<?php echo $medias[$i]["type"] ?>" >
+ <name><?php echo $medias[$i]["name"] ?></name>
<?php if (isset($medias[$i]["urlHttp"])) { ?>
- <url type="http"><?= $medias[$i]["urlHttp"] ?></url>
+ <url type="http"><?php echo $medias[$i]["urlHttp"] ?></url>
<?php }
if (isset($medias[$i]["urlStream"])) { ?>
- <url type="stream"><?= $medias[$i]["urlStream"] ?></url>
+ <url type="stream"><?php echo $medias[$i]["urlStream"] ?></url>
<?php }
if (isset($medias[$i]["srt"])) { ?>
- <srt><?= $medias[$i]["srt"] ?></srt>
+ <srt><?php echo $medias[$i]["srt"] ?></srt>
<?php }
if (isset($medias[$i]["parentPath"])) { ?>
- <parentPath><?= $medias[$i]["parentPath"] ?></parentPath>
+ <parentPath><?php echo $medias[$i]["parentPath"] ?></parentPath>
<?php } ?>
</media>
<?php } ?>
diff -Naur mediacenter.orig/httpd/mp9ctl/common.inc.php mediacenter/httpd/mp9ctl/common.inc.php
--- mediacenter.orig/httpd/mp9ctl/common.inc.php 2007-12-05 18:08:51.000000000 +0100
+++ mediacenter/httpd/mp9ctl/common.inc.php 2009-05-21 23:59:57.000000000 +0200
@@ -47,7 +47,7 @@
define("NATIVE_SUPPORT_EXTENSION_MATCH", "/^(avi|asf|mpg|mpe|ts|mp4|m4t|wmv|divx|qt|mov|wav|aiff|aif|aifc|mpga|mp2|mp3|ogg|wma|bmp|gif|jpg|jpe|jpeg|png|tiff|tig|m3u|xspf|m4a|aac)$/");
/* Support Streamer externe */
-define("STREAMER_SUPPORT", FALSE);
+define("STREAMER_SUPPORT", TRUE);
define("STREAMER_OUT_PORT", 26134);
define("STREAMER_SUPPORT_EXTENSION_MATCH","/^(mpg|mpeg|ts|mp2|mp3|avi|asf|wmv|wma|mp4|mov|qt|3gp|aif|aiff|ogg|ogm|mkv|rmvb|ra|wav|flv)$/");
@@ -66,6 +66,7 @@
/* Liste des partages */
$shares = array();
+
/**
* Nom de la machine
*
@@ -227,6 +228,9 @@
function getDisplayNameFromFilename($filename) {
$fileinfo = pathinfo($filename);
/* Pour versions < PHP 5 */
+
+ if (is_dir($filename)) return basename($filename);
+
if (!isset($fileinfo['filename'])) {
if (strpos($fileinfo['basename'], '.') === FALSE) $filename = $fileinfo['basename'];
else $filename = substr($fileinfo['basename'], 0, strrpos($fileinfo['basename'], '.'));
@@ -308,7 +312,14 @@
*
**/
function getUrlStreamDvd($path) {
- return "http://".$_SERVER['HTTP_HOST']."/mp9ctl/?cmd=play&type=dvd&location=".urlencode(basename($path));
+ /* DVD sous Windows */
+ if (getOSType() == 'windows') {
+ return "http://".$_SERVER['HTTP_HOST']."/mp9ctl/?cmd=play&type=dvd&location=".urlencode(basename($path));
+ }
+ /* DVD sous linux */
+ if (getOSType() == 'linux') {
+ return "http://".$_SERVER['HTTP_HOST']."/mp9ctl/?cmd=play&type=dvd&location=".urlencode($path);
+ }
}
/**
@@ -365,6 +376,10 @@
if (getOSType() == 'windows') {
if (is_dir(basename($filename)."/VIDEO_TS") && is_file(basename($filename)."/VIDEO_TS/VIDEO_TS.VOB")) return true;
}
+ /* Detection DVD sous linux */
+ if (getOSType() == 'linux') {
+ if (is_dir($filename."/VIDEO_TS") && is_file($filename."/VIDEO_TS/VIDEO_TS.VOB")) return true;
+ }
return false;
}
diff -Naur mediacenter.orig/httpd/mp9ctl/config.php mediacenter/httpd/mp9ctl/config.php
--- mediacenter.orig/httpd/mp9ctl/config.php 2007-11-05 14:42:12.000000000 +0100
+++ mediacenter/httpd/mp9ctl/config.php 2009-05-22 00:00:25.000000000 +0200
@@ -248,7 +248,7 @@
var shares = new Array();
var prevShares = new Array();
<?php foreach($shares as $share) { ?>
- prevShares.push( {name: '<?= $share['name'] ?>', path: '<?= addslashes($share['path']) ?>' });
+ prevShares.push( {name: '<?php echo $share['name'] ?>', path: '<?php echo addslashes($share['path']) ?>' });
<?php } ?>
function init() {
if (!location.href.match(/mode=tree/)) {
@@ -302,7 +302,7 @@
</div>
<div class="zone">
<div class="tab">Ajouter un partage</div>
- <form id="form" action="<?= $_PHPSELF ?>" method="POST" target="_blank" >
+ <form id="form" action="<?php echo $_PHPSELF ?>" method="POST" target="_blank" >
<input type="hidden" name="file" value="" />
<div class="zoneContent">
Remarque : les fichiers et dossiers doivent &ecirc;tre accessibles en lecture.<br />
@@ -317,7 +317,7 @@
else { ?>
<div class="zone">
<div class="tab">S&eacute;lection des partages</div>
- <form id="form" action="<?= $_PHPSELF ?>" method="POST" target="_blank" >
+ <form id="form" action="<?php echo $_PHPSELF ?>" method="POST" target="_blank" >
<input type="hidden" name="file" value="" />
<div class="zoneContent">
Cochez les dossiers &agrave; partager<br /><input type="hidden" name="folderName" size="40" />
@@ -334,7 +334,7 @@
<div id="createFile1">
<table class="list">
<tr>
- <th>Appuyez sur le bouton suivant et<br />enregistrez le fichier <b>shares.conf</b><br /> dans le dossier <b><?= $configFile1 ?></b>.</th>
+ <th>Appuyez sur le bouton suivant et<br />enregistrez le fichier <b>shares.conf</b><br /> dans le dossier <b><?php echo $configFile1 ?></b>.</th>
<td><input type="button" value="G&eacute;n&eacute;rer le fichier de configuration 1/2" onClick="createFile('file1')"/></td>
</tr>
</table>
@@ -343,7 +343,7 @@
<div id="createFile2">
<table class="list">
<tr>
- <th>Appuyez sur le bouton suivant et<br />enregistrez le fichier <b>httpshares.conf</b><br />dans le dossier <b><?= $configFile2 ?></b>.</th>
+ <th>Appuyez sur le bouton suivant et<br />enregistrez le fichier <b>httpshares.conf</b><br />dans le dossier <b><?php echo $configFile2 ?></b>.</th>
<td><input type="button" value="G&eacute;n&eacute;rer le fichier de configuration 2/2" onClick="createFile('file2')"/></td>
</tr>
</table>
diff -Naur mediacenter.orig/httpd/mp9ctl/playlist.inc.php mediacenter/httpd/mp9ctl/playlist.inc.php
--- mediacenter.orig/httpd/mp9ctl/playlist.inc.php 2007-11-05 14:42:12.000000000 +0100
+++ mediacenter/httpd/mp9ctl/playlist.inc.php 2009-05-22 00:00:37.000000000 +0200
@@ -117,8 +117,8 @@
<head>
<script language='Javascript' type='text/javascript'>
function init() {
- if (typeof(opener.control.mediaCenter.servicesList["<?= $serviceId ?>"].playlistSaved == 'function'))
- opener.control.mediaCenter.servicesList["<?= $serviceId ?>"].playlistSaved("<?= $result ?>");
+ if (typeof(opener.control.mediaCenter.servicesList["<?php echo $serviceId ?>"].playlistSaved == 'function'))
+ opener.control.mediaCenter.servicesList["<?php echo $serviceId ?>"].playlistSaved("<?php echo $result ?>");
}
</script>
</head>
diff -Naur mediacenter.orig/httpd/mp9ctl/status.inc.php mediacenter/httpd/mp9ctl/status.inc.php
--- mediacenter.orig/httpd/mp9ctl/status.inc.php 2007-11-05 14:42:12.000000000 +0100
+++ mediacenter/httpd/mp9ctl/status.inc.php 2009-05-22 00:00:48.000000000 +0200
@@ -24,11 +24,11 @@
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta hostname="<?= $serverName ?>" />
- <meta os="<?= $serverOS ?>" />
- <meta version="<?= VERSION ?>" />
+ <meta hostname="<?php echo $serverName ?>" />
+ <meta os="<?php echo $serverOS ?>" />
+ <meta version="<?php echo VERSION ?>" />
<?php foreach(getInterfacesList() as $interface) { ?>
- <meta interface="<?= $interface['url'] ?>" name="<?= $interface['name'] ?>" />
+ <meta interface="<?php echo $interface['url'] ?>" name="<?php echo $interface['name'] ?>" />
<?php } ?>
<title>MediaCenter - Neuf TV HD</title>
<link rel="StyleSheet" href="../style.css" type="text/css" />
@@ -40,9 +40,9 @@
<div class="tab">Informations g&eacute;n&eacute;rales</div>
<div class="zoneContent">
<table class="list">
- <tr><th>Version</th><td><?= VERSION ?></td></tr>
- <tr><th>Date</th><td><?= strftime('%d/%m/%Y', strtotime(VERSION_DATE)) ?></td></tr>
- <tr><th>OS</th><td><?= $serverOS ?></td></tr>
+ <tr><th>Version</th><td><?php echo VERSION ?></td></tr>
+ <tr><th>Date</th><td><?php echo strftime('%d/%m/%Y', strtotime(VERSION_DATE)) ?></td></tr>
+ <tr><th>OS</th><td><?php echo $serverOS ?></td></tr>
</table>
</div>
</div>
@@ -52,7 +52,7 @@
<table class="list">
<tr><th>#</th><th>Nom du partage</th><th>Chemin d'acc&egrave;s</th></tr>
<?php $i = 1; foreach ($shares as $share) { ?>
- <tr><td><?= $i++ ?></td><td><?= $share['name'] ?></td><td><?= $share['path'] ?></td></tr>
+ <tr><td><?php echo $i++ ?></td><td><?php echo $share['name'] ?></td><td><?php echo $share['path'] ?></td></tr>
<?php } ?>
</table>
<br />
@@ -67,7 +67,7 @@
<table class="list">
<tr><th>#</th><th>Nom de l'interface</th></tr>
<?php $i = 1; foreach (getInterfacesList() as $interface) { ?>
- <tr><td><?= $i++ ?></td><td><?= $interface['name'] ?></td></tr>
+ <tr><td><?php echo $i++ ?></td><td><?php echo $interface['name'] ?></td></tr>
<?php } ?>
</table>
</div>
diff -Naur mediacenter.orig/httpd/mp9ctl/streamer.inc.php mediacenter/httpd/mp9ctl/streamer.inc.php
--- mediacenter.orig/httpd/mp9ctl/streamer.inc.php 2007-11-05 14:42:12.000000000 +0100
+++ mediacenter/httpd/mp9ctl/streamer.inc.php 2009-05-22 00:01:00.000000000 +0200
@@ -82,13 +82,13 @@
echo '<?xml version="1.0" encoding="iso-8859-1" ?>'."\n";
?>
<status>
- <currentStatus><?= $status['currentStatus'] ?></currentStatus>
- <duration><?= $status['duration'] ?></duration>
- <currentPosition><?= $status['currentPosition'] ?></currentPosition>
+ <currentStatus><?php echo $status['currentStatus'] ?></currentStatus>
+ <duration><?php echo $status['duration'] ?></duration>
+ <currentPosition><?php echo $status['currentPosition'] ?></currentPosition>
<?php foreach($status['audio'] as $audio) { ?>
- <audio code="<?= $audio['code'] ?>"><?= $audio['name'] ?></audio>
+ <audio code="<?php echo $audio['code'] ?>"><?php echo $audio['name'] ?></audio>
<?php }
foreach($status['subtitles'] as $subs) { ?>
- <subtitles code="<?= $subs['code'] ?>"><?= $subs['name'] ?></subtitles>
+ <subtitles code="<?php echo $subs['code'] ?>"><?php echo $subs['name'] ?></subtitles>
<?php } ?>
</status>
diff -Naur mediacenter.orig/httpd/mp9ctl/toplist.inc.php mediacenter/httpd/mp9ctl/toplist.inc.php
--- mediacenter.orig/httpd/mp9ctl/toplist.inc.php 2007-11-05 14:42:12.000000000 +0100
+++ mediacenter/httpd/mp9ctl/toplist.inc.php 2009-05-22 00:01:08.000000000 +0200
@@ -20,9 +20,9 @@
<?php
foreach($shares as $share) {
if (isset($share['type'])) { ?>
- <childDevice type="<?= $share['type'] ?>" readOnly="<?= $share['readOnly'] ?>" >
- <name><?= $share['name'] ?></name>
- <path><?= $share['id'] ?></path>
+ <childDevice type="<?php echo $share['type'] ?>" readOnly="<?php echo $share['readOnly'] ?>" >
+ <name><?php echo $share['name'] ?></name>
+ <path><?php echo $share['id'] ?></path>
</childDevice>
<?php }
} ?>
@@ -32,8 +32,8 @@
foreach($shares as $share) {
if (!isset($share['type'])) { ?>
<folder>
- <name><?= $share['name'] ?></name>
- <path><?= $share['id'] ?></path>
+ <name><?php echo $share['name'] ?></name>
+ <path><?php echo $share['id'] ?></path>
</folder>
<?php }
} ?>
diff -Naur mediacenter.orig/mediacenter mediacenter/mediacenter
--- mediacenter.orig/mediacenter 2007-12-05 17:49:00.000000000 +0100
+++ mediacenter/mediacenter 2009-05-22 00:01:51.000000000 +0200
@@ -14,7 +14,9 @@
HTTPD_CONF=$HTTPD_DIR/httpd.conf
HTTP_PID=$HTTPD_DIR/httpd.pid
APACHEBIN_LIST="/usr/sbin/apache2 /usr/sbin/httpd2 /usr/sbin/apache /usr/sbin/httpd"
-LIBEXEC_LIST="/usr/lib/apache2/modules /usr/lib/apache2 /usr/lib/apache /usr/libexec/httpd /usr/libexec/apache2 /usr/lib/apache/1.3 /usr/local/apache/libexec /usr/lib/httpd/modules"
+LIBEXEC_LIST="/usr/lib/apache2/modules /usr/lib/apache2 /usr/lib/apache /usr/libexec/httpd /usr/libexec/apache2 /usr/lib/apache/1.3 /usr/local/apache/libexec /usr/lib/httpd/modules /usr/lib/apache-extramodules /usr/lib64/httpd/modules /usr/lib64/apache /usr/lib64/apache2/modules /usr/lib64/apache2 /usr/lib64/apache-extramodules"
+MIME_LIST="/etc/mime.types /etc/httpd/conf/mime.types"
+MIME=""
HTTPD="NONE"
LIBEXEC="NONE"
PHPVERSION_LIST="php5 php4"
@@ -34,21 +36,26 @@
for b in $APACHEBIN_LIST; do
[ -e "$b" ] && HTTPD="$b" && break
done
+ for m in $MIME_LIST; do
+ [ -e "$m" ] && MIME="$m" && break
+ done
for d in $LIBEXEC_LIST; do
[ -e "$d/mod_info.so" ] && LIBEXEC="$d" && break
done
- for v in $PHPVERSION_LIST; do
- if [ -e "$LIBEXEC/lib$v.so" ]; then
- PHPVERSION="$v"
- PHPMODULE="lib$v.so"
- break
- else
- if [ -e "$LIBEXEC/mod_$v.so" ]; then
- PHPVERSION="$v"
- PHPMODULE="mod_$v.so"
- break
- fi
- fi
+ for d in $LIBEXEC_LIST; do
+ for v in $PHPVERSION_LIST; do
+ if [ -e "$d/lib$v.so" ]; then
+ PHPVERSION="$v"
+ PHPMODULE="$d/lib$v.so"
+ break
+ else
+ if [ -e "$d/mod_$v.so" ]; then
+ PHPVERSION="$v"
+ PHPMODULE="$d/mod_$v.so"
+ break
+ fi
+ fi
+ done
done
}
@@ -78,7 +85,7 @@
for ip in $IPLAN; do echo "Listen $ip:26180" >> $HTTPSERVER_CONF; done
echo "User $USER" >> $HTTPSERVER_CONF
echo "Group $GROUP" >> $HTTPSERVER_CONF
- sed -e "s#__LIBEXEC__#$LIBEXEC#g" -e "s#__PHPVERSION__#$PHPVERSION#g" -e "s#__PHPMODULE__#$PHPMODULE#g" "$HTTPD_CONF_TPL" > "$HTTPD_CONF"
+ sed -e "s#__LIBEXEC__#$LIBEXEC#g" -e "s#__PHPVERSION__#$PHPVERSION#g" -e "s#__PHPMODULE__#$PHPMODULE#g" -e "s#__MIME__#$MIME#g" "$HTTPD_CONF_TPL" > "$HTTPD_CONF"
touch $DATA_DIR/access.log
touch $DATA_DIR/error.log
}
@@ -89,7 +96,7 @@
echo "Alias /__mp9ctl_share_2/ \"/Users/$USER/Music/\"" >> $HTTPSHARES_CONF
echo "Alias /__mp9ctl_share_3/ \"/Users/$USER/Pictures/\"" >> $HTTPSHARES_CONF
echo "<?php" >> $SHARES_CONF
- echo "addShareFolder(1, \"Séquences\", \"/Users/$USER/Movies\");" >> $SHARES_CONF
+ echo "addShareFolder(1, \"S�quences\", \"/Users/$USER/Movies\");" >> $SHARES_CONF
echo "addShareFolder(2, \"Musique\", \"/Users/$USER/Music\");" >> $SHARES_CONF
echo "addShareFolder(3, \"Images\", \"/Users/$USER/Pictures\");" >> $SHARES_CONF
echo "?>" >> $SHARES_CONF
@@ -130,23 +137,43 @@
if [ "$LIBEXEC" == "NONE" ]; then
echo "Modules Apache non trouves !"
- exit 255
+ exit 255Module
fi
if [ "$PHPVERSION" == "NONE" ]; then
- echo "Module PHP 4 ou 5 non trouve !"
+ echo "Version PHP 4 ou 5 non trouve !"
exit 255
fi
if [ "$PHPMODULE" == "NONE" ]; then
echo "Module PHP 4 ou 5 non trouve !"
exit 255
fi
+ if [ "$MIME" == "NONE" ]; then
+ echo "mime.types non trouve !"
+ exit 255
+ fi
+}
+
+check_current_dir() {
+ LAUNCHDIR=`pwd`
+ BIN=`basename $0`
+ if [ -f "$LAUNCHDIR/$BIN" ]; then
+ if [ -h "$LAUNCHDIR/$BIN" ]; then
+ echo "$BIN doit etre lance depuis son repertoire"
+ exit 254
+ fi
+ echo "Ready to launch $BIN"
+ else
+ echo "$BIN doit etre lance depuis son répertoire!"
+ exit 254
+ fi
}
case "$1" in
start)
is_running && $0 stop
check_not_root
+ check_current_dir
get_apache_bin
check_needed_available
create_config
@@ -158,6 +185,7 @@
stop)
echo -n "Arret du MediaCenter ..."
[ -e "$HTTP_PID" ] && kill `cat "$HTTP_PID"`
+ sleep 1
echo " OK !"
;;
restart)

46
ap/sfrmc/rc.sfrmc

@ -0,0 +1,46 @@
#!/bin/sh
SFRMC_HOME=/opt/sfrmc
SFRMC_USER=
SFRMC_CONF=/etc/sfrmc.conf
sfrmc_start() {
if [ ! -f $SFRMC_CONF ]; then
echo "No config file ($SFRMC_CONF) found!"
exit 1
fi
cd $SFRMC_HOME
awk -F: 'BEGIN { print "<?php" }
{ printf "addShareFolder(%d, \"%s\", \"%s\");\n", ++i, $1, $2 }
END { print "?>" }' $SFRMC_CONF > data/shares.conf
awk -F: '{ printf "Alias /__mp9ctl_share_%d/ \"%s/\"\n", ++i, $2 }' \
$SFRMC_CONF > data/httpshares.conf
chown damien data/shares.conf data/httpshares.conf
su $SFRMC_USER -c "$SFRMC_HOME/mediacenter start"
}
sfrmc_stop() {
cd $SFRMC_HOME
su $SFRMC_USER -c "$SFRMC_HOME/mediacenter stop"
}
sfrmc_restart() {
sfrmc_stop
sleep 1
sfrmc_start
}
case "$1" in
start)
sfrmc_start
;;
stop)
sfrmc_stop
;;
restart)
sfrmc_restart
;;
*)
echo "usage: $0 start|stop|restart"
exit 1
esac

90
ap/sfrmc/sfrmc.SlackBuild

@ -0,0 +1,90 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2009 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# 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.
#
# Contact: Damien Goutte-Gattat <damien.goutte-gattat@e.ujf-grenoble.fr>
#
# Latest sfrmc sourcecode is available at:
# <http://maj.neuf.fr/web/mediacenter/>.
# Source package infos
NAMESRC=${NAMESRC:-mediacenter}
VERSION=${VERSION:-1.2}
ARCHIVE=${ARCHIVE:-$NAMESRC.tgz}
WGET=${WGET:-http://maj.neuf.fr/web/mediacenter/$ARCHIVE}
# Built package infos
NAMETGZ=${NAMETGZ:-sfrmc}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-i486}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMETGZ}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP does not exist or is not a directory!"
exit 1
fi
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
wget -c -O $ARCHIVE.part "$WGET"
mv $ARCHIVE.part $ARCHIVE
fi
sha1sum -c $ARCHIVE.sha1
# Extract and patch
mkdir -p $PKG/opt
cd $PKG/opt
tar xf $CWD/$ARCHIVE
mv mediacenter sfrmc
cd sfrmc
patch -p 1 < $CWD/patch.diff
# Install startup script
install -D -m 644 $CWD/rc.sfrmc $PKG/etc/rc.d/rc.sfrmc
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMETGZ-$VERSION-$ARCH-$BUILD.tgz
rm -rf $PKG
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi

12
ap/sfrmc/slack-desc

@ -0,0 +1,12 @@
|-----handy-ruler------------------------------------------------------|
sfrmc: sfrmc (SFR Media Center)
sfrmc:
sfrmc: This package installs the SFR Media Center server needed to share
sfrmc: local multimedia files to a NeufBox system.
sfrmc:
sfrmc:
sfrmc:
sfrmc:
sfrmc:
sfrmc:
sfrmc:
Loading…
Cancel
Save