ports/88849: [maintainer update] audio/shoutcast
Gabor Kovesdan
gabor.kovesdan at t-hosting.hu
Fri Nov 11 17:20:17 UTC 2005
>Number: 88849
>Category: ports
>Synopsis: [maintainer update] audio/shoutcast
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Fri Nov 11 17:20:15 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Gabor Kovesdan
>Release: FreeBSD 5.3-RELEASE-p17 amd64
>Organization:
n/a
>Environment:
System: FreeBSD server.t-hosting.hu 5.3-RELEASE-p17 FreeBSD 5.3-RELEASE-p17 #0: Mon Jul 4 20:23:15 CEST 2005 root at server.t-hosting.hu:/usr/src/sys/amd64/compile/FREEBSD amd64
>Description:
- Use substitutions in the sample config file (CR/LF->LF and some logging settings)
- Make it run as non-root (updated rcNG, added pkg-install, pkg-deinstall)
- Update pkg-message
- Bump PORTREVISION
- Add SHA256
>How-To-Repeat:
>Fix:
--- shoutcast.diff begins here ---
diff -Nur /usr/ports/audio/shoutcast/Makefile ./Makefile
--- /usr/ports/audio/shoutcast/Makefile Tue Nov 1 07:15:57 2005
+++ ./Makefile Fri Nov 11 17:59:57 2005
@@ -6,7 +6,7 @@
PORTNAME= shoutcast
PORTVERSION= 1.9.5
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= audio net
MASTER_SITES= http://www.shoutcast.com/downloads/sc1-9-5/
@@ -18,10 +18,13 @@
NO_PACKAGE= Redistribution of the software isn't allowed
USE_RC_SUBR= shoutcast.sh
-PLIST_FILES= sbin/sc_serv etc/shoutcast/sc_serv.conf
+PLIST_FILES= sbin/sc_serv etc/shoutcast/sc_serv.conf.sample
PLIST_DIRS= etc/shoutcast
PORTDOCS= README.TXT
-PKGMESSAGE= ${WRKDIR}/pkg-message
+USE_REINPLACE= YES
+
+PKGMESSAGE= ${WRKDIR}/pkg-message
+PKGINSTALL= ${WRKDIR}/pkg-install
.include <bsd.port.pre.mk>
@@ -37,18 +40,28 @@
.endif
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
@${CAT} ${PKGDIR}/pkg-message | ${SED} 's|%%PREFIX%%|${PREFIX}|' > ${PKGMESSAGE}
+ @${CAT} ${PKGDIR}/pkg-install | ${SED} 's|%%PREFIX%%|${PREFIX}|' > ${PKGINSTALL}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sc_serv ${PREFIX}/sbin
${MKDIR} ${PREFIX}/etc/shoutcast
- ${INSTALL_DATA} ${WRKSRC}/sc_serv.conf ${PREFIX}/etc/shoutcast
+ ${INSTALL_DATA} ${WRKSRC}/sc_serv.conf ${PREFIX}/etc/shoutcast/sc_serv.conf.sample
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.TXT ${DOCSDIR}
.endif
post-install:
+ @${SH} ${PKGINSTALL} ${PKGNAME}
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff -Nur /usr/ports/audio/shoutcast/distinfo ./distinfo
--- /usr/ports/audio/shoutcast/distinfo Thu Oct 13 05:01:12 2005
+++ ./distinfo Tue Nov 8 19:39:15 2005
@@ -1,4 +1,6 @@
MD5 (shoutcast-1-9-5-freebsd5-elf.tar.gz) = 8471ee4c9cb02d6eb01d9871f3fe07a9
+SHA256 (shoutcast-1-9-5-freebsd5-elf.tar.gz) = 9054ed47ea73301ae3c31cc9e4807927c7d2abadd8c8165cfb8e230e24b7ed1c
SIZE (shoutcast-1-9-5-freebsd5-elf.tar.gz) = 60080
MD5 (shoutcast-1-9-5-freebsd4-elf.tar.gz) = 2d3af62f2fda9ddc68116f15c3674df4
+SHA256 (shoutcast-1-9-5-freebsd4-elf.tar.gz) = 69ec4d494eb96f66b47e3ed2411c1c25164e38a0444eea7e2ac3ef6ef252c31c
SIZE (shoutcast-1-9-5-freebsd4-elf.tar.gz) = 55818
diff -Nur /usr/ports/audio/shoutcast/files/shoutcast.sh.in ./files/shoutcast.sh.in
--- /usr/ports/audio/shoutcast/files/shoutcast.sh.in Sun Nov 6 10:35:46 2005
+++ ./files/shoutcast.sh.in Fri Nov 11 17:51:32 2005
@@ -15,7 +15,7 @@
shoutcast_startcmd ()
{
-%%PREFIX%%/sbin/sc_serv %%PREFIX%%/etc/sc_serv.conf
+su shoutcast -c '%%PREFIX%%/sbin/sc_serv %%PREFIX%%/etc/shoutcast/sc_serv.conf & >/dev/null 2>&1'
}
shoutcast_stopcmd ()
diff -Nur /usr/ports/audio/shoutcast/pkg-deinstall ./pkg-deinstall
--- /usr/ports/audio/shoutcast/pkg-deinstall Thu Jan 1 01:00:00 1970
+++ ./pkg-deinstall Thu Nov 10 23:19:30 2005
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+PKG_PREFIX=%%PREFIX%%
+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
diff -Nur /usr/ports/audio/shoutcast/pkg-install ./pkg-install
--- /usr/ports/audio/shoutcast/pkg-install Thu Jan 1 01:00:00 1970
+++ ./pkg-install Thu Nov 10 23:05:37 2005
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+PKG_PREFIX=%%PREFIX%%
+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=8000
+ 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=8000
+ 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
diff -Nur /usr/ports/audio/shoutcast/pkg-message ./pkg-message
--- /usr/ports/audio/shoutcast/pkg-message Mon Oct 31 16:15:15 2005
+++ ./pkg-message Thu Nov 10 23:55:59 2005
@@ -1,9 +1,12 @@
-================================================================
+==================================================================
Shoutcast is now installed.
-The server config file is %%PREFIX%%/etc/sc_serv.conf.
-If You want to start it set shoutcast_enable="YES" in your
-/etc/rc.conf file and type:
+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
-================================================================
+==================================================================
--- shoutcast.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list