-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-om-r2905
372 lines (306 loc) · 15.3 KB
/
install-om-r2905
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
#!/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.us.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 openmeetings@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 -O /tmp/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 /tmp/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 openmeetings@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&useUnicode=true&createDatabaseIfNotExist=true&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