aboutsummaryrefslogtreecommitdiff
path: root/audio/shoutcast
diff options
context:
space:
mode:
authorMichael Scheidell <scheidell@FreeBSD.org>2012-01-21 19:33:20 +0000
committerMichael Scheidell <scheidell@FreeBSD.org>2012-01-21 19:33:20 +0000
commit830d25d5f2293f76b6b463b7789c2f642b4793ed (patch)
treeef0e6c22e0160fbe353fc16a976e1d9209046b69 /audio/shoutcast
parent729beee5950da2c3097fb62e6bff6f3e25a4ddb0 (diff)
downloadports-830d25d5f2293f76b6b463b7789c2f642b4793ed.tar.gz
ports-830d25d5f2293f76b6b463b7789c2f642b4793ed.zip
Notes
Diffstat (limited to 'audio/shoutcast')
-rw-r--r--audio/shoutcast/Makefile8
-rw-r--r--audio/shoutcast/files/shoutcast.in39
2 files changed, 22 insertions, 25 deletions
diff --git a/audio/shoutcast/Makefile b/audio/shoutcast/Makefile
index f28b1c58b4b9..cc1cc99884ec 100644
--- a/audio/shoutcast/Makefile
+++ b/audio/shoutcast/Makefile
@@ -33,17 +33,15 @@ PLIST_SUB= SHOUTCASTUSER=${SHOUTCASTUSER} \
SUB_FILES= pkg-message
-SUB_LIST= ${PLIST_SUB}
+SUB_LIST= SHOUTCASTUSER=${SHOUTCASTUSER} \
+ SHOUTCASTGROUP=${SHOUTCASTGROUP} \
+ SHOUTCASTDIR=${SHOUTCASTDIR}
USERS= ${SHOUTCASTUSER}
GROUPS= ${SHOUTCASTGROUP}
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 800000
-IGNORE= is for FreeBSD 8.x and later
-.endif
-
post-patch:
@${REINPLACE_CMD} -e '/^logfile=.*\/logfile.log/d' \
-e '/sc_serv2 directory/d' \
diff --git a/audio/shoutcast/files/shoutcast.in b/audio/shoutcast/files/shoutcast.in
index 8b2a3805959f..4fefd6403f46 100644
--- a/audio/shoutcast/files/shoutcast.in
+++ b/audio/shoutcast/files/shoutcast.in
@@ -1,45 +1,44 @@
#!/bin/sh
-#
+
# $FreeBSD$
#
-
# PROVIDE: shoutcast
# REQUIRE: LOGIN
-# BEFORE:
# KEYWORD: shutdown
-
#
# Add the following lines to /etc/rc.conf to enable SHOUTcast:
# shoutcast_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable SHOUTcast.
# shoutcast_configfile (str): Set to "%%PREFIX%%/%%ETCDIR%%/sc_serv.conf" by default.
-#
+# shoutcast_user (str): Set to %%SHOUTCASTUSER%% by default
+# shoutcast_chdir (str): Set to %%SHOUTCASTDIR%% by default
. /etc/rc.subr
-name="shoutcast"
-rcvar=`set_rcvar`
-shoutcast_logfile="/var/log/sc_serv.log"
+name=shoutcast
+rcvar=shoutcast_enable
-start_cmd="shoutcast_startcmd"
-stop_cmd="shoutcast_stopcmd"
+load_rc_config shoutcast
-[ -z "${shoutcast_enable}" ] && shoutcast_enable="NO"
-[ -z "${shoutcast_configfile}" ] && shoutcast_configfile="%%PREFIX%%/%%ETCDIR%%/sc_serv.conf"
+: ${shoutcast_enable:="NO"}
+: ${shoutcast_user:="%%SHOUTCASTUSER%%"}
+: ${shoutcast_chdir:="%%SHOUTCASTDIR%%"}
-load_rc_config "${name}"
+command="%%PREFIX%%/sbin/sc_serv"
+shoutcast_logfile="/var/log/sc_serv.log"
+
+required_dirs="${shoutcast_chdir}"
+required_files="${shoutcast_configfile:="%%PREFIX%%/%%ETCDIR%%/sc_serv.conf"}"
+
+command_args="${required_files} >/dev/null 2>&1 &"
-required_files="${shoutcast_configfile}"
+start_precmd="shoutcast_prestart"
-shoutcast_startcmd() {
+shoutcast_prestart()
+{
touch ${shoutcast_logfile}
chown %%SHOUTCASTUSER%%:wheel ${shoutcast_logfile}
chmod 0640 ${shoutcast_logfile}
- su %%SHOUTCASTUSER%% -c "cd %%SHOUTCASTDIR%% && %%PREFIX%%/sbin/sc_serv ${shoutcast_configfile} >/dev/null 2>&1 &"
-}
-
-shoutcast_stopcmd() {
- killall sc_serv
}
run_rc_command "$1"