# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # red5-bbb # red5-bbb/files # red5-bbb/files/red5.in # red5-bbb/files/pkg-install.in # red5-bbb/files/patch-conf-red5-core.xml # red5-bbb/Makefile # red5-bbb/distinfo # red5-bbb/pkg-descr # red5-bbb/pkg-plist # echo c - red5-bbb mkdir -p red5-bbb > /dev/null 2>&1 echo c - red5-bbb/files mkdir -p red5-bbb/files > /dev/null 2>&1 echo x - red5-bbb/files/red5.in sed 's/^X//' >red5-bbb/files/red5.in << '84bbee15494fe40ddda9f6d946fac293' X#!/bin/sh X# X# $FreeBSD$ X# X X# PROVIDE: red5 X# REQUIRE: NETWORKING SERVERS X# BEFORE: DAEMON X# KEYWORD: shutdown X X# X# Configuration settings for red5 X# X# Add the following lines to /etc/rc.conf.local or /etc/rc.conf X# to enable this service: X# X# red5_enable (bool): X# Set to "NO" by default. X# Set it to "YES" to enable red5. X# X# red5_user (str): X# Set to "%%RED5USER%%" by default. X# Set the user for the Red5 process. X# X# red5_group (str): X# Set to "%%RED5GROUP%%" by default. X# Set the group for the Red5 process. X# X# red5_home (str): X# Set to "%%RED5HOME%%" by default. X# Set the RED5_HOME variable for the Red5 process. X# X# red5_log_dir (str): X# Set to "%%RED5LOGDIR%%" by default. X# Set the location for the Red5 log dir. X# X# red5_stop_timeout (num): X# Set to "10" by default. X# Sets the timeout in seconds to allow Red5 to shutdown. X# After the timeout has elapsed, Red5 will be killed. X# X# red5_start_opts (str): X# See below for default value. X# Set Java VM args for start red5. X# X# red5_stop_opts (str): X# See below for default value. X# Set Java VM args for stop red5. X# X# red5_start_class_opts (str): X# See below for default value. X# Set start class arguments. X# X# red5_stop_class_opts (str): X# Set to "" by default. X# Set stop class arguments for clean Red5 process shutdown. X# Format: "rmi_port user password" - must match with: X# rmi_port: ${red5_home}/conf/red5.properties X# user: ${red5_home}/conf/access.properties X# password: ${red5_home}/conf/password.properties X# For example: "9999 red5user changeme" X# X X. /etc/rc.subr X Xname="red5" Xrcvar=`set_rcvar` Xpidfile="/var/run/${name}.pid" X Xload_rc_config $name X X: ${red5_enable:="NO"} X: ${red5_user:="%%RED5USER%%"} X: ${red5_group:="%%RED5GROUP%%"} X: ${red5_home:="%%RED5HOME%%"} X: ${red5_log_dir:="%%RED5LOGDIR%%"} X: ${red5_stop_timeout:="10"} X: ${red5_start_opts:="-Xrs -Xms512M -Xmx1024M -Xss128K -XX:NewSize=256m -XX:SurvivorRatio=16 -XX:MinHeapFreeRatio=20 -XX:+ExplicitGCInvokesConcurrent -XX:+UseConcMarkSweepGC -Dsun.rmi.dgc.client.gcInterval=990000 -Dsun.rmi.dgc.server.gcInterval=990000 -Djava.net.preferIPv4Stack=true -Xverify:none"} X: ${red5_stop_opts:="-Djavax.net.ssl.keyStore=${red5_home}/conf/keystore.jmx -Djavax.net.ssl.keyStorePassword=password"} X: ${red5_start_class_opts:=""} X: ${red5_stop_class_opts:=""} X Xred5_chdir="${red5_home}" Xjava_command="%%LOCALBASE%%/bin/java" Xred5_start_class="org.red5.server.Bootstrap" Xred5_stop_class="org.red5.server.Shutdown" X Xred5_opts="-Dpython.home=lib \ X -Dred5.root=${red5_home} \ X -Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector \ X -Dcatalina.useNaming=true \ X -Djava.security.debug=failure \ X -cp ${red5_home}/boot.jar:${red5_home}/conf" X Xred5_stdout_log="${red5_log_dir}/stdout.log" Xred5_stderr_log="${red5_log_dir}/stderr.log" Xlog_args=">>${red5_stdout_log} 2>>${red5_stderr_log}" X Xrequired_files="${red5_home}/conf/red5.xml" X Xcommand="/usr/sbin/daemon" Xcommand_args="-p ${pidfile} ${java_command} ${red5_start_opts} ${red5_opts} \ X ${red5_start_class} ${red5_start_class_opts} ${log_args}" X Xstart_precmd="red5_precmd" Xstatus_cmd="red5_status" Xstop_cmd="red5_stop" Xpoll_cmd="red5_poll" X Xred5_precmd() { X export RED5_HOME=${red5_home} X mkdir -p ${red5_log_dir} X chown ${red5_user}:${red5_group} ${red5_log_dir} X touch ${pidfile} ${red5_stdout_log} ${red5_stderr_log} X chown ${red5_user}:${red5_group} ${pidfile} \ X ${red5_stdout_log} ${red5_stderr_log} X rm -f ${red5_home}/log X ln -s ${red5_log_dir} ${red5_home}/log X} X Xred5_stop() { X rc_pid=$(red5_check_pidfile $pidfile) X X if [ -z "$rc_pid" ]; then X [ -n "$rc_fast" ] && return 0 X echo "${name} not running? (check $pidfile)." X return 1 X fi X X echo "Stopping ${name}." X if [ -n "${red5_stop_class_opts}" ]; then X su -m ${red5_user} -c "sh -c '${java_command} ${red5_stop_opts} \ X ${red5_opts} ${red5_stop_class} ${red5_stop_class_opts} \ X ${log_args}'" X fi X red5_wait_max_for_pid ${red5_stop_timeout} ${rc_pid} X kill -KILL ${rc_pid} 2>/dev/null && echo "Killed." X rm -f ${pidfile} ${red5_home}/log X} X Xred5_status() { X rc_pid=$(red5_check_pidfile $pidfile) X X if [ -z "$rc_pid" ]; then X [ -n "$rc_fast" ] && return 0 X echo "${name} not running? (check $pidfile)." X return 1 X fi X echo "${name} is running as pid ${rc_pid}." X} X Xred5_poll() { X _prefix= X while (true) ; do X rc_pid=$(red5_check_pidfile $pidfile) X [ -z "$rc_pid" ] && break X echo -n ${_prefix:-"Waiting for PIDS: "}$rc_pid X _prefix=", " X sleep 2 X done X if [ -n "$_prefix" ]; then X echo "." X fi X} X Xred5_check_pidfile() { X _pidfile=$1 X if [ -z "$_pidfile" ]; then X err 3 'USAGE: red5_check_pidfile pidfile' X fi X if [ ! -f $_pidfile ]; then X debug "pid file ($_pidfile): not readable." X return X fi X read _pid _junk < $_pidfile X if [ -z "$_pid" ]; then X debug "pid file ($_pidfile): no pid in file." X return X fi X if [ -n "`%%LOCALBASE%%/bin/jps -l | grep -e "^$_pid ${red5_start_class}\$"`" ]; then X echo -n $_pid X fi X} X Xred5_wait_max_for_pid() { X _timeout=$1 X shift X _pid=$1 X _prefix= X while [ $_timeout -gt 0 ] ; do X echo -n ${_prefix:-"Waiting (max $_timeout secs) for PIDS: "}$_pid X _prefix=", " X sleep 2 X kill -0 $_pid 2>/dev/null || break X _timeout=$(($_timeout-2)) X done X if [ -n "$_prefix" ]; then X echo "." X fi X} X Xrun_rc_command "$1" 84bbee15494fe40ddda9f6d946fac293 echo x - red5-bbb/files/pkg-install.in sed 's/^X//' >red5-bbb/files/pkg-install.in << '3e2c68e4b6ee96751f9e6e3eba58d87f' X#!/bin/sh X# $FreeBSD$ X# X Xif [ "$2" != "PRE-INSTALL" ]; then X exit 0 Xfi X XRED5USER=%%RED5USER%% XRED5GROUP=%%RED5GROUP%% XRED5UID=931 XRED5GID=${RED5UID} X Xif ! pw groupshow "${RED5GROUP}" 2>/dev/null 1>&2; then X if pw groupadd ${RED5GROUP} -g ${RED5GID}; then X echo "Added group \"${RED5GROUP}\"." X else X echo "Adding group \"${RED5GROUP}\" failed..." X exit 1 X fi Xfi X Xif ! pw usershow "${RED5USER}" 2>/dev/null 1>&2; then X if pw useradd ${RED5USER} -u ${RED5UID} -g ${RED5GROUP} -h - \ X -s "/sbin/nologin" -d "/nonexistent" \ X -c "Red5 Daemon"; \ X then X echo "Added user \"${RED5USER}\"." X else X echo "Adding user \"${RED5USER}\" failed..." X exit 1 X fi Xfi X Xexit 0 3e2c68e4b6ee96751f9e6e3eba58d87f echo x - red5-bbb/files/patch-conf-red5-core.xml sed 's/^X//' >red5-bbb/files/patch-conf-red5-core.xml << '2c81eaa81b01f544a1e5263dde770ec8' X--- ./conf/red5-core.xml.orig 2010-11-20 21:58:36.000000000 +0000 X+++ ./conf/red5-core.xml 2010-11-20 21:58:36.000000000 +0000 X@@ -115,7 +115,6 @@ X X X X- X X X 2c81eaa81b01f544a1e5263dde770ec8 echo x - red5-bbb/Makefile sed 's/^X//' >red5-bbb/Makefile << 'be0b4c8d224b4ed8a2207784b7670e73' X# New ports collection makefile for: devel/red5 X# Date created: 14 March 2008 X# Whom: wenheping@gmail.com X# X# $FreeBSD: ports/www/red5/Makefile,v 1.4 2010/02/01 12:52:52 wen Exp $ X# X XPORTNAME= red5 XPORTVERSION= 0.9.1 XCATEGORIES= www java XMASTER_SITES= http://www.red5.org/downloads/0_9/ X XMAINTAINER= alex.deiter@gmail.com XCOMMENT= Red5 is an Open Source flash server X XUSE_DOS2UNIX= yes XDOS2UNIX_REGEX= .+\.(globals|properties|txt|xml)$ X XUSE_JAVA= yes XJAVA_VERSION= 1.6 XNO_BUILD= yes XUSE_RC_SUBR= ${PORTNAME} XSUB_FILES= pkg-install XRED5HOME?= ${PREFIX}/lib/${PORTNAME} XRED5USER?= red5 XRED5GROUP?= red5 XRED5LOGDIR?= /var/log/red5 XPWGEN= openssl rand -base64 16 | sed -E 's|[^A-Za-z0-9]||g' XSUB_LIST= RED5HOME=${RED5HOME} \ X RED5USER=${RED5USER} \ X RED5GROUP=${RED5GROUP} \ X RED5LOGDIR=${RED5LOGDIR} Xpost-extract: X @PASSWD=`${PWGEN}` && ${SED} -i '' "s#changeme#$$PASSWD#" \ X ${WRKSRC}/conf/password.properties X @PASSWD=`${PWGEN}` && ${SED} -i '' "s#admin,#$$PASSWD,#" \ X ${WRKSRC}/conf/realm.properties X Xpre-install: X @${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL X Xdo-install: X @${MKDIR} ${RED5HOME} X @cd ${WRKSRC} && ${COPYTREE_SHARE} "boot.jar red5.jar conf lib webapps" ${RED5HOME} X @${INSTALL} -d -g ${RED5GROUP} -o ${RED5USER} ${RED5HOME}/work X @${CHOWN} -R ${RED5USER}:${RED5GROUP} ${RED5HOME}/conf ${RED5HOME}/webapps X @${FIND} -s -d ${RED5HOME} -type f | ${SED} "s#${PREFIX}/##g" >>${TMPPLIST} X @${FIND} -s -d ${RED5HOME} -type d | ${SED} "s#${PREFIX}/#@dirrm #g" >>${TMPPLIST} X X.include be0b4c8d224b4ed8a2207784b7670e73 echo x - red5-bbb/distinfo sed 's/^X//' >red5-bbb/distinfo << '3c9a0f0d3a9bfe927ddb54b731125934' XMD5 (red5-0.9.1.tar.gz) = a2eb54ce2a86584c5274db9d0a515475 XSHA256 (red5-0.9.1.tar.gz) = 71290b8b22db8c267752be432126a89e4105809d16c9bfc84d6d1e7f52438efd XSIZE (red5-0.9.1.tar.gz) = 35466436 3c9a0f0d3a9bfe927ddb54b731125934 echo x - red5-bbb/pkg-descr sed 's/^X//' >red5-bbb/pkg-descr << '421731685ca4d23417a005920463531d' XRed5 is an Open Source Flash Server written Xin Java that supports streaming Audio/Video X(FLV, MP3, F4V, MP4, AAC and M4A), Recording XClient Streams, Shared Objects, Live Stream XPublishing, Remoting, etc. X XWWW: http://www.red5.org/ 421731685ca4d23417a005920463531d echo x - red5-bbb/pkg-plist sed 's/^X//' >red5-bbb/pkg-plist << '0242e2df38e84f67fdc9156166f9edea' X@stopdaemon red5 0242e2df38e84f67fdc9156166f9edea exit