summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Hernández Blas <hba.nihilismus@gmail.com>2011-12-22 23:56:54 -0600
committerNiels Horn <niels.horn@slackbuilds.org>2011-12-23 14:05:43 -0200
commitf1952461b1ee94cf2b1b96ae764f67beb1d2f2e2 (patch)
tree576b1b516d0d6d9de7b9a62f183fcb830002c317
parent7bf998ee43c7d4f26d1343053a745531f23c072d (diff)
downloadslackbuilds-f1952461b1ee94cf2b1b96ae764f67beb1d2f2e2.tar.gz
audio/ices-cc: Added (primary source client for icecast)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
-rw-r--r--audio/ices-cc/README5
-rw-r--r--audio/ices-cc/README.init30
-rw-r--r--audio/ices-cc/doinst.sh28
-rw-r--r--audio/ices-cc/ices-cc.SlackBuild106
-rw-r--r--audio/ices-cc/ices-cc.info10
-rw-r--r--audio/ices-cc/rc.ices-cc80
-rw-r--r--audio/ices-cc/slack-desc19
7 files changed, 278 insertions, 0 deletions
diff --git a/audio/ices-cc/README b/audio/ices-cc/README
new file mode 100644
index 0000000000..819a2bc1f6
--- /dev/null
+++ b/audio/ices-cc/README
@@ -0,0 +1,5 @@
+ices-cc is a Source client for broadcasting in MP3 format to an icecast server.
+
+This requires libshout. lame is optional (if you want re-encoding support).
+
+See README.init if you plan to use /etc/rc.d/rc.ices-cc
diff --git a/audio/ices-cc/README.init b/audio/ices-cc/README.init
new file mode 100644
index 0000000000..3d290af089
--- /dev/null
+++ b/audio/ices-cc/README.init
@@ -0,0 +1,30 @@
+README.init for ices-cc
+
+These steps are only needed if you plan to use /etc/rc.d/rc.ices-cc
+
+The user/group 'ices-cc' is required to exist in your system. You
+can add it with:
+
+ # groupadd -g 255 ices-cc
+ # useradd -u 255 -g 255 -c "User for ices-cc" -d / -s /bin/sh ices-cc
+ # passwd -l ices-cc
+
+See http://slackbuilds.org/uid_gid.txt for info re uid/gid selection.
+
+
+You should edit /etc/ices-cc.conf and pay attention to playlist.txt
+because the "ices-cc" user should have read access to t$playlist.txt file.
+For example, if $playlist is /var/cache/ices-cc-playlist.txt:
+
+ # touch /var/cache/ices-playlist.txt
+ # chown ices-cc:ices-cc /var/cache/ices-playlist.txt
+
+Then add your files to the playlist:
+
+ # find /music -iname "*.mp3" > /var/cache/ices-playlist.txt
+ # chown -R ices-cc:ices-cc /music
+
+Also, the ices user should have full access to /var/log/ices
+
+ # chown -R ices-cc:ices-cc /var/log/ices
+
diff --git a/audio/ices-cc/doinst.sh b/audio/ices-cc/doinst.sh
new file mode 100644
index 0000000000..e159d03a89
--- /dev/null
+++ b/audio/ices-cc/doinst.sh
@@ -0,0 +1,28 @@
+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
+}
+
+preserve_perms etc/rc.d/rc.ices-cc.new
+config etc/ices-cc.conf.new
+config etc/modules/ices.py.new
+config etc/modules/ices.pm.new
+config etc/modules/ices.sh.new
diff --git a/audio/ices-cc/ices-cc.SlackBuild b/audio/ices-cc/ices-cc.SlackBuild
new file mode 100644
index 0000000000..382177ea4a
--- /dev/null
+++ b/audio/ices-cc/ices-cc.SlackBuild
@@ -0,0 +1,106 @@
+#!/bin/sh
+
+# Slackware build script for ices-cc
+
+# Written by Rodney Cobb (rdc@ktabic.co.uk)
+# Modified by Antonio Hernández Blas <hba.nihilismus@gmail.com> for ices-cc
+
+PRGNAM=ices-cc
+VERSION=${VERSION:-0.4.1}
+BUILD=${BUILD:-1}
+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
+
+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 .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Disable flac support with "with_flac" enviroment variable, please read:
+# http://www.linuxquestions.org/questions/slackware-14/ices0-for-slackware-767465/
+
+# ices-cc (0.4.1) has various file conflicts with ices (0.4, for mp3) ices (2.0.1, for Ogg)
+# so the suffix "-cc" will be added except for ices modules (/etc/modules/ices.* which
+# dont conflict.
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+with_flac="no" \
+./configure \
+ --program-suffix="-cc" \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --disable-static \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
+ grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+
+mv $PKG/etc/ices.conf.dist $PKG/etc/$PRGNAM.conf.new
+mv $PKG/etc/modules/ices.sh.dist $PKG/etc/modules/ices.sh.new
+mv $PKG/etc/modules/ices.pm.dist $PKG/etc/modules/ices.pm.new
+mv $PKG/etc/modules/ices.py.dist $PKG/etc/modules/ices.py.new
+
+# Create log directory
+mkdir -p $PKG/var/log/$PRGNAM
+
+# Install an init script
+mkdir -p $PKG/etc/rc.d
+install -m 644 $CWD/rc.$PRGNAM $PKG/etc/rc.d/rc.$PRGNAM.new
+
+rm -rf $PKG/usr/doc/ices
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYING AUTHORS BUGS INSTALL NEWS README* TODO doc/*.html \
+ $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/audio/ices-cc/ices-cc.info b/audio/ices-cc/ices-cc.info
new file mode 100644
index 0000000000..a70eca53c1
--- /dev/null
+++ b/audio/ices-cc/ices-cc.info
@@ -0,0 +1,10 @@
+PRGNAM="ices-cc"
+VERSION="0.4.1"
+HOMEPAGE="http://www.centova.com/pages/icescc"
+DOWNLOAD="http://www.centova.com/clientdist/ices/ices-cc-0.4.1.tar.gz"
+MD5SUM="28de96219a8c0521f7249d3fdc77c145"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="Antonio Hernández Blas"
+EMAIL="hba.nihilismus@gmail.com"
+APPROVED="rworkman"
diff --git a/audio/ices-cc/rc.ices-cc b/audio/ices-cc/rc.ices-cc
new file mode 100644
index 0000000000..002f6254bf
--- /dev/null
+++ b/audio/ices-cc/rc.ices-cc
@@ -0,0 +1,80 @@
+#!/bin/sh
+
+# Start/stop/restart ices-cc as a daemon
+# Copyright (c) 2011 Antonio Hernández Blas <hba.nihilismus@gmail.com>
+
+#
+# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+# Version 2, December 2004
+#
+# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+#
+# Everyone is permitted to copy and distribute verbatim or modified
+# copies of this license document, and changing it is allowed as long
+# as the name is changed.
+#
+# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+#
+# 0. You just DO WHAT THE FUCK YOU WANT TO.
+#
+
+CONF='/etc/ices-cc.conf'
+BASEDIR='/var/log/ices-cc'
+CMMD="/usr/bin/ices-cc -B -c $CONF -D $BASEDIR"
+
+ices_start() {
+ if [ -x /usr/bin/ices-cc ]; then
+ if [ -f $CONF ]; then
+ PIDOF=$(pgrep -f "$CMMD")
+ if [ ! -z "$PIDOF" ]; then
+ echo "Error, ices is already running as daemon."
+ else
+ echo "Starting ices as daemon: $CMMD"
+ /bin/su - ices -c "$CMMD"
+ fi
+ else
+ echo "Error, file $CONF does not exist."
+ fi
+ fi
+}
+
+ices_stop() {
+ PIDOF=$(pgrep -f "$CMMD")
+ if [ -z $PIDOF ]; then
+ echo "Error, ices-cc is not running as daemon."
+ else
+ echo "Stoping ices-cc as daemon: kill -s SIGINT $PIDOF"
+ /bin/kill -s SIGINT $PIDOF
+ fi
+}
+
+ices_status() {
+ PIDOF=$(pgrep -f "$CMMD")
+ if [ ! -z "$PIDOF" ]; then
+ echo "ices-cc is running as daemon."
+ else
+ echo "ices-cc is not running as daemon."
+ fi
+}
+
+case $1 in
+ start)
+ ices_start
+ ;;
+ stop)
+ ices_stop
+ ;;
+ restart)
+ ices_stop
+ sleep 3
+ ices_start
+ ;;
+ status)
+ ices_status
+ ;;
+ *)
+ echo "Usage $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
diff --git a/audio/ices-cc/slack-desc b/audio/ices-cc/slack-desc
new file mode 100644
index 0000000000..a103ccf925
--- /dev/null
+++ b/audio/ices-cc/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 ices-cc, 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------------------------------------------------------|
+ices-cc: ices-cc (primary source client for icecast)
+ices-cc:
+ices-cc: Source client for broadcasting in MP3 format to an icecast server.
+ices-cc: Based in ices (0.4).
+ices-cc:
+ices-cc: Homepage: http://www.centova.com/pages/icescc
+ices-cc:
+ices-cc:
+ices-cc:
+ices-cc:
+ices-cc: