1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00

audio/shoutcast: Significant overhaul of Makefile and cleanup.

- Bump PORTREVISION
- Fix *_DESC variable for SERVERSETUP option
- Simplify post-patch
- Remove unneeded mkdir, if sub-directories available for creation
- Silence mkdir
- Use COPYTREE_SHARE with directory/file patterns, instead of manual copying of
  each file
- Remove pkg-plist and use dynamic package list with PORTDATA, PORTDOCS,
  PORTEXAMPLES, PLIST_FILES and PLIST_DIRS
- Fix unexec usage, because it was deprecated

PR:	210203
Submitted by:	lightside@gmx.com
This commit is contained in:
Sean Bruno 2016-06-14 17:09:36 +00:00
parent 29f3aeb81c
commit b83314ef60
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=416900
2 changed files with 31 additions and 140 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= shoutcast
PORTVERSION= 2.4.7.256
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= audio net
MASTER_SITES= http://download.nullsoft.com/shoutcast/tools/ \
http://people.freebsd.org/~sbruno/shoutcast/distfiles/
@ -28,30 +28,33 @@ NO_BUILD= yes
OPTIONS_DEFINE= SERVERSETUP DOCS EXAMPLES
OPTIONS_DEFAULT= SERVERSETUP
OPTIONS_SUB= yes
SETUPSERVER_DESC= SHOUTcast Server Setup Tools
SERVERSETUP_DESC= SHOUTcast Server Setup Tools
EXAMPLE_DESC= SHOUTcast Server Example Configuration Files
SHOUTCASTUSER= ${PORTNAME}
SHOUTCASTGROUP= ${PORTNAME}
DATADIR= ${WWWDIR}
SHOUTCASTLDIR= /var/log/${PORTNAME}
SHOUTCASTDIR= /var/run/${PORTNAME}
SHOUTCAST_SUB= SHOUTCASTUSER=${SHOUTCASTUSER} \
SHOUTCASTGROUP=${SHOUTCASTGROUP} \
SHOUTCASTLDIR=${SHOUTCASTLDIR} \
SHOUTCASTDIR=${SHOUTCASTDIR}
PLIST_SUB= ${SHOUTCAST_SUB}
SUB_FILES= pkg-message
SUB_LIST= ${SHOUTCAST_SUB}
SHOUTCASTUSER= ${PORTNAME}
SHOUTCASTGROUP= ${PORTNAME}
USERS= ${SHOUTCASTUSER}
GROUPS= ${SHOUTCASTGROUP}
SUB_FILES= pkg-message
SUB_LIST= SHOUTCASTUSER=${SHOUTCASTUSER} SHOUTCASTDIR=${SHOUTCASTDIR}
PORTDATA= *
PORTDOCS= docs *.html *.pem *.txt
PORTEXAMPLES= *.conf
PLIST_DIRS= ${ETCDIR} ${SHOUTCASTLDIR} ${SHOUTCASTDIR} \
${SHOUTCASTDIR}/control ${SHOUTCASTDIR}/logs
PLIST_FILES= sbin/sc_serv
.for ext in ban rip
PLIST_FILES+= "@postunexec if [ ! -s ${SHOUTCASTDIR}/sc_serv.${ext} ];\
then ${RM} ${SHOUTCASTDIR}/sc_serv.${ext}; fi"
.endfor
.include <bsd.port.options.mk>
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000010
@ -63,79 +66,25 @@ RUN_DEPENDS+= ${LOCALBASE}/lib32/compat/libstdc++.so.6:misc/compat9x
.endif
post-patch:
.for _file in basic public relay simple
@${REINPLACE_CMD} -e '/sc_serv2 directory/d' \
-e 's#=.*/\([^\.]*.log\)#=${SHOUTCASTLDIR}/\1#g' \
-e 's#=control/#=${SHOUTCASTDIR}/#g' ${WRKSRC}/examples/sc_serv_${_file}.conf
.endfor
-e 's#=control/#=${SHOUTCASTDIR}/#g' ${WRKSRC}/examples/sc_serv_*.conf
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/sc_serv ${STAGEDIR}${PREFIX}/sbin
${MKDIR} ${STAGEDIR}${ETCDIR}
${MKDIR} ${STAGEDIR}${SHOUTCASTLDIR}
${MKDIR} ${STAGEDIR}${SHOUTCASTDIR}
${MKDIR} ${STAGEDIR}${SHOUTCASTDIR}/logs
${MKDIR} ${STAGEDIR}${SHOUTCASTDIR}/control
@${MKDIR} ${STAGEDIR}${ETCDIR}
@${MKDIR} ${STAGEDIR}${SHOUTCASTLDIR}
@${MKDIR} ${STAGEDIR}${SHOUTCASTDIR}/control
@${MKDIR} ${STAGEDIR}${SHOUTCASTDIR}/logs
do-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/DNAS_Server_Changelog.html ${STAGEDIR}${DOCSDIR}/DNAS_Server_Changelog.html
${INSTALL_DATA} ${WRKSRC}/Readme_DNAS_Server.html ${STAGEDIR}${DOCSDIR}/Readme_DNAS_Server.html
${INSTALL_DATA} ${WRKSRC}/tos.txt ${STAGEDIR}${DOCSDIR}/tos.txt
${INSTALL_DATA} ${WRKSRC}/cacert.pem ${STAGEDIR}${DOCSDIR}/cacert.pem
${MKDIR} ${STAGEDIR}${DOCSDIR}/docs
${INSTALL_DATA} ${WRKSRC}/docs/Getting_Started.html ${STAGEDIR}${DOCSDIR}/docs/Getting_Started.html
${INSTALL_DATA} ${WRKSRC}/docs/DNAS_Server_XML_Responses.html ${STAGEDIR}${DOCSDIR}/docs/DNAS_Server_XML_Responses.html
${INSTALL_DATA} ${WRKSRC}/docs/DNAS_Server_Authhash_Management.html ${STAGEDIR}${DOCSDIR}/docs/DNAS_Server_Authhash_Management.html
${INSTALL_DATA} ${WRKSRC}/docs/DNAS_Server.html ${STAGEDIR}${DOCSDIR}/docs/DNAS_Server.html
${INSTALL_DATA} ${WRKSRC}/docs/DNAS_Server_JSON_Responses.html ${STAGEDIR}${DOCSDIR}/docs/DNAS_Server_JSON_Responses.html
${INSTALL_DATA} ${WRKSRC}/docs/DNAS_Server_CDN_Management.html ${STAGEDIR}${DOCSDIR}/docs/DNAS_Server_CDN_Management.html
${INSTALL_DATA} ${WRKSRC}/docs/DNAS_Server_Source_Support.html ${STAGEDIR}${DOCSDIR}/docs/DNAS_Server_Source_Support.html
${MKDIR} ${STAGEDIR}${DOCSDIR}/docs/res
${INSTALL_DATA} ${WRKSRC}/docs/res/Linux_Console.png ${STAGEDIR}${DOCSDIR}/docs/res/Linux_Console.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Output_tag_configuration_error.png ${STAGEDIR}${DOCSDIR}/docs/res/Output_tag_configuration_error.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Stream_Ban_List_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Stream_Ban_List_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Stream_Blocked_User_Agent_List_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Stream_Blocked_User_Agent_List_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Start.png ${STAGEDIR}${DOCSDIR}/docs/res/Start.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Server_Bandwidth_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Server_Bandwidth_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Manual.png ${STAGEDIR}${DOCSDIR}/docs/res/Manual.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Completed.png ${STAGEDIR}${DOCSDIR}/docs/res/Completed.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Simple.png ${STAGEDIR}${DOCSDIR}/docs/res/Simple.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Console_Error.png ${STAGEDIR}${DOCSDIR}/docs/res/Console_Error.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Server_Log_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Server_Log_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Server_Source_Connection_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Server_Source_Connection_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Select_Source_DSP_in_Winamp.png ${STAGEDIR}${DOCSDIR}/docs/res/Select_Source_DSP_in_Winamp.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Console_Linux.png ${STAGEDIR}${DOCSDIR}/docs/res/Console_Linux.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Windows_Service_Install_Failure.png ${STAGEDIR}${DOCSDIR}/docs/res/Windows_Service_Install_Failure.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Stream_Summary_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Stream_Summary_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Stream_Admin_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Stream_Admin_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Streams_Summary_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Streams_Summary_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Console_Setup_Mode.png ${STAGEDIR}${DOCSDIR}/docs/res/Console_Setup_Mode.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Invalid_Configuration_Item.png ${STAGEDIR}${DOCSDIR}/docs/res/Invalid_Configuration_Item.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Server_Summary_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Server_Summary_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Example_Windows_Console.png ${STAGEDIR}${DOCSDIR}/docs/res/Example_Windows_Console.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Example_Linux_Console.png ${STAGEDIR}${DOCSDIR}/docs/res/Example_Linux_Console.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Linux_Daemon_Mode.png ${STAGEDIR}${DOCSDIR}/docs/res/Linux_Daemon_Mode.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Windows_Console.png ${STAGEDIR}${DOCSDIR}/docs/res/Windows_Console.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Stream_Reserved_List_Page.png ${STAGEDIR}${DOCSDIR}/docs/res/Stream_Reserved_List_Page.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Summary.png ${STAGEDIR}${DOCSDIR}/docs/res/Summary.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Setup_Mode_Error.png ${STAGEDIR}${DOCSDIR}/docs/res/Setup_Mode_Error.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Editing.png ${STAGEDIR}${DOCSDIR}/docs/res/Editing.png
${INSTALL_DATA} ${WRKSRC}/docs/res/Console_Windows.png ${STAGEDIR}${DOCSDIR}/docs/res/Console_Windows.png
${INSTALL_DATA} ${WRKSRC}/docs/res/View_Source_Connection_Details.png ${STAGEDIR}${DOCSDIR}/docs/res/View_Source_Connection_Details.png
do-install-SERVERSETUP-on:
${MKDIR} ${STAGEDIR}${WWWDIR}/setup
${INSTALL_DATA} ${WRKSRC}/setup.sh ${STAGEDIR}${WWWDIR}/setup.sh
${INSTALL_DATA} ${WRKSRC}/setup/setup.js ${STAGEDIR}${WWWDIR}/setup/setup.js
${INSTALL_DATA} ${WRKSRC}/setup/setup.html ${STAGEDIR}${WWWDIR}/setup/setup.html
${INSTALL_DATA} ${WRKSRC}/setup/setup.txt ${STAGEDIR}${WWWDIR}/setup/setup.txt
(cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" ${STAGEDIR}${DOCSDIR})
do-install-EXAMPLES-on:
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/examples/sc_serv_basic.conf ${STAGEDIR}${EXAMPLESDIR}/sc_serv_basic.conf
${INSTALL_DATA} ${WRKSRC}/examples/sc_serv_public.conf ${STAGEDIR}${EXAMPLESDIR}/sc_serv_public.conf
${INSTALL_DATA} ${WRKSRC}/examples/sc_serv_relay.conf ${STAGEDIR}${EXAMPLESDIR}/sc_serv_relay.conf
${INSTALL_DATA} ${WRKSRC}/examples/sc_serv_simple.conf ${STAGEDIR}${EXAMPLESDIR}/sc_serv_simple.conf
(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} "${PORTEXAMPLES}" \
${STAGEDIR}${EXAMPLESDIR})
do-install-SERVERSETUP-on:
(cd ${WRKSRC} && ${COPYTREE_SHARE} "setup setup.sh" ${STAGEDIR}${DATADIR})
.include <bsd.port.mk>

View File

@ -1,58 +0,0 @@
sbin/sc_serv
%%PORTDOCS%%%%DOCSDIR%%/DNAS_Server_Changelog.html
%%PORTDOCS%%%%DOCSDIR%%/Readme_DNAS_Server.html
%%PORTDOCS%%%%DOCSDIR%%/cacert.pem
%%PORTDOCS%%%%DOCSDIR%%/tos.txt
%%PORTDOCS%%%%DOCSDIR%%/docs/DNAS_Server_XML_Responses.html
%%PORTDOCS%%%%DOCSDIR%%/docs/DNAS_Server_Authhash_Management.html
%%PORTDOCS%%%%DOCSDIR%%/docs/DNAS_Server.html
%%PORTDOCS%%%%DOCSDIR%%/docs/Getting_Started.html
%%PORTDOCS%%%%DOCSDIR%%/docs/DNAS_Server_JSON_Responses.html
%%PORTDOCS%%%%DOCSDIR%%/docs/DNAS_Server_CDN_Management.html
%%PORTDOCS%%%%DOCSDIR%%/docs/DNAS_Server_Source_Support.html
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Linux_Console.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Output_tag_configuration_error.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Stream_Ban_List_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Stream_Blocked_User_Agent_List_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Start.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Server_Bandwidth_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Manual.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Completed.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Simple.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Console_Error.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Server_Log_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Select_Source_DSP_in_Winamp.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Server_Source_Connection_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Server_Summary_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Console_Linux.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Windows_Service_Install_Failure.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Stream_Summary_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Stream_Admin_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Console_Setup_Mode.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Invalid_Configuration_Item.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Example_Windows_Console.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Example_Linux_Console.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Linux_Daemon_Mode.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Windows_Console.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Stream_Reserved_List_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Streams_Summary_Page.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Summary.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Setup_Mode_Error.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Editing.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/Console_Windows.png
%%PORTDOCS%%%%DOCSDIR%%/docs/res/View_Source_Connection_Details.png
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_basic.conf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_public.conf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_relay.conf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sc_serv_simple.conf
%%SERVERSETUP%%%%WWWDIR%%/setup.sh
%%SERVERSETUP%%%%WWWDIR%%/setup/setup.js
%%SERVERSETUP%%%%WWWDIR%%/setup/setup.html
%%SERVERSETUP%%%%WWWDIR%%/setup/setup.txt
@dir %%ETCDIR%%
@dir %%SHOUTCASTDIR%%/control
@dir %%SHOUTCASTDIR%%/logs
@dir %%SHOUTCASTDIR%%
@dir %%SHOUTCASTLDIR%%
@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