summaryrefslogtreecommitdiffstats
path: root/icecast
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2005-10-04 11:31:46 +0000
committer Eric Hameleers <alien@slackware.com>2005-10-04 11:31:46 +0000
commit905b7b14fff098317378e033a079a33fa83d8b63 (patch)
tree1b5bd549524978cd17df9610f4c8302909a37ed4 /icecast
parentbf119172db63ec872636bc968b010691821d8d8c (diff)
downloadasb-905b7b14fff098317378e033a079a33fa83d8b63.tar.gz
asb-905b7b14fff098317378e033a079a33fa83d8b63.tar.xz
Initial revision
Diffstat (limited to 'icecast')
-rwxr-xr-xicecast/build/icecast.SlackBuild237
-rwxr-xr-xicecast/build/ices.SlackBuild163
2 files changed, 400 insertions, 0 deletions
diff --git a/icecast/build/icecast.SlackBuild b/icecast/build/icecast.SlackBuild
new file mode 100755
index 00000000..2d716bc4
--- /dev/null
+++ b/icecast/build/icecast.SlackBuild
@@ -0,0 +1,237 @@
+#!/bin/sh
+# $Id$
+# Slackware SlackBuild script
+# ===========================
+# By: Eric Hameleers <alien@slackware.com>
+# For: Icecast
+# URL: http://www.icecast.org/
+# Summary: Xiph Streaming media server that supports
+# multiple audio formats (and theora video streams too).
+# Needs: libvorbis, libogg, libxml2, curl
+# Changelog:
+# 2.0.0-1: 16/jan/2004 by Eric Hameleers
+# 2.0.0-2: 17/jan/2004 by Eric Hameleers
+# Bug fix in the rc.icecast script
+# 2.0.0-3: 22/apr/2004 by Eric Hameleers
+# Add "next" operatrion to rc.icecast
+# 2.0.2-1: 20/oct/2004 by Eric Hameleers
+# Rebuilt new releease.
+# 2.2.0-1: 01/jan/2005 by Eric Hameleers
+# Rebuilt new releease.
+# 2.2.0-2: 11/aug/2005 by Eric Hameleers
+# Add "current" and "status" to rc.icecast parameters.
+# Make sure that existing /etc/rc.d/rc.icecast isn't overwritten.
+# 2.2.0-3: 17/sep/2005 by Eric Hameleers
+# Forgot to add "current" to rc.icecast 'help' output
+# (i.e. run rc.icecast with no parameters).
+#
+# ---------------------------------------------------------------------------
+#
+# Set initial variables:
+CWD=`pwd`
+if [ "$TMP" = "" ]; then
+ TMP=/tmp
+fi
+
+PRGNAM=icecast
+VERSION=2.2.0
+ARCH=i486
+BUILD=3
+
+PKG=$TMP/package-$PRGNAM
+
+if [ ! -d $TMP/tmp-$PRGNAM ]; then
+ mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+fi
+if [ ! -d $PKG ]; then
+ mkdir -p $PKG # place for the package to be built
+fi
+
+
+# --- HELPER FUNCTIONS ---
+
+#
+# Function 'preconfig filename [remove]'
+#
+# param1 (required) may be a wildcard;
+# in that case surround it with double quotes!
+# param2 (optional) has value 'remove'
+#
+# Description:
+# Prepare the incoming configuration files which are not allowed
+# to overwrite existing ones.
+# These files will get a '.new' extension.
+# An entry in the 'doinst.sh' script will be created for these files, copying
+# the *.new files back to their original names,
+# but only if the original names don't exist.
+# Use the second parameter 'remove', like in 'preconfig filename(s) remove'
+# to add a 'rm -f filename.new' in 'doinst.sh', so as not to clutter
+# the harddisk with useless example files.
+
+preconfig() {
+ mkdir -p $PKG/install 2>/dev/null
+ for infile in $1; do
+ mv ${infile} ${infile}.new
+ done
+ echo -n "config \"$1.new\"" >> $PKG/install/doinst.sh
+ # If there's a second parameter with value 'remove' add a 'rm filename.new'
+ if [ "$2" = "remove" ]; then
+ echo -n " ; rm -f $1.new" >> $PKG/install/doinst.sh
+ fi
+ echo "" >> $PKG/install/doinst.sh
+}
+
+
+# --- PACKAGE BUILDING ---
+
+echo "+==============+"
+echo "| $PRGNAM-$VERSION |"
+echo "+==============+"
+
+iceuser=icecast
+icegroup=icecast
+
+rm -rf $PKG/*
+
+# Explode the package framework:
+cd $PKG
+if [ -f $CWD/_$PRGNAM.tar.gz ]; then
+ explodepkg $CWD/_$PRGNAM.tar.gz
+fi
+
+cd $TMP/tmp-$PRGNAM
+
+# Extract tar ball in TEMP dir
+echo Building $PRGNAM...
+tar -zxvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+./configure --prefix=/usr --sysconfdir=/usr/share/icecast/etc \
+ --localstatedir=/var \
+ 2>&1 | tee $CWD/configure-${PRGNAM}.log
+
+make 2>&1 | tee $CWD/make-${PRGNAM}.log
+
+# Install all the needed stuff to the package dir
+# Use installwatch if available:
+which installwatch > /dev/null 2>&1
+if [ $? == 0 ]; then
+ installwatch -o $CWD/install-${PRGNAM}.log make DESTDIR=$PKG install
+else
+ make DESTDIR=$PKG install 2>&1 |tee $CWD/install-${PRGNAM}.log
+fi
+
+mkdir -p $PKG/var/log/icecast
+(cd $PKG/usr/share/icecast/etc && patch -p0 < $CWD/icecast_conf.patch)
+
+
+# --- DOCUMENTATION ---
+
+# Compress the man page
+gzip -9 $PKG/usr/man/*/*
+
+# Copy the documentation
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mv $PKG/usr/share/doc/icecast/* $PKG/usr/doc/$PRGNAM-$VERSION/
+rm -r $PKG/usr/share/doc
+chmod -R -w $PKG/usr/doc/$PRGNAM-$VERSION
+
+
+# --- POST-INSTALL SCRIPT ---
+
+# --- Fabricate the 'doinst.sh' script: ------
+mkdir -p $PKG/install
+
+cat <<EOINS > $PKG/install/doinst.sh
+# Handle the incoming configuration files:
+config() {
+ for infile in \$1; do
+ NEW="\$infile"
+ 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...
+ done
+}
+
+# Take care of rc.icecast
+config etc/rc.d/rc.icecast.new
+
+#Add the '${icegroup}' group if it doesn't exist already
+groupadd ${icegroup} 2> /dev/null
+#Add the '${iceuser}' user if it doesn't exist already
+useradd -c "Icecast" -d /usr/share/icecast \\
+ -g ${icegroup} -s "/bin/false" ${iceuser} 2> /dev/null
+
+# Configure the home directory
+mkdir -p usr/share/icecast
+chown -R ${iceuser}:${icegroup} usr/share/icecast
+chmod 750 usr/share/icecast
+
+# Configure the log directory
+mkdir -p var/log/icecast
+chown -R ${iceuser} var/log/icecast
+chmod 750 var/log/icecast
+
+#
+# Update rc.local so that Icecast will be started on boot
+#
+if ! grep "rc.icecast" etc/rc.d/rc.local 1>/dev/null 2>&1 ; then
+ cat <<-_EOM_ >> etc/rc.d/rc.local
+
+ if [ -x /etc/rc.d/rc.icecast ]; then
+ # Start Icecast server
+ echo "Starting icecast: /etc/rc.d/rc.icecast start"
+ /etc/rc.d/rc.icecast start
+ fi
+ _EOM_
+fi
+
+EOINS
+
+# --- End of 'doinst.sh' script -----------
+
+# Finally, take care of the configuration files:
+# Rename those files which must not overwrite existing ones when the package
+# is installed. Corresponding entries will be created at the end of
+# the 'doinst.sh' script.
+(cd $PKG ; preconfig usr/share/icecast/etc/$PRGNAM.xml)
+echo "" >> $PKG/install/doinst.sh
+
+
+# --- OWNERSHIP, RIGHTS ---
+chown -R root.root $PKG
+
+find $PKG -type f -name "*~" -exec rm -f {} \;
+
+# --- PACKAGE DESCRIPTION ---
+mkdir -p $PKG/install
+cat $CWD/icecast.slack-desc > $PKG/install/slack-desc
+
+
+# --- BUILDING ---
+
+# Build the package and compute its md5 checksum:
+cd $PKG
+makepkg --linkadd y --chown n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.tgz
+(cd $TMP && md5sum $PRGNAM-$VERSION-$ARCH-$BUILD.tgz > $PRGNAM-$VERSION-$ARCH-$BUILD.tgz.md5)
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.txt
+
+
+# --- CLEANUP ---
+
+# Clean up the extra stuff:
+if [ "$1" = "--cleanup" ]; then
+ rm -rf $TMP/tmp-$PRGNAM
+ rm -rf $PKG
+else
+ echo You can check the 'installwatch' log file: $CWD/install-${PRGNAM}.log
+fi
+
+#
+# EOF
+#
diff --git a/icecast/build/ices.SlackBuild b/icecast/build/ices.SlackBuild
new file mode 100755
index 00000000..dc7610a4
--- /dev/null
+++ b/icecast/build/ices.SlackBuild
@@ -0,0 +1,163 @@
+#!/bin/sh
+# $Id$
+# Slackware SlackBuild script
+# ===========================
+# By: Eric Hameleers <alien@slackware.com>
+# Created: 20oct2004
+# For: IceS
+# URL: http://www.icecast.org/
+# Summary: An mp3 source client for the icecast streaming media server
+# Needs: libvorbis, libogg, libxml2, libshout2, lame, perl, python
+# Changelog:
+# build 1: 20/oct/2004 by Eric Hameleers
+#
+# --------------------------------------------------------------------------
+#
+# Set initial variables:
+CWD=`pwd`
+if [ "$TMP" = "" ]; then
+ TMP=/tmp
+fi
+
+PRGNAM=ices
+VERSION=0.4
+ARCH=i486
+BUILD=1
+
+PKG=$TMP/package-$PRGNAM
+
+if [ ! -d $TMP/tmp-$PRGNAM ]; then
+ mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+fi
+if [ ! -d $PKG ]; then
+ mkdir -p $PKG # place for the package to be built
+fi
+
+
+# --- PACKAGE BUILDING ---
+
+echo "+==============+"
+echo "| $PRGNAM-$VERSION |"
+echo "+==============+"
+
+iceuser=icecast
+icegroup=icecast
+
+rm -rf $PKG/*
+
+# Explode the package framework:
+cd $PKG
+if [ -f $CWD/_$PRGNAM.tar.gz ]; then
+ explodepkg $CWD/_$PRGNAM.tar.gz
+fi
+
+cd $TMP/tmp-$PRGNAM
+
+# Extract tar ball in TEMP dir
+echo Building $PRGNAM...
+tar -zxvpf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+./configure --prefix=/usr --localstatedir=/var \
+ --sysconfdir=/usr/share/icecast/etc \
+ --with-moddir=/usr/share/icecast/etc/modules \
+ --with-perl --with-python \
+ --with-lame --with-vorbis \
+ 2>&1 | tee $CWD/configure-${PRGNAM}.log
+make | tee $CWD/make-${PRGNAM}.log
+
+# Install all the needed stuff to the package dir
+# Use installwatch if available:
+which installwatch > /dev/null 2>&1
+if [ $? == 0 ]; then
+ installwatch -o $CWD/install-${PRGNAM}.log \
+ make prefix=$PKG/usr \
+ localstatedir=$PKG/var \
+ sysconfdir=$PKG/usr/share/icecast/etc \
+ moddir=$PKG/usr/share/icecast/etc/modules \
+ install
+else
+ make prefix=$PKG/usr \
+ localstatedir=$PKG/var \
+ sysconfdir=$PKG/usr/share/icecast/etc \
+ moddir=$PKG/usr/share/icecast/etc/modules \
+ install \
+ 2>&1 | tee $CWD/install-${PRGNAM}.log
+fi
+
+mkdir -p $PKG/var/state/ices
+(cd $PKG/usr/share/icecast/etc && patch < $CWD/ices_conf.patch)
+# (cd $PKG/usr && ln -s /usr/share/icecast ices)
+
+# --- DOCUMENTATION ---
+
+# Compress the man page
+gzip -9 $PKG/usr/man/*/*
+
+# Copy the documentation
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mv $PKG/usr/doc/ices/icesmanual.html $PKG/usr/doc/$PRGNAM-$VERSION/
+rm -r $PKG/usr/doc/ices
+chmod -R -w $PKG/usr/doc/$PRGNAM-$VERSION
+
+
+# --- POST-INSTALL SCRIPT ---
+
+# --- Fabricate the 'doinst.sh' script: ------
+mkdir -p $PKG/install
+
+cat <<EOINS > $PKG/install/doinst.sh
+#Add the '${icegroup}' group if it doesn't exist already
+groupadd ${icegroup} 2> /dev/null
+#Add the '${iceuser}' user if it doesn't exist already
+useradd -c "Icecast" -d /usr/share/icecast \\
+ -g ${icegroup} -s "/bin/false" ${iceuser} 2> /dev/null
+
+# Configure the home directory
+# (Will exist already, if icecast package is installed previously).
+mkdir -p usr/share/icecast
+chown -R ${iceuser}:${icegroup} usr/share/icecast
+chmod 750 usr/share/icecast
+
+# Configure the state directory
+mkdir -p var/state/ices
+chown -R ${iceuser}:${icegroup} var/state/ices
+chmod 755 var/state/ices
+
+EOINS
+
+# --- End of 'doinst.sh' script -----------
+
+
+
+# --- OWNERSHIP, RIGHTS ---
+chown -R root.root $PKG
+
+
+# --- PACKAGE DESCRIPTION ---
+mkdir -p $PKG/install
+cat $CWD/ices.slack-desc > $PKG/install/slack-desc
+
+
+# --- BUILDING ---
+
+# Build the package and compute its md5 checksum:
+cd $PKG
+makepkg --linkadd y --chown n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.tgz
+(cd $TMP && md5sum $PRGNAM-$VERSION-$ARCH-$BUILD.tgz > $PRGNAM-$VERSION-$ARCH-$BUILD.tgz.md5)
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.txt
+
+
+
+# --- CLEANUP ---
+
+# Clean up the extra stuff:
+if [ "$1" = "--cleanup" ]; then
+ rm -rf $TMP/tmp-$PRGNAM
+ rm -rf $PKG
+else
+ echo You can check the 'installwatch' log file: $CWD/install-${PRGNAM}.log
+fi
+
+#
+# EOF
+#