aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2005-11-19 00:20:59 +0800
committerpav <pav@FreeBSD.org>2005-11-19 00:20:59 +0800
commitf6fe3c968c53b41dc876b7940cdaa68a605d8921 (patch)
tree69982be8bd31d8fe73ba9d4862d717beae5d54c2 /audio
parentb17623c88fae5662975cefbaf17037d050e17a6d (diff)
downloadfreebsd-ports-gnome-f6fe3c968c53b41dc876b7940cdaa68a605d8921.tar.gz
freebsd-ports-gnome-f6fe3c968c53b41dc876b7940cdaa68a605d8921.tar.zst
freebsd-ports-gnome-f6fe3c968c53b41dc876b7940cdaa68a605d8921.zip
- Run under user shoutcast
- Patch sample config file PR: ports/88849 Submitted by: Gabor Kovesdan <gabor.kovesdan@t-hosting.hu> (maintainer)
Diffstat (limited to 'audio')
-rw-r--r--audio/shoutcast/Makefile22
-rw-r--r--audio/shoutcast/distinfo2
-rw-r--r--audio/shoutcast/files/pkg-message.in12
-rw-r--r--audio/shoutcast/files/shoutcast.sh.in2
-rw-r--r--audio/shoutcast/pkg-deinstall12
-rw-r--r--audio/shoutcast/pkg-install46
-rw-r--r--audio/shoutcast/pkg-message9
7 files changed, 89 insertions, 16 deletions
diff --git a/audio/shoutcast/Makefile b/audio/shoutcast/Makefile
index 8922cb3c737c..98acf79c0665 100644
--- a/audio/shoutcast/Makefile
+++ b/audio/shoutcast/Makefile
@@ -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/
@@ -15,13 +15,15 @@ COMMENT= Nullsoft's streaming audio server (binary port)
ONLY_FOR_ARCHS= i386
NO_BUILD= YES
-NO_PACKAGE= Redistribution of the software isn't allowed
+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
+
+SUB_FILES= pkg-message
.include <bsd.port.pre.mk>
@@ -37,18 +39,26 @@ BROKEN= "unsupported FreeBSD version"
.endif
post-patch:
- @${CAT} ${PKGDIR}/pkg-message | ${SED} 's|%%PREFIX%%|${PREFIX}|' > ${PKGMESSAGE}
+ ${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
+ ${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 --git a/audio/shoutcast/distinfo b/audio/shoutcast/distinfo
index 805224b0797a..95d7994aa313 100644
--- a/audio/shoutcast/distinfo
+++ b/audio/shoutcast/distinfo
@@ -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 --git a/audio/shoutcast/files/pkg-message.in b/audio/shoutcast/files/pkg-message.in
new file mode 100644
index 000000000000..0296e299d70d
--- /dev/null
+++ b/audio/shoutcast/files/pkg-message.in
@@ -0,0 +1,12 @@
+==================================================================
+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
+
+==================================================================
diff --git a/audio/shoutcast/files/shoutcast.sh.in b/audio/shoutcast/files/shoutcast.sh.in
index a590de38877b..f7d71c328509 100644
--- a/audio/shoutcast/files/shoutcast.sh.in
+++ b/audio/shoutcast/files/shoutcast.sh.in
@@ -15,7 +15,7 @@ stop_cmd="shoutcast_stopcmd"
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 --git a/audio/shoutcast/pkg-deinstall b/audio/shoutcast/pkg-deinstall
new file mode 100644
index 000000000000..4dceb1880e13
--- /dev/null
+++ b/audio/shoutcast/pkg-deinstall
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+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 --git a/audio/shoutcast/pkg-install b/audio/shoutcast/pkg-install
new file mode 100644
index 000000000000..29027c1cf880
--- /dev/null
+++ b/audio/shoutcast/pkg-install
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+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
diff --git a/audio/shoutcast/pkg-message b/audio/shoutcast/pkg-message
deleted file mode 100644
index 529f34db354e..000000000000
--- a/audio/shoutcast/pkg-message
+++ /dev/null
@@ -1,9 +0,0 @@
-================================================================
-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:
-
-%%PREFIX%%/etc/rc.d/shoutcast.sh start
-
-================================================================