Hi folks!!!

At the last week, I work in a "Automagic" script for Openmeetings to make our lifes easier :-P
This script works only in Debian 5.

How it work?
    He resolve all dependencies and install for OM works;
Install the init scripts to start the services when the system is start up;
    Download, and unzip the OM at defined directory;
    Set the permissions;
    Recompile the ffmpeg to works the video converter
    Uninstaller

The script are avaliable at: http://victor.sartori.eti.br/opemneetings/install-om-r2905

Doubt, suggestions, tips, reviews... mail-me

Victor

--
You received this message because you are subscribed to the Google Groups 
"OpenMeetings User" 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-user?hl=en.

#!/bin/bash

#Install Script for Openmeetings release 2905 
#Original idea: Victor Sartori - [email protected]


#Instructions

# The variables: INSTALL_HOME, REP_DEBIAN, SITE and FILE is required
# Adjust the Debian repository for your country
# The variables SITE and FILE works like this:
#  You need to split the URL, cutting the path to file and the file like the 
example above:
#  the URL: 
http://openmeetings.googlecode.com/files/openmeetings_1_1_r2905.zip, you need 
split the path to file, so the
#variable SITE must contain the value: http://openmeetings.googlecode.com/files 
without the slash at end.
# The variable FILE, will be receive the file will be downloaded like: 
openmeetings_1_1_r2905.zip

# This is a "Automagic" installer

#This script is designated by DEBIAN 5 USERS! therefore UBUNTU USERS, this 
script will not work for you, he needs adaptations.

#How to use?
# You need to set the eXecute permission for this script: chmod +x 
install-om-2905
# and to run: ./install-om-r2905 simple!


#To Do:
# Translate all the script for english
# Make support for others distributions
# Create return codes for all errors, today all erros returns 1



#Questions, suggestions, bugs.... anything, mail-me: [email protected]


# Thats all Folks!!!! enjoy

#--Victor

#--------------------------------------------------------------------------------------------------------------------

INSTALL_HOME=/opt/red5
REP_DEBIAN=http://ftp.br.debian.org/debian/
SITE=http://openmeetings.googlecode.com/files 
FILE=openmeetings_1_1_r2905.zip


menu() {
        clear
        echo "OpenMeetings \"Automagic\" Install-Script - v0.10 - By Victor"
        echo "-----------------------------------------------"
        echo "Choose one option:"
        echo
        echo "1 - Install"
        echo "2 - Remove (only files, init scripts and database openmeetings)"
        echo "3 - Quit"
        echo
        echo -n "Choose your option: "
        read opcao
        case $opcao in
                1) Instalar ;;
                2) Remover ;;
                3) exit;;
                *) "Wrong Option" ; echo ; menu ;; 
        esac
}



Instalar(){
        repositorios
        downloads
        copia_arquivos
        banco_dados
        conexao_mysql
        video
        inicia_servicos
}

Remover(){
        rep_original
        del_arquivos
        del_bancodados

}

rep_original() {
        mv -f /etc/apt/sources.list /etc/apt/sources.list.openmeetings
        mv -f /etc/apt/sources.list.orig /etc/apt/sources.list
        aptitude update
}

del_arquivos() {
        /etc/init.d/red5 stop
        /etc/init.d/openoffice stop
        update-rc.d -f red5 remove
        update-rc.d -f openoffice remove
        rm -rf $INSTALL_HOME
}
del_bancodados(){
        echo -n "Type the MySQL root password: "
        read ROOT_MYSQL

        echo "DROP USER openmeeti...@localhost;" |mysql -u root -p$ROOT_MYSQL
        echo "DROP DATABASE openmeetings;" |mysql -u root -p$ROOT_MYSQL
}

repositorios() {
        if [ -z $REP_DEBIAN ]; then     
                echo "The variable REP_DEBIAN is required!"
                echo "Edit this script and fill value with a valid Debian 
repository."
                echo "The install script will be not completed."
                return 1
                exit
        else
                mv -f /etc/apt/sources.list /etc/apt/sources.list.orig
                echo "#Generated by Openmeetings Installer

                deb $REP_DEBIAN lenny main contrib non-free
                deb http://security.debian.org/ lenny/updates main contrib 
non-free
                deb-src http://security.debian.org/ lenny/updates main contrib 
non-free
                deb http://volatile.debian.org/debian-volatile lenny/volatile 
main contrib non-free
                deb-src http://volatile.debian.org/debian-volatile 
lenny/volatile main contrib non-free
                deb http://ftp.br.debian.org/debian-multimedia/ lenny main
                " > /etc/apt/sources.list
                gpg --keyserver subkeys.pgp.net --recv 07DC563D1F41B907
                gpg --export --armor 07DC563D1F41B907 | apt-key add -   
                aptitude update
        fi
}

downloads() {

        if [[ -z $SITE || -z $FILE ]]; then
                echo "The variables SITE and FILE is required!"
                echo "Edit this script and fill value."
                echo "At SITE variable, put the only the website, like: 
site.com/directory (without slash at end)"
                Echo "At FILE variable, put the file will be downloaded, like: 
file.zip"
                echo "The Install Script will be not completed."
                return 1
                exit
        else
                        
                aptitude install -y sun-java6-jdk mysql-server 
openoffice.org-headless openoffice.org-writer openoffice.org-calc 
openoffice.org-impress openoffice.org-draw openoffice.org-math imagemagick 
gs-gpl libart-2.0-2 libt1-5 libungif4g zip unzip bzip2 subversion git-core 
checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev  
libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore4-dev zlib1g-dev libogg-dev 
sox libvorbis0a libvorbis-dev libgsm1 libgsm1-dev libfaad2-0 flvtool2
                clear
                wget -q http://victor.sartori.eti.br/swftools_0.8.1-2.1_i386.deb
                dpkg -i swftools_0.8.1-2.1_i386.deb
                wget -q http://victor.sartori.eti.br/red5.tar.bz2
                wget $SITE/$FILE
        fi
}

copia_arquivos() {
        if [ -z $INSTALL_HOME ]; then
                echo "The INSTALL_HOME variable, is required, you need to 
define where the OM will be installed. One tip: /opt/red5"
                echo "The Install Script will be not completed."
                return 1
                exit
        else
        
                mkdir -p $INSTALL_HOME
                mkdir $(pwd)/OM
                unzip -q $FILE -d $(pwd)/OM
                cd $(pwd)/OM/
                cd $(ls -d open*)
                cp -a . $INSTALL_HOME
                chown nobody $INSTALL_HOME -R
                chmod +x $INSTALL_HOME/*.sh
                chmod +x $INSTALL_HOME/webapps/openmeetings/jod/*.sh
                rm -rf $(pwd)/OM/
                tar -xjf red5.tar.bz2 -C /etc/init.d
                update-rc.d red5 defaults
                update-rc.d openoffice defaults
        fi
}


banco_dados() {
        clear
        echo -n "Type the password will be used by user openmeetings at mysql: "
        read MYSQL_OM_USER_PASSWORD
        echo 
        echo -n "Type the MySQL root's password: "
        read ROOT_MYSQL
        
        if [[ -z $MYSQL_OM_USER_PASSWORD || -z $ROOT_MYSQL ]]; then
                echo "Blank passwords for MySQL root is required."
                echo "Is not allowed typing a blank password for the user 
openmeetings at MySQL."
                echo "The Install Script will be not completed."
                return 1
                exit
        else
                echo "CREATE USER openmeeti...@localhost;" |mysql -u root 
-p$ROOT_MYSQL
                echo "CREATE DATABASE openmeetings DEFAULT CHARACTER SET 
'utf8';" |mysql -u root -p$ROOT_MYSQL
                echo "GRANT ALL PRIVILEGES ON openmeetings.* TO 
'openmeetings'@'localhost' IDENTIFIED BY '$MYSQL_OM_USER_PASSWORD' WITH GRANT 
OPTION;" |mysql -u root -p$ROOT_MYSQL
                echo "FLUSH PRIVILEGES;" |mysql -u root -p$ROOT_MYSQL
        fi
}



conexao_mysql() {
        
        if [ -f $INSTALL_HOME/webapps/openmeetings/conf/hibernate.cfg.xml ]; 
then
                rm $INSTALL_HOME/webapps/openmeetings/conf/hibernate.cfg.xml
        fi

        echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE hibernate-configuration PUBLIC \"-//Hibernate/Hibernate Configuration 
DTD 3.0//EN\" 
\"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\";>

<!-- Generated file - Do not edit! -->

<hibernate-configuration>

        <!-- a SessionFactory instance listed as /jndi/name -->
        <session-factory>
                
                <!-- User  / Password -->
                <property name=\"connection.username\">openmeetings</property>
                <property name=\"connection.password\">$SENHA_MYSQL</property>
                
                <!-- Database Settings -->
                <property 
name=\"connection.driver_class\">com.mysql.jdbc.Driver</property>
                <!--  for performance reasons changed to MyISAM from 
org.hibernate.dialect.MySQLInnoDBDialect -->
                <property 
name=\"dialect\">org.hibernate.dialect.MySQLMyISAMDialect</property>
                <property 
name=\"connection.url\">jdbc:mysql://localhost/openmeetings?autoReconnect=true&amp;useUnicode=true&amp;createDatabaseIfNotExist=true&amp;characterEncoding=utf-8</property>
   
                
                <property name=\"hibernate.connection.CharSet\">utf8</property>
                <property 
name=\"hibernate.connection.characterEncoding\">utf8</property>
                <property 
name=\"hibernate.connection.useUnicode\">true</property>

                
                <!-- Database Scheme Auto Update -->
                <property name=\"hbm2ddl.auto\">update</property>               
        

                <!-- properties -->
                
                <property name=\"show_sql\">false</property>
                <property name=\"use_outer_join\">false</property>
                <property 
name=\"hibernate.query.factory_class\">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
        <property 
name=\"hibernate.connection.provider_class\">org.hibernate.connection.C3P0ConnectionProvider</property>
        <!--
        <property name=\"connection.provider_class 
\">org.hibernate.connection.C3P0ConnectionProvider</property>
         -->
        <property 
name=\"hibernate.cache.provider_class\">org.hibernate.cache.NoCacheProvider</property>
        <property name=\"hibernate.cache.use_query_cache\">false</property>
        <property 
name=\"hibernate.cache.use_second_level_cache\">false</property>
        <property name=\"hibernate.generate_statistics\">false</property>
        <property 
name=\"hibernate.cache.use_structured_entries\">false</property>


                <property name=\"c3p0.max_size\">20</property>
                <property name=\"c3p0.min_size\">2</property>
        <property name=\"c3p0.idle_test_period\">100</property>
                <property name=\"c3p0.max_statements\">100</property>
                <property name=\"c3p0.timeout\">100</property>

                <!-- mapping files -->
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/adresses/Adresses.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/adresses/States.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Configuration.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/ErrorType.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/ErrorValues.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Naviglobal.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Navimain.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Navisub.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/SOAPLogin.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/basic/Sessiondata.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/calendar/Appointment.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/calendar/AppointmentCategory.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/calendar/AppointmentReminderTyps.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/calendar/MeetingMember.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/domain/Organisation.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/domain/Organisation_Users.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/flvrecord/FlvRecording.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/flvrecord/FlvRecordingLog.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/flvrecord/FlvRecordingMetaData.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/flvrecord/FlvRecordingMetaDelta.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/invitation/Invitations.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/lang/FieldLanguage.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/lang/Fieldlanguagesvalues.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/lang/Fieldvalues.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/logs/ConferenceLog.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/logs/ConferenceLogType.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/ChatvaluesEvent.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/Recording.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RecordingClient.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RecordingConversionJob.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RoomClient.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RoomRecording.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/RoomStream.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/recording/WhiteBoardEvent.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/rooms/RoomModerators.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/rooms/RoomTypes.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/rooms/Rooms.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/rooms/Rooms_Organisation.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Salutations.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/UserSipData.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Userdata.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Usergroups.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Userlevel.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Users.hbm.xml\"/>
    <mapping 
resource=\"org/openmeetings/app/hibernate/beans/user/Users_Usergroups.hbm.xml\"/>
    
        </session-factory>

</hibernate-configuration>" >> 
$INSTALL_HOME/webapps/openmeetings/conf/hibernate.cfg.xml
}


inicia_servicos() {
/etc/init.d/openoffice start
sleep 5
/etc/init.d/red5 start
sleep 2
clear
echo "Done!! open the website at your browser: http://$(ifconfig eth0 |grep 
"inet addr:" |cut -d : -f 2 |cut -f1 -d" "):5080/openmeetings/install"
}

verifica() {
if [ "$(id -u)" -ne "0" ]; then
        echo "You don't have root power!"
        return 1
        exit
else

        if [ -f /etc/debian_version ]; then
                if [ $(cat /etc/debian_version| cut -d . -f 1) == 5 ]; then
                        menu
                else
                        VERSAO=$(cat /etc/debian_version)
                        echo "You are not using Debian Lenny 5"
                        echo "Your version is: "$VERSAO
                        return 1
                        exit
                fi
        else
                echo "You are not using Debian!"
                return 1
                exit
        fi
fi
}

video() {
        cd /usr/local/src
        mkdir ffmpeg
        cd ffmpeg
        git clone git://git.videolan.org/x264.git
        cd x264
        ./configure
        make
        checkinstall --pkgname=x264 --pkgversion "1:0.svn" --backup=no --default

        cd ..
        wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
        tar xzf libtheora-1.1.1.tar.gz
        cd libtheora-1.1.1
        ./configure --disable-shared
        make
        checkinstall --pkgname=libtheora --pkgversion "1.1.1" --backup=no 
--default

        cd ..
        svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
        cd ffmpeg
        ./configure --enable-gpl --enable-version3 --enable-nonfree 
--enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad 
--enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid 
--enable-x11grab
        make
        checkinstall --pkgname=ffmpeg --pkgversion "4:0.5.svn" --backup=no 
--default

}

verifica

Reply via email to