Revision: 4021
Author:   seba.wagner
Date:     Thu Aug  4 12:10:01 2011
Log:      Debian Build Instructions for OpenMeetings + Red5
http://code.google.com/p/openmeetings/source/detail?r=4021

Added:
 /trunk/debian/README
 /trunk/debian/README.Debian
 /trunk/debian/changelog
 /trunk/debian/compat
 /trunk/debian/control
 /trunk/debian/copyright
 /trunk/debian/dirs
 /trunk/debian/docs
 /trunk/debian/postinst
 /trunk/debian/postrm
 /trunk/debian/prerm
 /trunk/debian/red5-daemon.sh
 /trunk/debian/red5-openmeetings-db.debhelper.log
 /trunk/debian/red5-openmeetings-db.substvars
 /trunk/debian/red5-openmeetings-oo-daemon.sh
 /trunk/debian/red5-openmeetings-oo.conf
 /trunk/debian/red5-openmeetings-oo.init
 /trunk/debian/red5-openmeetings.conf
 /trunk/debian/red5-openmeetings.doc-base.EX
 /trunk/debian/red5-openmeetings.init
 /trunk/debian/red5.init
 /trunk/debian/rules
 /trunk/debian/templates

=======================================
--- /dev/null
+++ /trunk/debian/README        Thu Aug  4 12:10:01 2011
@@ -0,0 +1,6 @@
+The Debian Package red5-openmeetings
+----------------------------
+
+Comments regarding the Package
+
+ -- root <[email protected]>  Tue, 20 Oct 2009 12:14:23 +0300
=======================================
--- /dev/null
+++ /trunk/debian/README.Debian Thu Aug  4 12:10:01 2011
@@ -0,0 +1,6 @@
+red5-openmeetings for Debian
+----------------------------
+
+<possible notes regarding this package - if none, delete this file>
+
+ -- root <[email protected]>  Tue, 20 Oct 2009 12:14:23 +0300
=======================================
--- /dev/null
+++ /trunk/debian/changelog     Thu Aug  4 12:10:01 2011
@@ -0,0 +1,25 @@
+red5-openmeetings (1.7) squeeze; urgency=low
+
+  * New Upstream version.
+
+ -- root <[email protected]>  Thu, 04 Aug 2011 14:22:04 +0300
+
+red5-openmeetings (1.6) squeeze; urgency=low
+
+  * New Upstream version.
+  * Added automatic creation of mysql database and user.
+  * New distribution name.
+
+ -- root <[email protected]>  Thu, 06 Jan 2011 12:13:24 +0200
+
+red5-openmeetings (1.5) unstable; urgency=low
+
+  * Update to version 1.5 of openmeetings.
+
+ -- root <[email protected]>  Mon, 18 Oct 2010 11:39:15 +0300
+
+red5-openmeetings (0.9-rc5) unstable; urgency=low
+
+  * Initial Release.
+
+ -- root <[email protected]>  Tue, 20 Oct 2009 12:14:23 +0300
=======================================
--- /dev/null
+++ /trunk/debian/compat        Thu Aug  4 12:10:01 2011
@@ -0,0 +1,1 @@
+7
=======================================
--- /dev/null
+++ /trunk/debian/control       Thu Aug  4 12:10:01 2011
@@ -0,0 +1,25 @@
+Source: red5-openmeetings
+Section: java
+Priority: optional
+Maintainer: johnny strom <[email protected]>
+Build-Depends: debhelper (>= 7),sun-java6-jdk,ant,cdbs
+Standards-Version: 3.7.3
+Homepage: http://code.google.com/p/openmeetings/
+
+Package: red5-openmeetings
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, sun-java6-jre, imagemagick, gs-gpl, libart-2.0-2, libt1-5, libungif4g, swftools (>= 0.9.0), red5-openmeetings-oo, ffmpeg, sox, mysql-server, mysql-client, sed
+Conflicts: red5-server, tomcat6, tomcat5
+Description: OpenMeetings Red5 server package
+ red5-openmeetings is an combined package for Red5 and Openmeetings,
+ together do they work as en webmeeting service.
+ After package is installed, please go to
+ http://127.0.0.1:5080/openmeetings/install and finish the
+ installation process. Please, visit http://code.google.com/p/openmeetings
+ for more information.
+
+Package: red5-openmeetings-oo
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, openoffice.org-headless, openoffice.org-writer, openoffice.org-calc, openoffice.org-impress, openoffice.org-draw
+Description: red5-openmeetings OpenOffice headless demon.
+ This package provides the openoffice headless demon for Openmeetings.
=======================================
--- /dev/null
+++ /trunk/debian/copyright     Thu Aug  4 12:10:01 2011
@@ -0,0 +1,39 @@
+This package was debianized by root <[email protected]> on
+Tue, 20 Oct 2009 12:14:23 +0300.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+    <put author's name and email here>
+    <likewise for another author>
+
+Copyright:
+
+    <Copyright (C) YYYY Name OfAuthor>
+    <likewise for another author>
+
+License:
+
+    This package is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU Lesser General
+Public License can be found in `/usr/share/common-licenses/LGPL'.
+
+The Debian packaging is (C) 2009, root <[email protected]> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
=======================================
--- /dev/null
+++ /trunk/debian/dirs  Thu Aug  4 12:10:01 2011
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
=======================================
--- /dev/null
+++ /trunk/debian/docs  Thu Aug  4 12:10:01 2011
@@ -0,0 +1,1 @@
+license.txt
=======================================
--- /dev/null
+++ /trunk/debian/postinst      Thu Aug  4 12:10:01 2011
@@ -0,0 +1,102 @@
+#! /bin/bash -e
+
+#Source debconf library
+. /usr/share/debconf/confmodule
+
+#check if this is run because of abort
+
+#if [ "$1" != "abort-upgrade" ]&&[ "$1" != "abort-remove" ]&&[ "$1" != "abort-deconfigure" ]; then
+
+if [ "$1" = "configure" ]; then
+
+
+db_input critical red5-openmeetings/mysqladmin || true
+
+db_input critical red5-openmeetings/mysqladminpass || true
+
+db_input critical red5-openmeetings/mysqlsvr || true
+
+db_input critical red5-openmeetings/mysqlusr || true
+
+db_input critical red5-openmeetings/mysqlpwd || true
+
+db_input critical red5-openmeetings/dbname || true
+
+db_input critical red5-openmeetings/userrun || true
+
+db_input critical red5-openmeetings/grouprun || true
+db_go
+
+
+db_get red5-openmeetings/mysqladmin
+MYSQL_ADMIN=$RET
+
+db_get red5-openmeetings/mysqladminpass
+MYSQL_ADMIN_PASS=$RET
+
+db_get red5-openmeetings/mysqlusr
+MYSQL_USER=$RET
+
+db_get red5-openmeetings/mysqlpwd
+MYSQL_PASS=$RET
+
+db_get red5-openmeetings/dbname
+MYSQL_DATABASE=$RET
+
+db_get red5-openmeetings/userrun
+RUN_USER=$RET
+
+db_get red5-openmeetings/grouprun
+RUN_GROUP=$RET
+
+
+MYSQL_RESULT=`mysql -u$MYSQL_ADMIN -p$MYSQL_ADMIN_PASS -e "create database $MYSQL_DATABASE default character set utf8;" 2>/dev/null 1>/dev/null`$?|| true
+
+if [ $MYSQL_RESULT -ne 0 ]; then
+
+ echo "Could not create the database $MYSQL_DATABASE, perhaps the administrator (root) name or password was wrong"
+ echo "Please create the database mannually with the following information"
+ echo "Database = $MYSQL_DATABASE"
+
+fi
+
+MYSQL_RESULT=`mysql -u$MYSQL_ADMIN -p$MYSQL_ADMIN_PASS -e "grant all privileges on $MYSQL_DATABASE.* to '$MYSQL_USER'@'localhost' identified by '$MYSQL_PASS';" 2>/dev/null 1>/dev/null`$?||true
+ if [ $MYSQL_RESULT -ne 0 ]; then
+ echo "Could not create the database user $MYSQL_USER, perhaps the administrator (root) name or password was wrong" + echo "Please create the database user mannually with the following information"
+  echo "Database user= $MYSQL_USER"
+  echo "Database users password = $MYSQL_PASS"
+ fi
+
+
+sed -i 's|RUN_USER=.*$|RUN_USER='$RUN_USER'|' /etc/red5-openmeetings/red5-openmeetings.conf +sed -i 's|RUN_USER=.*$|RUN_USER='$RUN_USER'|' /etc/red5-openmeetings/red5-openmeetings-oo.conf
+
+sed -i 's|RUN_GROUP=.*$|RUN_GROUP='$RUN_GROUP'|' /etc/red5-openmeetings/red5-openmeetings.conf +sed -i 's|RUN_GROUP=.*$|RUN_GROUP='$RUN_GROUP'|' /etc/red5-openmeetings/red5-openmeetings-oo.conf
+chown -R $RUN_USER:$RUN_GROUP /usr/share/red5-openmeetings
+
+sed -i -r 's|jdbc:mysql:\/\/[^\/]*?\/|jdbc:mysql:\/\/'$MYSQL_SERVER'\/|' /usr/share/red5-openmeetings/webapps/openmeetings/conf/hibernate.cfg.xml
+
+sed -i -r 's|:\/\/'$MYSQL_SERVER'\/[^\?]*?\?|:\/\/'$MYSQL_SERVER'\/'$MYSQL_DATABASE'\?|' /usr/share/red5-openmeetings/webapps/openmeetings/conf/hibernate.cfg.xml
+
+sed -i -r 's|connection.username\">[^<]*?<| connection.username\">'$MYSQL_USER'<|' /usr/share/red5-openmeetings/webapps/openmeetings/conf/hibernate.cfg.xml
+
+sed -i -r 's|connection.password\">[^<]*?<| connection.password\">'$MYSQL_PASS'<|' /usr/share/red5-openmeetings/webapps/openmeetings/conf/hibernate.cfg.xml
+
+
+touch /usr/share/red5-openmeetings/postinst.done
+
+update-rc.d red5-openmeetings-oo defaults
+update-rc.d red5-openmeetings defaults
+
+echo "Openmeetings was successfully configured."
+echo "Please start with the command: \"/etc/init.d/red5-openmeetings start\" " +echo "And then go to http://<host_ip>:5080/openmeetings/install to complete the installation process"
+
+else
+
+echo $1
+echo "Reconfiguration is not supported yet. Please reinstall the software."
+
+fi
=======================================
--- /dev/null
+++ /trunk/debian/postrm        Thu Aug  4 12:10:01 2011
@@ -0,0 +1,6 @@
+#!/bin/bash -e
+if [ "$1"="purge" -a -e /usr/share/debconf/confmodule ]; then
+. /usr/share/debconf/confmodule
+db_purge
+fi
+
=======================================
--- /dev/null
+++ /trunk/debian/prerm Thu Aug  4 12:10:01 2011
@@ -0,0 +1,8 @@
+#! /bin/sh
+echo "Removing package red5-openmeetings..."
+
+/etc/init.d/red5-openmeetings-oo stop
+/etc/init.d/red5-openmeetings stop
+
+rm -r /usr/share/red5-openmeetings/postinst.done
+rm -r /usr/share/red5-openmeetings/webapps/openmeetings/upload
=======================================
--- /dev/null
+++ /trunk/debian/red5-daemon.sh        Thu Aug  4 12:10:01 2011
@@ -0,0 +1,22 @@
+#!/bin/sh
+# last modified:22.04.2009 CTpaHHoe
+
+[ -z "$PIDFILE" ] && exit 201
+[ -z "$LOGFILE" ] && exit 202
+[ -z "$RUN_HOME" ] && exit 203
+
+[ -n "$JAVA_HOME" ] && export JAVA_HOME
+[ -n "$JAVA_OPTS" ] && export JAVA_OPTS
+[ -n "$RED5_HOME" ]  && export RED5_HOME
+
+touch "$PIDFILE" || exit 204
+# "$RUN_HOME/red5.sh" 2>&1 1>"$LOGFILE" >&2 &
+
+cd $RED5_HOME
+"$RUN_HOME/red5.sh" >>"$LOGFILE" 2>&1  &
+
+RETVAL=$?
+echo $! 2>/dev/null 1>"$PIDFILE"
+
+exit $RETVAL
+
=======================================
--- /dev/null
+++ /trunk/debian/red5-openmeetings-db.debhelper.log Thu Aug 4 12:10:01 2011
@@ -0,0 +1,50 @@
+dh_prep
+dh_installdirs
+dh_installdirs
+dh_installdirs
+dh_installdirs
+dh_installdirs
+dh_installdirs
+dh_installdirs
+dh_installdirs
+dh_install
+dh_install
+dh_install
+dh_install
+dh_install
+dh_install
+dh_install
+dh_install
+dh_install
+dh_install
+dh_install
+dh_install
+dh_installdocs
+dh_installexamples
+dh_installman
+dh_installinfo
+dh_installmenu
+dh_installcron
+dh_installinit
+dh_installdebconf
+dh_installemacsen
+dh_installcatalogs
+dh_installpam
+dh_installlogrotate
+dh_installlogcheck
+dh_installchangelogs
+dh_installudev
+dh_lintian
+dh_install
+dh_link
+dh_installmime
+dh_strip
+dh_compress
+dh_fixperms
+dh_makeshlibs
+dh_installdeb
+dh_perl
+dh_shlibdeps
+dh_gencontrol
+dh_md5sums
+dh_builddeb
=======================================
--- /dev/null
+++ /trunk/debian/red5-openmeetings-db.substvars        Thu Aug  4 12:10:01 2011
@@ -0,0 +1,1 @@
+misc:Depends=
=======================================
--- /dev/null
+++ /trunk/debian/red5-openmeetings-oo-daemon.sh        Thu Aug  4 12:10:01 2011
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# last modified:22.04.2009 CTpaHHoe
+
+[ -z "$PIDFILE" ] && exit 201
+[ -z "$LOGFILE" ] && exit 202
+[ -z "$SOFFICE" ] && exit 203
+[ -z "$SOFFICE_ARGS" ] && exit 204
+
+touch "$PIDFILE" || exit 205
+
+# echo $SOFFICE $SOFFICE_ARGS
+$SOFFICE $SOFFICE_ARGS  >>"$LOGFILE" 2>&1  &
+
+RETVAL=$?
+echo $! 2>/dev/null 1>"$PIDFILE"
+
+exit $RETVAL
+
=======================================
--- /dev/null
+++ /trunk/debian/red5-openmeetings-oo.conf     Thu Aug  4 12:10:01 2011
@@ -0,0 +1,7 @@
+# vim:ft=sh:nowrap
+RUN_HOME=/usr/share/red5-openmeetings
+RUN_USER=root
+RUN_GROUP=root
+
+# SOFFICE_PORT=8100
+# SOFFICE_ARGS="-nologo -headless -nofirststartwizard -accept=socket,host=localhost,port=$SOFFICE_PORT;urp;StarOffice.ServiceManager"
=======================================
--- /dev/null
+++ /trunk/debian/red5-openmeetings-oo.init     Thu Aug  4 12:10:01 2011
@@ -0,0 +1,189 @@
+#!/bin/sh
+
+# For RedHat and similar:
+# chkconfig: 2345 85 85
+# description: open office server daemon
+# processname: soffice
+# last modified:16.03.2010 Rodion Volkov
+
+### BEGIN INIT INFO
+# Provides: openoffice
+# Required-Start: $local_fs $remote_fs $network
+# Required-Stop: $local_fs $remote_fs $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start/stop openoffice server daemon for Openmeetings
+### END INIT INFO
+
+NAMECONFIG=red5-openmeetings-oo.conf
+NAME=red5-openmeetings-oo
+
+# default configuration
+RUN_HOME=/usr/share/red5-openmeetings
+RUN_USER=root
+RUN_GROUP=root
+
+
+# source datum
+
+# red hat specific
+[ -r /etc/sysconfig/$NAMECONFIG ] && . /etc/sysconfig/$NAMECONFIG
+# debian specific
+[ -r /etc/red5-openmeetings/$NAMECONFIG ] && . /etc/red5-openmeetings/$NAMECONFIG
+
+# local variables
+DAEMON=$RUN_HOME/$NAME-daemon.sh
+PIDFILE=/var/run/$NAME.pid
+LOGFILE=/var/log/$NAME.log
+
+[ -z "$SOFFICE_PORT" ] && SOFFICE_PORT=8100
+[ -z "$SOFFICE_ARGS" ] && SOFFICE_ARGS="-nologo -headless -nofirststartwizard -accept=socket,host=localhost,port=$SOFFICE_PORT;urp;StarOffice.ServiceManager"
+
+# check OpenOffice
+[ -z "$SOFFICE" ] &&  SOFFICE=`which soffice`
+if [ ! -x "$SOFFICE" ]; then
+  echo $"Open Office Org not found. Check Open Office Org installed"
+  exit 1
+fi
+
+# export variables for daemon script
+export PIDFILE
+export LOGFILE
+export SOFFICE
+export SOFFICE_ARGS
+##
+
+EXIT_CODE=0
+
+
+check_files() {
+  if [ ! -w $PIDFILE ]; then
+    touch "$PIDFILE"
+    chown "$RUN_USER" "$PIDFILE"
+  fi
+
+  if [ ! -w $LOGFILE ]; then
+    touch "$LOGFILE"
+    chown "$RUN_USER" "$LOGFILE"
+  fi
+}
+
+do_start() {
+  echo -n $"Starting $NAME: "
+  pid=`cat "$PIDFILE" 2>/dev/null`
+  if [  -f "$PIDFILE" -a -n "$pid" ]; then
+    if kill -0 $pid 2>/dev/null ; then
+      echo $"already running"
+      return 0
+    fi
+  fi
+
+  check_files
+
+  su -c "$DAEMON" "$RUN_USER"
+  EXIT_CODE=$?
+
+  if [ $EXIT_CODE -eq 0 ] ; then
+    touch "/var/lock/subsys/$NAME" 2>/dev/null
+    echo " SUCCESS"
+  fi
+
+  return $EXIT_CODE
+}
+
+do_stop() {
+  echo -n "Shutting down $NAME: "
+
+  pid=`cat "$PIDFILE" 2>/dev/null` || true
+  if [ ! -f $PIDFILE -o -z "$pid" ]; then
+    echo $"not running (there is no $PIDFILE)"
+    return 0
+  fi
+
+  if ! kill -TERM $pid 2>/dev/null; then
+    # TERM failed. wait and kill
+
+    c=0
+    while kill -0 $pid 2>/dev/null
+    do
+      cnt=`expr $cnt + 1`
+      if [ $cnt -gt 30 ]; then
+        break
+      fi
+      sleep 1
+      echo -n "."
+    done
+
+    # kill daemon
+    if ! kill -KILL $pid 2>/dev/null ; then
+      # not killed? check reason
+      if kill -0 $pid 2>/dev/null ; then
+        echo "FAILED: $pid is not $DAEMON or not running as $RUN_USER"
+      else
+ echo "FAILED: $DAEMON died, process $pid not running or access denied"
+      fi
+    fi
+  fi
+
+  # delete pidfile
+  rm -r "$PIDFILE" 2>/dev/null
+  # delete lockfile
+  rm -r "/var/lock/subsys/$NAME" 2>/dev/nul
+
+  echo $"SUCCESS"
+  return 0
+}
+
+do_status() {
+  pid=`cat "$PIDFILE" 2>/dev/null`
+  if [ ! -f $PIDFILE  -o -z "$pid" ]; then
+    echo "$NAME is stopped"
+    return 3
+  fi
+
+  if kill -0 $pid 2>/dev/null ; then
+    echo "$NAME is running"
+    return 0
+  fi
+
+  if [ -f $PIDFILE ]; then
+    echo "$NAME is dead but pidfile exists"
+    return 1
+  fi
+
+  if [-f /var/lock/subsys/$NAME ]; then
+    echo "$NAME is dead but subsys locked"
+    return 2
+  fi
+
+  echo "$NAME is stopped"
+  return 3
+}
+
+case "$1" in
+    start)
+        do_start
+    ;;
+
+    stop)
+        do_stop
+    ;;
+
+    restart)
+        do_stop
+        do_start
+    ;;
+
+    status)
+       do_status
+       EXIT_CODE=$?
+    ;;
+
+    *)
+        echo "Usage: <servicename> {start|stop|status|restart}"
+        exit 1
+    ;;
+esac
+
+exit $EXIT_CODE
+
=======================================
--- /dev/null
+++ /trunk/debian/red5-openmeetings.conf        Thu Aug  4 12:10:01 2011
@@ -0,0 +1,5 @@
+#vim: set ft=sh:nowrap
+
+RUN_HOME=/usr/share/red5-openmeetings
+RUN_USER=root
+RUN_GROUP=root
=======================================
--- /dev/null
+++ /trunk/debian/red5-openmeetings.doc-base.EX Thu Aug  4 12:10:01 2011
@@ -0,0 +1,22 @@
+Document: red5-openmeetings
+Title: Debian red5-openmeetings Manual
+Author: <insert document author here>
+Abstract: This manual describes what red5-openmeetings is
+ and how it can be used to
+ manage online manuals on Debian systems.
+Section: unknown
+
+Format: debiandoc-sgml
+Files: /usr/share/doc/red5-openmeetings/red5-openmeetings.sgml.gz
+
+Format: postscript
+Files: /usr/share/doc/red5-openmeetings/red5-openmeetings.ps.gz
+
+Format: text
+Files: /usr/share/doc/red5-openmeetings/red5-openmeetings.text.gz
+
+Format: HTML
+Index: /usr/share/doc/red5-openmeetings/html/index.html
+Files: /usr/share/doc/red5-openmeetings/html/*.html
+
+
=======================================
--- /dev/null
+++ /trunk/debian/red5-openmeetings.init        Thu Aug  4 12:10:01 2011
@@ -0,0 +1,194 @@
+#!/bin/sh
+
+# For RedHat and similar:
+# chkconfig: 2345 85 85
+# description: red5-openmeetings java server daemon
+# processname: red5-openmeetings
+# last modified:22.04.2009 CTpaHHoe
+
+### BEGIN INIT INFO
+# Provides: red5-openmeetings
+# Required-Start: $local_fs $remote_fs $network
+# Required-Stop: $local_fs $remote_fs $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start/stop OpenMeetings java server daemon
+### END INIT INFO
+
+NAMECONFIG=red5-openmeetings.conf
+NAME=red5-openmeetings
+
+# default configuration
+RUN_HOME=/usr/share/red5-openmeetings
+RUN_USER=root
+RUN_GROUP=root
+LOGFILE=/var/log/$NAME.log
+
+
+# source datum
+
+# red hat specific
+[ -r /etc/sysconfig/$NAMECONFIG ] && . /etc/sysconfig/$NAMECONFIG
+# debian specific
+[ -r /etc/red5-openmeetings/$NAMECONFIG ] && . /etc/red5-openmeetings/$NAMECONFIG
+
+# local variables
+PIDFILE=/var/run/$NAME.pid
+DAEMON=$RUN_HOME/red5-daemon.sh
+SHUTDOWN=$RUN_HOME/red5-shutdown.sh
+POSTINSTDONE=$RUN_HOME/postinst.done
+
+# export variables for daemon script
+export PIDFILE
+export LOGFILE
+[ -n "$RUN_HOME" ] && export RUN_HOME
+
+[ -n "$RED5_HOME" ] || RED5_HOME=$RUN_HOME
+export RED5_HOME
+
+
+[ -n "$JAVA_HOME" ] && export JAVA_HOME
+[ -n "$JAVA_OPTS" ] && export JAVA_OPTS
+##
+
+EXIT_CODE=0
+
+
+check_files() {
+  if [ ! -w $PIDFILE ]; then
+    touch "$PIDFILE"
+    chown "$RUN_USER" "$PIDFILE"
+  fi
+
+  if [ ! -w $LOGFILE ]; then
+    touch "$LOGFILE"
+    chown "$RUN_USER" "$LOGFILE"
+  fi
+}
+
+do_start() {
+  echo -n $"Starting $NAME: "
+  pid=`cat "$PIDFILE" 2>/dev/null`
+  if [  -f "$PIDFILE" -a -n "$pid" ]; then
+    if kill -0 $pid 2>/dev/null ; then
+      echo $"already running"
+      return 0
+    fi
+  fi
+
+  check_files
+
+  su -c "$DAEMON" "$RUN_USER"
+  EXIT_CODE=$?
+
+  if [ ! -e $POSTINSTDONE ]; then
+    echo "Post install script not run; Please run "$RUN_HOME"/postinst.sh"
+    EXIT_CODE=221
+  fi
+
+  if [ $EXIT_CODE -eq 0 ] ; then
+    touch "/var/lock/subsys/$NAME"
+    echo " SUCCESS"
+  fi
+
+  return $EXIT_CODE
+}
+
+do_stop() {
+  echo -n "Shutting down $NAME: "
+
+  pid=`cat "$PIDFILE" 2>/dev/null` || true
+  if [ ! -f $PIDFILE -o -z "$pid" ]; then
+    echo $"not running (there is no $PIDFILE)"
+    return 0
+  fi
+
+  # su -c "$SHUTDOWN" "$RUN_USER" 2>/dev/null
+
+  if ! kill -TERM $pid 2>/dev/null ; then
+    # TERM failed. wait and kill
+
+    c=0
+    while kill -0 $pid 2>/dev/null
+    do
+      cnt=`expr $cnt + 1`
+      if [ $cnt -gt 30 ]; then
+        break
+      fi
+      sleep 1
+      echo -n "."
+    done
+
+    # kill daemon
+    if ! kill -KILL $pid 2>/dev/null ; then
+      # not killed? check reason
+      if kill -0 $pid 2>/dev/null ; then
+        echo "FAILED: $pid is not $DAEMON or not running as $RUN_USER"
+      else
+ echo "FAILED: $DAEMON died, process $pid not running or access denied"
+      fi
+    fi
+  fi
+
+  # delete pidfile
+  rm -r "$PIDFILE" 2>/dev/null
+  # delete lockfile
+  rm -r "/var/lock/subsys/$NAME" 2>/dev/nul
+
+  echo $"SUCCESS"
+  return 0
+}
+
+do_status() {
+  pid=`cat "$PIDFILE" 2>/dev/null`
+  if [ ! -f $PIDFILE  -o -z "$pid" ]; then
+    echo "$NAME is stopped"
+    return 3
+  fi
+
+  if kill -0 $pid 2>/dev/null ; then
+    echo "$NAME is running"
+    return 0
+  fi
+
+  if [ -f $PIDFILE ]; then
+    echo "$NAME is dead but pidfile exists"
+    return 1
+  fi
+
+  if [-f /var/lock/subsys/$NAME ]; then
+    echo "$NAME is dead but subsys locked"
+    return 2
+  fi
+
+  echo "$NAME is stopped"
+  return 3
+}
+
+case "$1" in
+    start)
+        do_start
+    ;;
+
+    stop)
+        do_stop
+    ;;
+
+    restart)
+        do_stop
+        do_start
+    ;;
+
+    status)
+       do_status
+       EXIT_CODE=$?
+    ;;
+
+    *)
+        echo "Usage: <servicename> {start|stop|status|restart}"
+        exit 1
+    ;;
+esac
+
+exit $EXIT_CODE
+
=======================================
--- /dev/null
+++ /trunk/debian/red5.init     Thu Aug  4 12:10:01 2011
@@ -0,0 +1,68 @@
+#! /bin/sh
+#
+# red5 red5 initscript
+#
+# Author: Simon Eisenmann .
+#
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DESC="Red5 flash streaming server"
+NAME=red5
+RED5_HOME=/usr/lib/red5
+DAEMON=$RED5_HOME/$NAME.sh
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Gracefully exit if the package has been removed.
+test -x $DAEMON || exit 0
+
+# Read config file if it is present.
+if [ -r /etc/default/$NAME ]
+then
+. /etc/default/$NAME
+fi
+
+#
+# Function that starts the daemon/service.
+#
+d_start() {
+start-stop-daemon --start -c nobody --pidfile $PIDFILE \
+--chdir $RED5_HOME --background --make-pidfile \
+--exec $DAEMON
+}
+
+#
+# Function that stops the daemon/service.
+#
+d_stop() {
+start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+--name java
+rm -f $PIDFILE
+}
+
+case "$1" in
+start)
+echo -n "Starting $DESC: $NAME"
+d_start
+echo "."
+;;
+stop)
+echo -n "Stopping $DESC: $NAME"
+d_stop
+echo "."
+;;
+restart|force-reload)
+echo -n "Restarting $DESC: $NAME"
+d_stop
+sleep 1
+d_start
+echo "."
+;;
+*)
+echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+exit 1
+;;
+esac
+exit 0
=======================================
--- /dev/null
+++ /trunk/debian/rules Thu Aug  4 12:10:01 2011
@@ -0,0 +1,40 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/ant.mk
+
+JAVA_HOME            := /usr/lib/jvm/java-6-sun
+
+# Build classpath is set via ant.properties
+# Here is classpath for ant plugins :
+DEB_JARS             :=
+ANT_ARGS             := -f build.xml dist
+
+DEB_ANT_BUILD_TARGET :=
+#DEB_ANT_CHECK_TARGET := run-tests
+DEB_ANT_CLEAN_TARGET := clean
+
+binary-install/red5-openmeetings::
+
+       dh_installdirs usr/share/red5-openmeetings/
+       dh_installdirs usr/share/red5-openmeetings/webapps/
+       dh_installdirs usr/share/red5-openmeetings/conf/
+       dh_installdirs usr/share/red5-openmeetings/lib/
+       dh_installdirs usr/share/red5-openmeetings/log/
+       dh_installdirs usr/share/red5-openmeetings/log/work/
+
+       dh_install dist/red5/boot.jar usr/share/red5-openmeetings/
+       dh_install dist/red5/webapps/* usr/share/red5-openmeetings/webapps/
+       dh_install dist/red5/conf/* usr/share/red5-openmeetings/conf/
+       dh_install dist/red5/lib/* usr/share/red5-openmeetings/lib/
+       dh_install dist/red5/work/* usr/share/red5-openmeetings/work/
+       dh_install dist/red5/.classpath usr/share/red5-openmeetings/
+       dh_install dist/red5/red5-debug.sh usr/share/red5-openmeetings/
+       dh_install dist/red5/red5-highperf.sh usr/share/red5-openmeetings/
+       dh_install dist/red5/red5.jar usr/share/red5-openmeetings/
+       dh_install dist/red5/red5.sh usr/share/red5-openmeetings/
+       dh_install dist/red5/red5-shutdown.sh usr/share/red5-openmeetings/
+       dh_install debian/red5-daemon.sh usr/share/red5-openmeetings/
+ dh_install -pred5-openmeetings-oo debian/red5-openmeetings-oo-daemon.sh usr/share/red5-openmeetings/
+       dh_install debian/red5-openmeetings.conf etc/red5-openmeetings/
+ dh_install -pred5-openmeetings-oo debian/red5-openmeetings-oo.conf etc/red5-openmeetings/
=======================================
--- /dev/null
+++ /trunk/debian/templates     Thu Aug  4 12:10:01 2011
@@ -0,0 +1,42 @@
+Template: red5-openmeetings/mysqladmin
+Type: string
+Default: root
+Description: MySql administrator user.
+  Please enter the mysql administrator (root).
+
+Template: red5-openmeetings/mysqladminpass
+Type: password
+Default:
+Description: MySql administrator user's password
+  Please enter the mysql administrator (root) user's password.
+
+Template: red5-openmeetings/mysqlusr
+Type: string
+Default: openmeetings
+Description: MySql user you wish to use
+  Please enter the mysql user name to be used with OpenMeetings.
+
+Template: red5-openmeetings/mysqlpwd
+Type: password
+Default:
+Description: MySql user's password
+  Please enter the mysql user's password to be used with OpenMeetings.
+
+Template: red5-openmeetings/dbname
+Type: string
+Default: openmeetings
+Description: Database name
+  Please enter the database name to be used with OpenMeetings.
+
+Template: red5-openmeetings/userrun
+Type: string
+Default: root
+Description: User name for OpenMeetings daemon
+  Please enter the user name to run OpenMeetings under.
+
+Template: red5-openmeetings/grouprun
+Type: string
+Default: root
+Description: Openmeetings group name
+  Please enter the group name for the OpenMeetings daemon.
+

--
You received this message because you are subscribed to the Google Groups 
"OpenMeetings developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/openmeetings-dev?hl=en.

Reply via email to