[Midnightbsd-cvs] mports: mports/audio: Add the linux version of shoutcast.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Feb 24 19:33:04 EST 2008


Log Message:
-----------
Add the linux version of shoutcast.  This is the streaming server from nullsoft (AOL).

Modified Files:
--------------
    mports/audio:
        Makefile (r1.59 -> r1.60)

Added Files:
-----------
    mports/audio/linux-shoutcast:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-deinstall (r1.1)
        pkg-descr (r1.1)
        pkg-install (r1.1)
        pkg-plist (r1.1)
    mports/audio/linux-shoutcast/files:
        shoutcast.sh.in (r1.1)

-------------- next part --------------
--- /dev/null
+++ audio/linux-shoutcast/pkg-install
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+if [ "$2" != "POST-INSTALL" ]; then
+	exit 0
+fi
+
+SC_GROUP=shoutcast
+SC_USER=shoutcast
+SC_SHELL=/bin/sh
+SC_HOME=/nonexistent
+PW="/usr/sbin/pw"
+
+if ! ${PW} show group ${SC_GROUP} -q >/dev/null; then
+	gid=210
+	while ${PW} show group -g ${gid} -q >/dev/null; do
+		gid=`expr ${gid} + 1`
+	done
+	if ! ${PW} add group ${SC_GROUP} -g ${gid}; then
+		e=$?
+		echo "*** Failed to add group \`${SC_GROUP}'. Please add it manually."
+		exit ${e}
+	fi
+	echo "*** Added group \`${SC_GROUP}' (id ${gid})"
+else
+	gid=`${PW} show group ${SC_GROUP} 2>/dev/null | cut -d: -f3`
+fi
+
+if ! ${PW} show user ${SC_USER} -q >/dev/null; then
+	uid=210
+	while ${PW} show user -u ${uid} -q >/dev/null; do
+		uid=`expr ${uid} + 1`
+	done
+	if ! ${PW} add user ${SC_USER} -u ${uid} -g ${gid} -d "${SC_HOME}" \
+	-c "Shoutcast sandbox" -s "${SC_SHELL}" -p "*" \
+	; then
+		e=$?
+		echo "*** Failed to add user \`${SC_USER}'. Please add it manually."
+		exit ${e}
+	fi
+	echo "*** Added user \`${SC_USER}' (id ${uid})"
+else
+	if ! ${PW} mod user ${SC_USER} -g ${gid} -d "${SC_HOME}" \
+	-c "Shoutcast sandbox" -s "${SC_SHELL}" -p "*" \
+	; then
+		e=$?
+		echo "*** Failed to update user \`${SC_USER}'."
+		exit ${e}
+	fi
+		echo "*** Updated user \`${SC_USER}'."
+fi
--- /dev/null
+++ audio/linux-shoutcast/pkg-descr
@@ -0,0 +1,5 @@
+Shoutcast is Nullsoft's Winamp-based streaming audio server. It isn't
+an open source software, but freely available for i386 versions of
+BSD and Linux. This port installs the Linux binary.
+
+WWW: http://www.shoutcast.com
--- /dev/null
+++ audio/linux-shoutcast/pkg-plist
@@ -0,0 +1,4 @@
+sbin/sc_serv
+ at unexec if cmp -s %%PREFIX%%/etc/shoutcast/sc_serv.conf %%PREFIX%%/etc/shoutcast/sc_serv.conf.sample; then rm %%PREFIX%%/etc/shoutcast/sc_serv.conf; fi
+etc/shoutcast/sc_serv.conf.sample
+ at dirrmtry etc/shoutcast
--- /dev/null
+++ audio/linux-shoutcast/pkg-deinstall
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+        exit 0
+fi
+
+SC_GROUP=shoutcast
+SC_USER=shoutcast
+SC_SHELL=/bin/sh
+SC_HOME=/nonexistent
+PW=/usr/sbin/pw
+
+pw groupdel shoutcast >/dev/null 2>&1
+pw userdel shoutcast >/dev/null 2>&1
+
+exit 0
--- /dev/null
+++ audio/linux-shoutcast/Makefile
@@ -0,0 +1,56 @@
+# Ports collection Makefile for:	linux-shoutcast
+# Date created:				08 Apr 2006
+# Whom:					Gabor Kovesdan
+#
+# $MidnightBSD: mports/audio/linux-shoutcast/Makefile,v 1.1 2008/02/25 00:33:01 laffer1 Exp $
+# $FreeBSD: ports/audio/linux-shoutcast/Makefile,v 1.6 2007/06/05 16:41:03 gabor Exp $
+
+PORTNAME=	shoutcast
+PORTVERSION=	1.9.8
+CATEGORIES=	audio net
+MASTER_SITES=	http://www.shoutcast.com/downloads/sc${PORTVERSION:S|.|-|g}/
+PKGNAMEPREFIX=	linux-
+DISTNAME=	sc_serv_${PORTVERSION}_Linux
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Nullsoft's streaming audio server (Linux binary port)
+LICENSE=	restricted
+
+CONFLICTS=	shoutcast-[0-9]*
+
+USE_LINUX=	YES
+ONLY_FOR_ARCHS=	i386 amd64
+NO_BUILD=	YES
+RESTRICTED=	Redistribution of the software is not allowed
+
+USE_RC_SUBR=	shoutcast.sh
+PORTDOCS=	README.TXT
+WRKSRC=		${WRKDIR}
+
+post-patch:
+	@${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//' \
+		-e 's|=sc_serv.log|=/var/log/sc_serv.log|' \
+		-e 's|=sc_w3c.log|=/var/log/sc_w3c.log|' \
+		-e 's|ScreenLog=1|ScreenLog=0|' \
+		-e 's|RealTime=1|RealTime=0|' \
+		-e 's|=sc_serv.ban|=${PREFIX}/etc/shoutcast/sc_serv.ban|' \
+		-e 's|=sc_serv.rip|=${PREFIX}/etc/shoutcast/sc_serv.rip|' \
+		${WRKSRC}/sc_serv.conf
+
+do-install:
+	@${INSTALL_PROGRAM} ${WRKSRC}/sc_serv ${PREFIX}/sbin
+	@${MKDIR} ${PREFIX}/etc/shoutcast
+	@${INSTALL_DATA} ${WRKSRC}/sc_serv.conf ${PREFIX}/etc/shoutcast/sc_serv.conf.sample
+	@[ -f ${PREFIX}/etc/shoutcast/sc_serv.conf ] || \
+		${INSTALL_DATA} ${WRKSRC}/sc_serv.conf ${PREFIX}/etc/shoutcast/sc_serv.conf
+
+.if !defined(NOPORTDOCS)
+	@${MKDIR} ${DOCSDIR}
+	@${INSTALL_DATA} ${WRKSRC}/README.TXT ${DOCSDIR}
+.endif
+
+post-install:
+	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+	@${BRANDELF} -t Linux ${PREFIX}/sbin/sc_serv
+
+.include <bsd.port.mk>
--- /dev/null
+++ audio/linux-shoutcast/distinfo
@@ -0,0 +1,3 @@
+MD5 (sc_serv_1.9.8_Linux.tar.gz) = 72f9f5ec8d680bff60ba47dd21b0fe4a
+SHA256 (sc_serv_1.9.8_Linux.tar.gz) = bb3a6eea5178ee79a014bbf0192bc44447c7a0c4fceb8872b9580153ba434fe6
+SIZE (sc_serv_1.9.8_Linux.tar.gz) = 60840
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/audio/Makefile,v
retrieving revision 1.59
retrieving revision 1.60
diff -L audio/Makefile -L audio/Makefile -u -r1.59 -r1.60
--- audio/Makefile
+++ audio/Makefile
@@ -57,6 +57,7 @@
     SUBDIR += linux-esound
     SUBDIR += linux-libaudiofile
     SUBDIR += linux-libogg
+    SUBDIR += linux-shoutcast
     SUBDIR += madplay
     SUBDIR += mpg123
     SUBDIR += nas
--- /dev/null
+++ audio/linux-shoutcast/files/shoutcast.sh.in
@@ -0,0 +1,28 @@
+#!/bin/sh
+# 
+# $MidnightBSD: mports/audio/linux-shoutcast/files/shoutcast.sh.in,v 1.1 2008/02/25 00:33:01 laffer1 Exp $
+
+# PROVIDE: shoutcast
+# REQUIRE: LOGIN
+# BEFORE:
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="shoutcast"
+rcvar=`set_rcvar`
+start_cmd="shoutcast_startcmd"
+stop_cmd="shoutcast_stopcmd"
+
+shoutcast_startcmd ()
+{
+su shoutcast -c '%%PREFIX%%/sbin/sc_serv %%PREFIX%%/etc/shoutcast/sc_serv.conf & >/dev/null 2>&1'
+}
+
+shoutcast_stopcmd ()
+{
+killall sc_serv
+}
+
+load_rc_config $name
+run_rc_command "$1"


More information about the Midnightbsd-cvs mailing list