[Midnightbsd-cvs] mports: mports/audio: add shoutcast (FreeBSD 5)

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Sep 12 14:25:56 EDT 2008


Log Message:
-----------
add shoutcast (FreeBSD 5)

Modified Files:
--------------
    mports/audio:
        Makefile (r1.68 -> r1.69)

Added Files:
-----------
    mports/audio/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/shoutcast/files:
        pkg-message.in (r1.1)
        shoutcast.sh.in (r1.1)

-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/audio/Makefile,v
retrieving revision 1.68
retrieving revision 1.69
diff -L audio/Makefile -L audio/Makefile -u -r1.68 -r1.69
--- audio/Makefile
+++ audio/Makefile
@@ -71,6 +71,7 @@
     SUBDIR += portaudio2
     SUBDIR += rhythmbox
     SUBDIR += sdl_mixer
+    SUBDIR += shoutcast
     SUBDIR += sound-juicer
     SUBDIR += taglib
     SUBDIR += twolame
--- /dev/null
+++ audio/shoutcast/pkg-install
@@ -0,0 +1,51 @@
+#!/bin/sh
+# $MidnightBSD: mports/audio/shoutcast/pkg-install,v 1.1 2008/09/12 18:25:53 laffer1 Exp $
+
+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/shoutcast/pkg-descr
@@ -0,0 +1,3 @@
+Shoutcast is Nullsoft's Winamp-based streaming audio server.
+
+WWW: http://www.shoutcast.com
--- /dev/null
+++ audio/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/shoutcast/pkg-deinstall
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $MidnightBSD: mports/audio/shoutcast/pkg-deinstall,v 1.1 2008/09/12 18:25:53 laffer1 Exp $
+
+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/shoutcast/Makefile
@@ -0,0 +1,56 @@
+# Ports collection Makefile for:	shoutcast
+# Date created:				Sept 12 2008
+# Whom:					Lucas Holt
+#
+# $MidnightBSD: mports/audio/shoutcast/Makefile,v 1.1 2008/09/12 18:25:53 laffer1 Exp $
+#
+
+PORTNAME=	shoutcast
+PORTVERSION=	1.9.8
+CATEGORIES=	audio net
+MASTER_SITES=	http://yp.shoutcast.com/downloads/sc1-9-8/
+DISTNAME=	sc_serv_1.9.8_FreeBSD5
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Nullsoft's streaming audio server (binary port)
+LICENSE=	restricted
+
+IA32_BINARY_PORT=	YES
+NO_BUILD=	YES
+RESTRICTED=	Redistribution of the software is not allowed
+
+CONFLICTS=	linux-shoutcast-[0-9]*
+
+USE_RC_SUBR=	shoutcast.sh
+PORTDOCS=	README.TXT
+WRKSRC=		${WRKDIR}
+
+.include <bsd.port.pre.mk>
+
+LIB_DEPENDS+=	c.5:${PORTSDIR}/misc/compat5x
+
+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
+
+.include <bsd.port.post.mk>
--- /dev/null
+++ audio/shoutcast/distinfo
@@ -0,0 +1,3 @@
+MD5 (sc_serv_1.9.8_FreeBSD5.tar.gz) = 0e9e19bf05831f17cb7881213382bbf5
+SHA256 (sc_serv_1.9.8_FreeBSD5.tar.gz) = 5e05f7bac72b3cffe8f54b0387e5a67aa55be67d2a864508db82de4dc5a41a0a
+SIZE (sc_serv_1.9.8_FreeBSD5.tar.gz) = 62688
--- /dev/null
+++ audio/shoutcast/files/pkg-message.in
@@ -0,0 +1,9 @@
+Shoutcast is now installed.
+There is a sample configuration file under
+%%PREFIX%%/etc/shoutcast/sc_serv.conf.sample.
+Edit that file and save it as sc_serv.conf in the same directory.
+
+If You want to start the server, set shoutcast_enable="YES" in
+your /etc/rc.conf file, and type:
+
+%%PREFIX%%/etc/rc.d/shoutcast.sh start
--- /dev/null
+++ audio/shoutcast/files/shoutcast.sh.in
@@ -0,0 +1,27 @@
+#!/bin/sh
+# $MidnightBSD: mports/audio/shoutcast/files/shoutcast.sh.in,v 1.1 2008/09/12 18:25:54 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