diff options
author | scheidell <scheidell@FreeBSD.org> | 2012-02-02 16:34:27 +0800 |
---|---|---|
committer | scheidell <scheidell@FreeBSD.org> | 2012-02-02 16:34:27 +0800 |
commit | ee2d1583e8e47a9ae5164292ce951a02ad7f9b58 (patch) | |
tree | 629512ddeb9d07037499b605fc0d72907a05dee7 /audio/shoutcast | |
parent | f843183353c393920b0f132b7ca0f9706fc54ef7 (diff) | |
download | freebsd-ports-gnome-ee2d1583e8e47a9ae5164292ce951a02ad7f9b58.tar.gz freebsd-ports-gnome-ee2d1583e8e47a9ae5164292ce951a02ad7f9b58.tar.zst freebsd-ports-gnome-ee2d1583e8e47a9ae5164292ce951a02ad7f9b58.zip |
- Bump PORTREVISION
- Use USE_DOS2UNIX to remove ^M from documentation
- Add support for the bundled configuration builder
- Move default logging directory to PORTNAME specific one
- Move example files to EXAMPLESDIR and make optional
- Remove dsp_sc plugin documentation
- Reinstate required_dirs variable from rc.d script
- Remove log file creation from rc.d script (no longer required)
- Display clean-up warning on port deinstall (based on bsd.port.mk)
PR: ports/164591
Submitted by: Jarrod Sayers <jarrod@downtools.com.au> maintainer
Approved by: gabor (mentor)
Diffstat (limited to 'audio/shoutcast')
-rw-r--r-- | audio/shoutcast/Makefile | 70 | ||||
-rw-r--r-- | audio/shoutcast/files/pkg-message.in | 6 | ||||
-rw-r--r-- | audio/shoutcast/files/shoutcast.in | 14 | ||||
-rw-r--r-- | audio/shoutcast/pkg-plist | 42 |
4 files changed, 93 insertions, 39 deletions
diff --git a/audio/shoutcast/Makefile b/audio/shoutcast/Makefile index 5b7160a5b4c7..026381b4f6f7 100644 --- a/audio/shoutcast/Makefile +++ b/audio/shoutcast/Makefile @@ -7,6 +7,7 @@ PORTNAME= shoutcast PORTVERSION= 2.0.0.29 +PORTREVISION= 1 CATEGORIES= audio net MASTER_SITES= http://download.nullsoft.com/shoutcast/tools/ DISTNAME= sc_serv2_bsd_8_x_07_31_2011 @@ -17,18 +18,25 @@ COMMENT= SHOUTcast Distributed Network Audio Server RESTRICTED= redistribution of software is not permitted IA32_BINARY_PORT= yes +USE_DOS2UNIX= yes +DOS2UNIX_REGEX= .*\.(conf|css|html|js|txt|xml) + USE_RC_SUBR= shoutcast CONFLICTS= linux-shoutcast-[0-9]* NO_WRKSUBDIR= yes NO_BUILD= yes +OPTIONS= CONFIG_BUILDER "Install SHOUTcast Configuration Builder" off + SHOUTCASTUSER= ${PORTNAME} SHOUTCASTGROUP= ${PORTNAME} +SHOUTCASTLDIR= /var/log/${PORTNAME} SHOUTCASTDIR= /var/run/${PORTNAME} SHOUTCAST_SUB= SHOUTCASTUSER=${SHOUTCASTUSER} \ SHOUTCASTGROUP=${SHOUTCASTGROUP} \ + SHOUTCASTLDIR=${SHOUTCASTLDIR} \ SHOUTCASTDIR=${SHOUTCASTDIR} PLIST_SUB= ${SHOUTCAST_SUB} @@ -42,37 +50,73 @@ GROUPS= ${SHOUTCASTGROUP} .include <bsd.port.pre.mk> +.if defined(WITH_CONFIG_BUILDER) +PLIST_SUB+= CONFIG_BUILDER="" +.else +PLIST_SUB+= CONFIG_BUILDER="@comment " +.endif + post-patch: +.for _file in basic debug public relay simple @${REINPLACE_CMD} -e '/sc_serv2 directory/d' \ - -e 's#=.*/sc_serv.log#=/var/log/sc_serv.log#g' \ - -e 's#=.*/sc_w3c.log#=/var/log/sc_w3c.log#g' \ - -e 's#=control/#=${SHOUTCASTDIR}/#g' ${WRKSRC}/sc_serv_basic.conf + -e 's#=.*/\([^\.]*.log\)#=${SHOUTCASTLDIR}/\1#g' \ + -e 's#=control/#=${SHOUTCASTDIR}/#g' ${WRKSRC}/sc_serv_${_file}.conf +.endfor +.if defined(WITH_CONFIG_BUILDER) + @${REINPLACE_CMD} -e 's#<[^>]*>Windows<[^>]*>##g' \ + -e 's#<[^>]*>Macintosh<[^>]*>##g' ${WRKSRC}/config_builder/config_builder.html + @${REINPLACE_CMD} -e 's#\(LogFile="\)\([^"/]*\)#\1${SHOUTCASTLDIR}/\2#g' \ + -e 's#\(ConfFile="\)\([^"/]*\)#\1${ETCDIR}/\2#g' \ + -e 's#\(BanFile="\)\([^"/]*\)#\1${SHOUTCASTDIR}/\2#g' \ + -e 's#\(RipFile="\)\([^"/]*\)#\1${SHOUTCASTDIR}/\2#g' ${WRKSRC}/config_builder/js/config_builder.js +.endif do-install: ${INSTALL_PROGRAM} ${WRKSRC}/sc_serv ${PREFIX}/sbin ${MKDIR} ${ETCDIR} - ${INSTALL_DATA} ${WRKSRC}/sc_serv_basic.conf ${ETCDIR}/sc_serv_basic.conf.sample - ${INSTALL_DATA} ${WRKSRC}/sc_serv_debug.conf ${ETCDIR}/sc_serv_debug.conf.sample - ${INSTALL_DATA} ${WRKSRC}/sc_serv_public.conf ${ETCDIR}/sc_serv_public.conf.sample - ${INSTALL_DATA} ${WRKSRC}/sc_serv_relay.conf ${ETCDIR}/sc_serv_relay.conf.sample - ${INSTALL_DATA} ${WRKSRC}/sc_serv_simple.conf ${ETCDIR}/sc_serv_simple.conf.sample .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/changes.txt ${DOCSDIR}/changes.txt - ${INSTALL_DATA} ${WRKSRC}/docs/crossdomain.xml ${DOCSDIR}/crossdomain.xml - ${INSTALL_DATA} ${WRKSRC}/docs/dsp_sc/dsp_sc.txt ${DOCSDIR}/dsp_sc.txt - ${INSTALL_DATA} ${WRKSRC}/docs/dsp_sc/dsp_sc_config.txt ${DOCSDIR}/dsp_sc_config.txt ${INSTALL_DATA} ${WRKSRC}/docs/getting_started.txt ${DOCSDIR}/getting_started.txt ${INSTALL_DATA} ${WRKSRC}/docs/sc_serv2.txt ${DOCSDIR}/sc_serv2.txt ${INSTALL_DATA} ${WRKSRC}/docs/sc_serv2_authhash.txt ${DOCSDIR}/sc_serv2_authhash.txt ${INSTALL_DATA} ${WRKSRC}/docs/sc_serv2_xml_responses.txt ${DOCSDIR}/sc_serv2_xml_responses.txt ${INSTALL_DATA} ${WRKSRC}/docs/shoutcast_system_overview.txt ${DOCSDIR}/shoutcast_system_overview.txt + ${INSTALL_DATA} ${WRKSRC}/tos.txt ${DOCSDIR}/tos.txt +.endif +.if !defined(NOPORTEXAMPLES) + ${MKDIR} ${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/docs/crossdomain.xml ${EXAMPLESDIR}/crossdomain.xml + ${INSTALL_DATA} ${WRKSRC}/sc_serv_basic.conf ${EXAMPLESDIR}/sc_serv_basic.conf + ${INSTALL_DATA} ${WRKSRC}/sc_serv_debug.conf ${EXAMPLESDIR}/sc_serv_debug.conf + ${INSTALL_DATA} ${WRKSRC}/sc_serv_public.conf ${EXAMPLESDIR}/sc_serv_public.conf + ${INSTALL_DATA} ${WRKSRC}/sc_serv_relay.conf ${EXAMPLESDIR}/sc_serv_relay.conf + ${INSTALL_DATA} ${WRKSRC}/sc_serv_simple.conf ${EXAMPLESDIR}/sc_serv_simple.conf +.endif +.if defined(WITH_CONFIG_BUILDER) + ${MKDIR} ${WWWDIR}/config_builder + ${INSTALL_DATA} ${WRKSRC}/config_builder/config_builder.html ${WWWDIR}/config_builder/config_builder.html + ${MKDIR} ${WWWDIR}/config_builder/db + ${INSTALL_DATA} ${WRKSRC}/config_builder/db/config_builder_help.txt ${WWWDIR}/config_builder/db/config_builder_help.txt + ${MKDIR} ${WWWDIR}/config_builder/js + ${INSTALL_DATA} ${WRKSRC}/config_builder/js/config_builder.js ${WWWDIR}/config_builder/js/config_builder.js + ${INSTALL_DATA} ${WRKSRC}/config_builder/js/downloadify.js ${WWWDIR}/config_builder/js/downloadify.js + ${INSTALL_DATA} ${WRKSRC}/config_builder/js/mootools-1.3.js ${WWWDIR}/config_builder/js/mootools-1.3.js + ${INSTALL_DATA} ${WRKSRC}/config_builder/js/swfobject.js ${WWWDIR}/config_builder/js/swfobject.js + ${MKDIR} ${WWWDIR}/config_builder/res + ${INSTALL_DATA} ${WRKSRC}/config_builder/res/collapse.png ${WWWDIR}/config_builder/res/collapse.png + ${INSTALL_DATA} ${WRKSRC}/config_builder/res/config_builder.css ${WWWDIR}/config_builder/res/config_builder.css + ${INSTALL_DATA} ${WRKSRC}/config_builder/res/dl_button.png ${WWWDIR}/config_builder/res/dl_button.png + ${INSTALL_DATA} ${WRKSRC}/config_builder/res/downloadify.swf ${WWWDIR}/config_builder/res/downloadify.swf + ${INSTALL_DATA} ${WRKSRC}/config_builder/res/expand.png ${WWWDIR}/config_builder/res/expand.png + ${INSTALL_DATA} ${WRKSRC}/config_builder/res/sc_logo.png ${WWWDIR}/config_builder/res/sc_logo.png .endif post-install: - ${MKDIR} ${SHOUTCASTDIR} - @${CHMOD} 0750 ${SHOUTCASTDIR} + ${MKDIR} ${SHOUTCASTDIR} ${SHOUTCASTLDIR} + @${CHMOD} 0750 ${SHOUTCASTDIR} ${SHOUTCASTLDIR} @${CHOWN} ${SHOUTCASTUSER}:${SHOUTCASTGROUP} ${SHOUTCASTDIR} + @${CHOWN} ${SHOUTCASTUSER}:wheel ${SHOUTCASTLDIR} @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/audio/shoutcast/files/pkg-message.in b/audio/shoutcast/files/pkg-message.in index 3659cf523217..950c76b4e4fb 100644 --- a/audio/shoutcast/files/pkg-message.in +++ b/audio/shoutcast/files/pkg-message.in @@ -6,8 +6,8 @@ shoutcast_enable="YES" - Configuration templates are available in %%ETCDIR%% as - *.sample files. A basic installation can be completed by copying - sc_serv_basic.conf.sample to sc_serv.conf. + See %%EXAMPLESDIR%% for configuration examples. + A basic installation can be completed by copying sc_serv_basic.conf + to %%ETCDIR%%/sc_serv.conf. ********************************************************************** diff --git a/audio/shoutcast/files/shoutcast.in b/audio/shoutcast/files/shoutcast.in index 255d6066efc5..c9d5aa2d657b 100644 --- a/audio/shoutcast/files/shoutcast.in +++ b/audio/shoutcast/files/shoutcast.in @@ -12,8 +12,6 @@ # shoutcast_configfile (str): Set to "%%ETCDIR%%/sc_serv.conf" by default. # shoutcast_user (str): Set to "%%SHOUTCASTUSER%%" by default. # shoutcast_chdir (str): Set to "%%SHOUTCASTDIR%%" by default. -# shoutcast_logfile (str): Set to "/var/log/sc_serv.log" by default. -# shoutcast_w3clog (str): Set to "/var/log/sc_w3c.log" by default. . /etc/rc.subr @@ -26,22 +24,12 @@ load_rc_config ${name} : ${shoutcast_configfile:="%%ETCDIR%%/sc_serv.conf"} : ${shoutcast_user:="%%SHOUTCASTUSER%%"} : ${shoutcast_chdir:="%%SHOUTCASTDIR%%"} -: ${shoutcast_logfile:="/var/log/sc_serv.log"} -: ${shoutcast_w3clog:="/var/log/sc_w3c.log"} command="%%PREFIX%%/sbin/sc_serv" +required_dirs="${shoutcast_chdir}" required_files="${shoutcast_configfile}" command_args="${shoutcast_configfile} >/dev/null 2>&1 &" -start_precmd="shoutcast_prestart" - -shoutcast_prestart() -{ - touch "${shoutcast_logfile}" "${shoutcast_w3clog}" - chown %%SHOUTCASTUSER%%:wheel "${shoutcast_logfile}" "${shoutcast_w3clog}" - chmod 0640 "${shoutcast_logfile}" "${shoutcast_w3clog}" -} - run_rc_command "$1" diff --git a/audio/shoutcast/pkg-plist b/audio/shoutcast/pkg-plist index d632551e5aae..bc99f189e120 100644 --- a/audio/shoutcast/pkg-plist +++ b/audio/shoutcast/pkg-plist @@ -1,23 +1,45 @@ -@exec mkdir -p %%SHOUTCASTDIR%% -@exec chmod 0750 %%SHOUTCASTDIR%% +@exec mkdir -p %%SHOUTCASTDIR%% %%SHOUTCASTLDIR%% %%ETCDIR%% +@exec chmod 0750 %%SHOUTCASTDIR%% %%SHOUTCASTLDIR%% @exec chown %%SHOUTCASTUSER%%:%%SHOUTCASTGROUP%% %%SHOUTCASTDIR%% -%%ETCDIR%%/sc_serv_basic.conf.sample -%%ETCDIR%%/sc_serv_debug.conf.sample -%%ETCDIR%%/sc_serv_public.conf.sample -%%ETCDIR%%/sc_serv_relay.conf.sample -%%ETCDIR%%/sc_serv_simple.conf.sample +@exec chown %%SHOUTCASTUSER%%:wheel %%SHOUTCASTLDIR%% sbin/sc_serv %%PORTDOCS%%%%DOCSDIR%%/changes.txt -%%PORTDOCS%%%%DOCSDIR%%/crossdomain.xml -%%PORTDOCS%%%%DOCSDIR%%/dsp_sc.txt -%%PORTDOCS%%%%DOCSDIR%%/dsp_sc_config.txt %%PORTDOCS%%%%DOCSDIR%%/getting_started.txt %%PORTDOCS%%%%DOCSDIR%%/sc_serv2.txt %%PORTDOCS%%%%DOCSDIR%%/sc_serv2_authhash.txt %%PORTDOCS%%%%DOCSDIR%%/sc_serv2_xml_responses.txt %%PORTDOCS%%%%DOCSDIR%%/shoutcast_system_overview.txt +%%PORTDOCS%%%%DOCSDIR%%/tos.txt +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/crossdomain.xml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_basic.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_debug.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_public.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_relay.conf +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_simple.conf +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/config_builder.html +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/db/config_builder_help.txt +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/js/config_builder.js +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/js/downloadify.js +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/js/mootools-1.3.js +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/js/swfobject.js +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/res/collapse.png +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/res/config_builder.css +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/res/dl_button.png +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/res/downloadify.swf +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/res/expand.png +%%CONFIG_BUILDER%%%%WWWDIR%%/config_builder/res/sc_logo.png @dirrmtry %%ETCDIR%% %%PORTDOCS%%@dirrm %%DOCSDIR%% +%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%% +%%CONFIG_BUILDER%%@dirrm %%WWWDIR%%/config_builder/db +%%CONFIG_BUILDER%%@dirrm %%WWWDIR%%/config_builder/js +%%CONFIG_BUILDER%%@dirrm %%WWWDIR%%/config_builder/res +%%CONFIG_BUILDER%%@dirrm %%WWWDIR%%/config_builder +%%CONFIG_BUILDER%%@dirrm %%WWWDIR%% @unexec if [ ! -s %%SHOUTCASTDIR%%/sc_serv.ban ]; then rm -f %%SHOUTCASTDIR%%/sc_serv.ban; fi @unexec if [ ! -s %%SHOUTCASTDIR%%/sc_serv.rip ]; then rm -f %%SHOUTCASTDIR%%/sc_serv.rip; fi @unexec rmdir %%SHOUTCASTDIR%% 2>/dev/null || true +@unexec rmdir %%SHOUTCASTLDIR%% 2>/dev/null || true +@unexec if [ -d %D/%%ETCDIR%% ]; then echo "==> You should manually remove the "\""%D/%%ETCDIR%%"\"" directory."; fi +@unexec if [ -d %%SHOUTCASTDIR%% ]; then echo "==> You should manually remove the "\""%%SHOUTCASTDIR%%"\"" directory."; fi +@unexec if [ -d %%SHOUTCASTLDIR%% ]; then echo "==> You should manually remove the "\""%%SHOUTCASTLDIR%%"\"" directory."; fi |