? plist.pl
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/www/red5/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	6 Jun 2011 07:10:12 -0000	1.7
+++ Makefile	13 Aug 2011 19:37:26 -0000
@@ -25,8 +25,18 @@
 
 SUB_LIST+=	RED5_USER=${RED5_USER} RED5_HOME=${RED5_HOME}
 
-pre-install:
+post-patch:
 	@${REINPLACE_CMD} -e 's/0.0.0.0/127.0.0.1/' ${WRKSRC}/conf/red5.properties
+	(cd ${WRKSRC}/conf \
+		&& for file in `find . -type f` ; \
+		   do	${MV} $$file $$file.sample ; \
+		done)
+.for webappssubdir in installer root
+	(cd ${WRKSRC}/webapps/${webappssubdir}/WEB-INF \
+		&& for file in * ; \
+		   do	${MV} $$file $$file.sample ; \
+		done)
+.endfor
 
 do-install:
 	${MKDIR} ${RED5_HOME}/conf ${RED5_HOME}/lib ${RED5_HOME}/webapps ${RED5_HOME}/log
@@ -44,5 +54,11 @@
 .endif
 	@${ECHO_CMD} '@exec ${CHOWN} -R ${RED5_USER}:${RED5_GRP} ${RED5_HOME}' \
 		>> ${TMPPLIST}
+	for file in `find ${RED5_HOME}/conf -type f -regex '.*\.sample$$'` ; \
+	  do	[ -f $$file%.sample ] || ${CP} -p $$file $$file%.sample ; \
+	  done
+	for file in ${RED5_HOME}/webapps/root/WEB-INF/*.sample ${RED5_HOME}/webapps/installer/WEB-INF/*.sample ; \
+	  do	[ -f $$file%.sample ] || ${CP} -p $$file $$file%.sample ; \
+	  done
 
 .include <bsd.port.mk>
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/www/red5/pkg-plist,v
retrieving revision 1.1
diff -u -r1.1 pkg-plist
--- pkg-plist	18 Nov 2010 13:50:50 -0000	1.1
+++ pkg-plist	13 Aug 2011 19:37:27 -0000
@@ -1,45 +1,125 @@
 @stopdaemon red5
 red5/boot.jar
-red5/conf/Red5_SMF.xml
-red5/conf/access.properties
-red5/conf/build_standalone.properties
-red5/conf/catalina.policy
-red5/conf/context.xml
-red5/conf/ehcache.xml
-red5/conf/keystore
-red5/conf/keystore.jmx
-red5/conf/log4j.properties
-red5/conf/logback.xml
-red5/conf/password.properties
-red5/conf/quartz.properties
-red5/conf/realm.properties
-red5/conf/red5-common.xml
-red5/conf/red5-core.xml
-red5/conf/red5-edge-core.xml
-red5/conf/red5-edge.xml
-red5/conf/red5-origin-core.xml
-red5/conf/red5-origin.xml
-red5/conf/red5.globals
-red5/conf/red5.policy
-red5/conf/red5.properties
-red5/conf/red5.properties.bak
-red5/conf/red5.xml
-red5/conf/tomcat-users.xml
-red5/conf/truststore.jmx
-red5/conf/war/README.txt
-red5/conf/war/beanRefContext.xml
-red5/conf/war/build_war.properties
-red5/conf/war/context.xml
-red5/conf/war/defaultContext.xml
-red5/conf/war/logback.xml
-red5/conf/war/red5-common.xml
-red5/conf/war/red5-core.xml
-red5/conf/war/red5-web.properties
-red5/conf/war/red5.properties
-red5/conf/war/root-context.xml
-red5/conf/war/root-web.xml
-red5/conf/war/web.xml
-red5/conf/web.xml
+@unexec cmp -s %D/red5/conf/Red5_SMF.xml.sample %D/red5/conf/Red5_SMF.xml && rm -f %D/red5/conf/Red5_SMF.xml || true 2>/dev/null
+red5/conf/Red5_SMF.xml.sample
+@exec [ -f %D/red5/conf/Red5_SMF.xml ] || cp -p %D/red5/conf/Red5_SMF.xml.sample %D/red5/conf/Red5_SMF.xml
+@unexec cmp -s %D/red5/conf/access.properties.sample %D/red5/conf/access.properties && rm -f %D/red5/conf/access.properties || true 2>/dev/null
+red5/conf/access.properties.sample
+@exec [ -f %D/red5/conf/access.properties ] || cp -p %D/red5/conf/access.properties.sample %D/red5/conf/access.properties
+@unexec cmp -s %D/red5/conf/build_standalone.properties.sample %D/red5/conf/build_standalone.properties && rm -f %D/red5/conf/build_standalone.properties || true 2>/dev/null
+red5/conf/build_standalone.properties.sample
+@exec [ -f %D/red5/conf/build_standalone.properties ] || cp -p %D/red5/conf/build_standalone.properties.sample %D/red5/conf/build_standalone.properties
+@unexec cmp -s %D/red5/conf/catalina.policy.sample %D/red5/conf/catalina.policy && rm -f %D/red5/conf/catalina.policy || true 2>/dev/null
+red5/conf/catalina.policy.sample
+@exec [ -f %D/red5/conf/catalina.policy ] || cp -p %D/red5/conf/catalina.policy.sample %D/red5/conf/catalina.policy
+@unexec cmp -s %D/red5/conf/context.xml.sample %D/red5/conf/context.xml && rm -f %D/red5/conf/context.xml || true 2>/dev/null
+red5/conf/context.xml.sample
+@exec [ -f %D/red5/conf/context.xml ] || cp -p %D/red5/conf/context.xml.sample %D/red5/conf/context.xml
+@unexec cmp -s %D/red5/conf/ehcache.xml.sample %D/red5/conf/ehcache.xml && rm -f %D/red5/conf/ehcache.xml || true 2>/dev/null
+red5/conf/ehcache.xml.sample
+@exec [ -f %D/red5/conf/ehcache.xml ] || cp -p %D/red5/conf/ehcache.xml.sample %D/red5/conf/ehcache.xml
+@unexec cmp -s %D/red5/conf/keystore.sample %D/red5/conf/keystore && rm -f %D/red5/conf/keystore || true 2>/dev/null
+red5/conf/keystore.sample
+@exec [ -f %D/red5/conf/keystore ] || cp -p %D/red5/conf/keystore.sample %D/red5/conf/keystore
+@unexec cmp -s %D/red5/conf/keystore.jmx.sample %D/red5/conf/keystore.jmx && rm -f %D/red5/conf/keystore.jmx || true 2>/dev/null
+red5/conf/keystore.jmx.sample
+@exec [ -f %D/red5/conf/keystore.jmx ] || cp -p %D/red5/conf/keystore.jmx.sample %D/red5/conf/keystore.jmx
+@unexec cmp -s %D/red5/conf/log4j.properties.sample %D/red5/conf/log4j.properties && rm -f %D/red5/conf/log4j.properties || true 2>/dev/null
+red5/conf/log4j.properties.sample
+@exec [ -f %D/red5/conf/log4j.properties ] || cp -p %D/red5/conf/log4j.properties.sample %D/red5/conf/log4j.properties
+@unexec cmp -s %D/red5/conf/logback.xml.sample %D/red5/conf/logback.xml && rm -f %D/red5/conf/logback.xml || true 2>/dev/null
+red5/conf/logback.xml.sample
+@exec [ -f %D/red5/conf/logback.xml ] || cp -p %D/red5/conf/logback.xml.sample %D/red5/conf/logback.xml
+@unexec cmp -s %D/red5/conf/password.properties.sample %D/red5/conf/password.properties && rm -f %D/red5/conf/password.properties || true 2>/dev/null
+red5/conf/password.properties.sample
+@exec [ -f %D/red5/conf/password.properties ] || cp -p %D/red5/conf/password.properties.sample %D/red5/conf/password.properties
+@unexec cmp -s %D/red5/conf/quartz.properties.sample %D/red5/conf/quartz.properties && rm -f %D/red5/conf/quartz.properties || true 2>/dev/null
+red5/conf/quartz.properties.sample
+@exec [ -f %D/red5/conf/quartz.properties ] || cp -p %D/red5/conf/quartz.properties.sample %D/red5/conf/quartz.properties
+@unexec cmp -s %D/red5/conf/realm.properties.sample %D/red5/conf/realm.properties && rm -f %D/red5/conf/realm.properties || true 2>/dev/null
+red5/conf/realm.properties.sample
+@exec [ -f %D/red5/conf/realm.properties ] || cp -p %D/red5/conf/realm.properties.sample %D/red5/conf/realm.properties
+@unexec cmp -s %D/red5/conf/red5-common.xml.sample %D/red5/conf/red5-common.xml && rm -f %D/red5/conf/red5-common.xml || true 2>/dev/null
+red5/conf/red5-common.xml.sample
+@exec [ -f %D/red5/conf/red5-common.xml ] || cp -p %D/red5/conf/red5-common.xml.sample %D/red5/conf/red5-common.xml
+@unexec cmp -s %D/red5/conf/red5-core.xml.sample %D/red5/conf/red5-core.xml && rm -f %D/red5/conf/red5-core.xml || true 2>/dev/null
+red5/conf/red5-core.xml.sample
+@exec [ -f %D/red5/conf/red5-core.xml ] || cp -p %D/red5/conf/red5-core.xml.sample %D/red5/conf/red5-core.xml
+@unexec cmp -s %D/red5/conf/red5-edge-core.xml.sample %D/red5/conf/red5-edge-core.xml && rm -f %D/red5/conf/red5-edge-core.xml || true 2>/dev/null
+red5/conf/red5-edge-core.xml.sample
+@exec [ -f %D/red5/conf/red5-edge-core.xml ] || cp -p %D/red5/conf/red5-edge-core.xml.sample %D/red5/conf/red5-edge-core.xml
+@unexec cmp -s %D/red5/conf/red5-edge.xml.sample %D/red5/conf/red5-edge.xml && rm -f %D/red5/conf/red5-edge.xml || true 2>/dev/null
+red5/conf/red5-edge.xml.sample
+@exec [ -f %D/red5/conf/red5-edge.xml ] || cp -p %D/red5/conf/red5-edge.xml.sample %D/red5/conf/red5-edge.xml
+@unexec cmp -s %D/red5/conf/red5-origin-core.xml.sample %D/red5/conf/red5-origin-core.xml && rm -f %D/red5/conf/red5-origin-core.xml || true 2>/dev/null
+red5/conf/red5-origin-core.xml.sample
+@exec [ -f %D/red5/conf/red5-origin-core.xml ] || cp -p %D/red5/conf/red5-origin-core.xml.sample %D/red5/conf/red5-origin-core.xml
+@unexec cmp -s %D/red5/conf/red5-origin.xml.sample %D/red5/conf/red5-origin.xml && rm -f %D/red5/conf/red5-origin.xml || true 2>/dev/null
+red5/conf/red5-origin.xml.sample
+@exec [ -f %D/red5/conf/red5-origin.xml ] || cp -p %D/red5/conf/red5-origin.xml.sample %D/red5/conf/red5-origin.xml
+@unexec cmp -s %D/red5/conf/red5.globals.sample %D/red5/conf/red5.globals && rm -f %D/red5/conf/red5.globals || true 2>/dev/null
+red5/conf/red5.globals.sample
+@exec [ -f %D/red5/conf/red5.globals ] || cp -p %D/red5/conf/red5.globals.sample %D/red5/conf/red5.globals
+@unexec cmp -s %D/red5/conf/red5.policy.sample %D/red5/conf/red5.policy && rm -f %D/red5/conf/red5.policy || true 2>/dev/null
+red5/conf/red5.policy.sample
+@exec [ -f %D/red5/conf/red5.policy ] || cp -p %D/red5/conf/red5.policy.sample %D/red5/conf/red5.policy
+@unexec cmp -s %D/red5/conf/red5.properties.sample %D/red5/conf/red5.properties && rm -f %D/red5/conf/red5.properties || true 2>/dev/null
+red5/conf/red5.properties.sample
+@exec [ -f %D/red5/conf/red5.properties ] || cp -p %D/red5/conf/red5.properties.sample %D/red5/conf/red5.properties
+@unexec cmp -s %D/red5/conf/red5.properties.bak.sample %D/red5/conf/red5.properties.bak && rm -f %D/red5/conf/red5.properties.bak || true 2>/dev/null
+red5/conf/red5.properties.bak.sample
+@exec [ -f %D/red5/conf/red5.properties.bak ] || cp -p %D/red5/conf/red5.properties.bak.sample %D/red5/conf/red5.properties.bak
+@unexec cmp -s %D/red5/conf/red5.xml.sample %D/red5/conf/red5.xml && rm -f %D/red5/conf/red5.xml || true 2>/dev/null
+red5/conf/red5.xml.sample
+@exec [ -f %D/red5/conf/red5.xml ] || cp -p %D/red5/conf/red5.xml.sample %D/red5/conf/red5.xml
+@unexec cmp -s %D/red5/conf/tomcat-users.xml.sample %D/red5/conf/tomcat-users.xml && rm -f %D/red5/conf/tomcat-users.xml || true 2>/dev/null
+red5/conf/tomcat-users.xml.sample
+@exec [ -f %D/red5/conf/tomcat-users.xml ] || cp -p %D/red5/conf/tomcat-users.xml.sample %D/red5/conf/tomcat-users.xml
+@unexec cmp -s %D/red5/conf/truststore.jmx.sample %D/red5/conf/truststore.jmx && rm -f %D/red5/conf/truststore.jmx || true 2>/dev/null
+red5/conf/truststore.jmx.sample
+@exec [ -f %D/red5/conf/truststore.jmx ] || cp -p %D/red5/conf/truststore.jmx.sample %D/red5/conf/truststore.jmx
+@unexec cmp -s %D/red5/conf/war/README.txt.sample %D/red5/conf/war/README.txt && rm -f %D/red5/conf/war/README.txt || true 2>/dev/null
+red5/conf/war/README.txt.sample
+@exec [ -f %D/red5/conf/war/README.txt ] || cp -p %D/red5/conf/war/README.txt.sample %D/red5/conf/war/README.txt
+@unexec cmp -s %D/red5/conf/war/beanRefContext.xml.sample %D/red5/conf/war/beanRefContext.xml && rm -f %D/red5/conf/war/beanRefContext.xml || true 2>/dev/null
+red5/conf/war/beanRefContext.xml.sample
+@exec [ -f %D/red5/conf/war/beanRefContext.xml ] || cp -p %D/red5/conf/war/beanRefContext.xml.sample %D/red5/conf/war/beanRefContext.xml
+@unexec cmp -s %D/red5/conf/war/build_war.properties.sample %D/red5/conf/war/build_war.properties && rm -f %D/red5/conf/war/build_war.properties || true 2>/dev/null
+red5/conf/war/build_war.properties.sample
+@exec [ -f %D/red5/conf/war/build_war.properties ] || cp -p %D/red5/conf/war/build_war.properties.sample %D/red5/conf/war/build_war.properties
+@unexec cmp -s %D/red5/conf/war/context.xml.sample %D/red5/conf/war/context.xml && rm -f %D/red5/conf/war/context.xml || true 2>/dev/null
+red5/conf/war/context.xml.sample
+@exec [ -f %D/red5/conf/war/context.xml ] || cp -p %D/red5/conf/war/context.xml.sample %D/red5/conf/war/context.xml
+@unexec cmp -s %D/red5/conf/war/defaultContext.xml.sample %D/red5/conf/war/defaultContext.xml && rm -f %D/red5/conf/war/defaultContext.xml || true 2>/dev/null
+red5/conf/war/defaultContext.xml.sample
+@exec [ -f %D/red5/conf/war/defaultContext.xml ] || cp -p %D/red5/conf/war/defaultContext.xml.sample %D/red5/conf/war/defaultContext.xml
+@unexec cmp -s %D/red5/conf/war/logback.xml.sample %D/red5/conf/war/logback.xml && rm -f %D/red5/conf/war/logback.xml || true 2>/dev/null
+red5/conf/war/logback.xml.sample
+@exec [ -f %D/red5/conf/war/logback.xml ] || cp -p %D/red5/conf/war/logback.xml.sample %D/red5/conf/war/logback.xml
+@unexec cmp -s %D/red5/conf/war/red5-common.xml.sample %D/red5/conf/war/red5-common.xml && rm -f %D/red5/conf/war/red5-common.xml || true 2>/dev/null
+red5/conf/war/red5-common.xml.sample
+@exec [ -f %D/red5/conf/war/red5-common.xml ] || cp -p %D/red5/conf/war/red5-common.xml.sample %D/red5/conf/war/red5-common.xml
+@unexec cmp -s %D/red5/conf/war/red5-core.xml.sample %D/red5/conf/war/red5-core.xml && rm -f %D/red5/conf/war/red5-core.xml || true 2>/dev/null
+red5/conf/war/red5-core.xml.sample
+@exec [ -f %D/red5/conf/war/red5-core.xml ] || cp -p %D/red5/conf/war/red5-core.xml.sample %D/red5/conf/war/red5-core.xml
+@unexec cmp -s %D/red5/conf/war/red5-web.properties.sample %D/red5/conf/war/red5-web.properties && rm -f %D/red5/conf/war/red5-web.properties || true 2>/dev/null
+red5/conf/war/red5-web.properties.sample
+@exec [ -f %D/red5/conf/war/red5-web.properties ] || cp -p %D/red5/conf/war/red5-web.properties.sample %D/red5/conf/war/red5-web.properties
+@unexec cmp -s %D/red5/conf/war/red5.properties.sample %D/red5/conf/war/red5.properties && rm -f %D/red5/conf/war/red5.properties || true 2>/dev/null
+red5/conf/war/red5.properties.sample
+@exec [ -f %D/red5/conf/war/red5.properties ] || cp -p %D/red5/conf/war/red5.properties.sample %D/red5/conf/war/red5.properties
+@unexec cmp -s %D/red5/conf/war/root-context.xml.sample %D/red5/conf/war/root-context.xml && rm -f %D/red5/conf/war/root-context.xml || true 2>/dev/null
+red5/conf/war/root-context.xml.sample
+@exec [ -f %D/red5/conf/war/root-context.xml ] || cp -p %D/red5/conf/war/root-context.xml.sample %D/red5/conf/war/root-context.xml
+@unexec cmp -s %D/red5/conf/war/root-web.xml.sample %D/red5/conf/war/root-web.xml && rm -f %D/red5/conf/war/root-web.xml || true 2>/dev/null
+red5/conf/war/root-web.xml.sample
+@exec [ -f %D/red5/conf/war/root-web.xml ] || cp -p %D/red5/conf/war/root-web.xml.sample %D/red5/conf/war/root-web.xml
+@unexec cmp -s %D/red5/conf/war/web.xml.sample %D/red5/conf/war/web.xml && rm -f %D/red5/conf/war/web.xml || true 2>/dev/null
+red5/conf/war/web.xml.sample
+@exec [ -f %D/red5/conf/war/web.xml ] || cp -p %D/red5/conf/war/web.xml.sample %D/red5/conf/war/web.xml
+@unexec cmp -s %D/red5/conf/web.xml.sample %D/red5/conf/web.xml && rm -f %D/red5/conf/web.xml || true 2>/dev/null
+red5/conf/web.xml.sample
+@exec [ -f %D/red5/conf/web.xml ] || cp -p %D/red5/conf/web.xml.sample %D/red5/conf/web.xml
 red5/lib/antlr-3.1.3.jar
 red5/lib/asm-3.1.jar
 red5/lib/asm-commons-3.1.jar
@@ -85,9 +165,15 @@
 red5/lib/xmlrpc-2.0.1.jar
 red5/red5.jar
 red5/webapps/installer/AC_OETags.js
-red5/webapps/installer/WEB-INF/red5-web.properties
-red5/webapps/installer/WEB-INF/red5-web.xml
-red5/webapps/installer/WEB-INF/web.xml
+@unexec cmp -s %D/red5/webapps/installer/WEB-INF/red5-web.properties %D/red5/webapps/installer/WEB-INF/red5-web.properties.sample && rm -f red5/webapps/installer/WEB-INF/red5-web.properties || true 2>/dev/null
+red5/webapps/installer/WEB-INF/red5-web.properties.sample
+@exec [ -f %B/red5-web.properties ] || cp -p %D/%F %B/red5-web.properties
+@unexec cmp -s %D/red5/webapps/installer/WEB-INF/red5-web.xml %D/red5/webapps/installer/WEB-INF/red5-web.xml.sample && rm -f red5/webapps/installer/WEB-INF/red5-web.xml || true 2>/dev/null
+red5/webapps/installer/WEB-INF/red5-web.xml.sample
+@exec [ -f %B/red5-web.xml ] || cp -p %D/%F %B/red5-web.xml
+@unexec cmp -s %D/red5/webapps/installer/WEB-INF/web.xml %D/red5/webapps/installer/WEB-INF/web.xml.sample && rm -f red5/webapps/installer/WEB-INF/web.xml || true 2>/dev/null
+red5/webapps/installer/WEB-INF/web.xml.sample
+@exec [ -f %B/web.xml ] || cp -p %D/%F %B/web.xml
 red5/webapps/installer/history/history.css
 red5/webapps/installer/history/history.js
 red5/webapps/installer/history/historyFrame.html
@@ -95,9 +181,15 @@
 red5/webapps/installer/installer.swf
 red5/webapps/installer/playerProductInstall.swf
 red5/webapps/red5-default.xml
-red5/webapps/root/WEB-INF/red5-web.properties
-red5/webapps/root/WEB-INF/red5-web.xml
-red5/webapps/root/WEB-INF/web.xml
+@unexec cmp -s %D/red5/webapps/root/WEB-INF/red5-web.properties %D/red5/webapps/root/WEB-INF/red5-web.properties.sample && rm -f red5/webapps/root/WEB-INF/red5-web.properties || true 2>/dev/null
+red5/webapps/root/WEB-INF/red5-web.properties.sample
+@exec [ -f %B/red5-web.properties ] || cp -p %D/%F %B/red5-web.properties
+@unexec cmp -s %D/red5/webapps/root/WEB-INF/red5-web.xml %D/red5/webapps/root/WEB-INF/red5-web.xml.sample && rm -f red5/webapps/root/WEB-INF/red5-web.xml || true 2>/dev/null
+red5/webapps/root/WEB-INF/red5-web.xml.sample
+@exec [ -f %B/red5-web.xml ] || cp -p %D/%F %B/red5-web.xml
+@unexec cmp -s %D/red5/webapps/root/WEB-INF/web.xml %D/red5/webapps/root/WEB-INF/web.xml.sample && rm -f red5/webapps/root/WEB-INF/web.xml || true 2>/dev/null
+red5/webapps/root/WEB-INF/web.xml.sample
+@exec [ -f %B/web.xml ] || cp -p %D/%F %B/web.xml
 red5/webapps/root/biglogo.png
 red5/webapps/root/crossdomain.xml
 red5/webapps/root/demos/BallControl.html
@@ -1050,14 +1142,14 @@
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
 @dirrm red5/webapps/root/demos/assets
 @dirrm red5/webapps/root/demos
-@dirrm red5/webapps/root/WEB-INF
-@dirrm red5/webapps/root
+@dirrmtry red5/webapps/root/WEB-INF
+@dirrmtry red5/webapps/root
 @dirrm red5/webapps/installer/history
-@dirrm red5/webapps/installer/WEB-INF
-@dirrm red5/webapps/installer
+@dirrmtry red5/webapps/installer/WEB-INF
+@dirrmtry red5/webapps/installer
 @dirrmtry red5/webapps
 @dirrmtry red5/log
 @dirrm red5/lib
-@dirrm red5/conf/war
-@dirrm red5/conf
+@dirrmtry red5/conf/war
+@dirrmtry red5/conf
 @dirrmtry red5
