rhoconnect 3.0.0.beta3 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/CHANGELOG +7 -4
  2. data/Gemfile.lock +1 -1
  3. data/Rakefile +40 -44
  4. data/doc/client.txt +16 -0
  5. data/doc/install.txt +2 -2
  6. data/examples/simple/dump.rdb +0 -0
  7. data/install.sh +49 -57
  8. data/installer/unix-like/post_install.sh +4 -0
  9. data/installer/unix-like/post_uninstall.sh +9 -0
  10. data/installer/unix-like/pre_install.sh +9 -0
  11. data/installer/unix-like/pre_uninstall.sh +23 -0
  12. data/installer/unix-like/rho_connect_install_checkers.rb +1 -4
  13. data/installer/unix-like/rho_connect_install_constants.rb +1 -1
  14. data/installer/unix-like/rho_connect_install_debian.rb +2 -2
  15. data/installer/unix-like/rho_connect_install_dnd.rb +7 -9
  16. data/installer/unix-like/rho_connect_install_get_params.rb +0 -2
  17. data/installer/unix-like/rho_connect_install_installers.rb +37 -37
  18. data/installer/unix-like/rho_connect_install_utilities.rb +7 -41
  19. data/installer/unix-like/rhoinstaller.rb +1 -5
  20. data/installer/utils/create_texts.rb +26 -9
  21. data/installer/utils/install_test.rb +24 -12
  22. data/installer/windows/rhosync.nsi +5 -5
  23. data/lib/rhoconnect/console/app/public/home.css +3 -10
  24. data/lib/rhoconnect/console/app/public/images/foot_logo_rhoconnect.png +0 -0
  25. data/lib/rhoconnect/console/app/public/images/logo_rhoconnect.png +0 -0
  26. data/lib/rhoconnect/console/app/routes/docs.rb +1 -1
  27. data/lib/rhoconnect/console/app/routes/home.rb +1 -1
  28. data/lib/rhoconnect/console/app/routes/user.rb +1 -1
  29. data/lib/rhoconnect/console/app/views/index.erb +1 -1
  30. data/lib/rhoconnect/console/app/views/layout.erb +4 -16
  31. data/lib/rhoconnect/db_adapter.rb +5 -7
  32. data/lib/rhoconnect/tasks.rb +31 -4
  33. data/lib/rhoconnect/version.rb +1 -1
  34. data/tasks/redis.rake +2 -2
  35. metadata +10 -21
  36. data/bin/rhoconnect-setup +0 -84
  37. data/installer/deb-scripts/LICENSE +0 -75
  38. data/installer/deb-scripts/install.sh +0 -300
  39. data/installer/deb-scripts/scripts/rho_connect_install_constants.rb +0 -32
  40. data/installer/deb-scripts/scripts/rho_connect_install_installers.rb +0 -103
  41. data/installer/deb-scripts/scripts/rho_connect_install_utilities.rb +0 -110
  42. data/installer/deb-scripts/scripts/rhoinstaller.rb +0 -55
  43. data/installer/deb-scripts/utils/README +0 -67
  44. data/installer/deb-scripts/utils/create_texts.rb +0 -76
  45. data/installer/deb-scripts/utils/redis_init_script +0 -124
  46. data/installer/deb-scripts/utils/redis_log_rotate +0 -8
  47. data/installer/unix-like/install.sh +0 -361
  48. data/installer/unix-like/post-install.sh +0 -8
  49. data/installer/unix-like/pre-install.sh +0 -8
  50. data/lib/rhoconnect/console/app/public/images/rhomobile_rhohub_logo.png +0 -0
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhoconnect
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196421
4
+ hash: 15424119
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
- - beta
11
- - 3
12
- version: 3.0.0.beta3
10
+ - rc
11
+ - 1
12
+ version: 3.0.0.rc1
13
13
  platform: ruby
14
14
  authors:
15
15
  - Rhomobile
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-09-22 00:00:00 Z
20
+ date: 2011-09-27 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  type: :runtime
@@ -181,7 +181,6 @@ description: RhoConnect App Integration Server and related command-line utilitie
181
181
  email: dev@rhomobile.com
182
182
  executables:
183
183
  - rhoconnect
184
- - rhoconnect-setup
185
184
  extensions: []
186
185
 
187
186
  extra_rdoc_files:
@@ -295,6 +294,7 @@ files:
295
294
  - doc/web-console.txt
296
295
  - examples/simple/application.rb
297
296
  - examples/simple/config.ru
297
+ - examples/simple/dump.rdb
298
298
  - examples/simple/Rakefile
299
299
  - examples/simple/settings/license.key
300
300
  - examples/simple/settings/settings.yml
@@ -311,19 +311,10 @@ files:
311
311
  - generators/templates/application/spec/spec_helper.rb
312
312
  - generators/templates/source/source_adapter.rb
313
313
  - generators/templates/source/source_spec.rb
314
- - installer/deb-scripts/install.sh
315
- - installer/deb-scripts/LICENSE
316
- - installer/deb-scripts/scripts/rho_connect_install_constants.rb
317
- - installer/deb-scripts/scripts/rho_connect_install_installers.rb
318
- - installer/deb-scripts/scripts/rho_connect_install_utilities.rb
319
- - installer/deb-scripts/scripts/rhoinstaller.rb
320
- - installer/deb-scripts/utils/create_texts.rb
321
- - installer/deb-scripts/utils/README
322
- - installer/deb-scripts/utils/redis_init_script
323
- - installer/deb-scripts/utils/redis_log_rotate
324
- - installer/unix-like/install.sh
325
- - installer/unix-like/post-install.sh
326
- - installer/unix-like/pre-install.sh
314
+ - installer/unix-like/post_install.sh
315
+ - installer/unix-like/post_uninstall.sh
316
+ - installer/unix-like/pre_install.sh
317
+ - installer/unix-like/pre_uninstall.sh
327
318
  - installer/unix-like/rho_connect_install_checkers.rb
328
319
  - installer/unix-like/rho_connect_install_constants.rb
329
320
  - installer/unix-like/rho_connect_install_debian.rb
@@ -392,7 +383,6 @@ files:
392
383
  - lib/rhoconnect/console/app/public/images/land_separator.gif
393
384
  - lib/rhoconnect/console/app/public/images/landing_header.jpg
394
385
  - lib/rhoconnect/console/app/public/images/logo_rhoconnect.png
395
- - lib/rhoconnect/console/app/public/images/rhomobile_rhohub_logo.png
396
386
  - lib/rhoconnect/console/app/public/images/tabs_separator.png
397
387
  - lib/rhoconnect/console/app/public/jqplot/excanvas.min.js
398
388
  - lib/rhoconnect/console/app/public/jqplot/jqplot.barRenderer.min.js
@@ -568,7 +558,6 @@ files:
568
558
  - spec/testdata/upload2.txt
569
559
  - spec/user_spec.rb
570
560
  - bin/rhoconnect
571
- - bin/rhoconnect-setup
572
561
  homepage: http://rhomobile.com/products/rhoconnect
573
562
  licenses: []
574
563
 
data/bin/rhoconnect-setup DELETED
@@ -1,84 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- puts "This script is outdated. Please review the rhoconnect documentation for up-to-date install information."
4
-
5
- # # 1. install packages
6
- # yes | apt-get update
7
- # yes | apt-get install build-essential libopenssl-ruby
8
- # yes | apt-get install libcurl4-openssl-dev
9
- # yes | apt-get install apache2-prefork-dev apache2-mpm-prefork
10
- # yes | apt-get install rubygems
11
- # gem install rhosync SystemTimer --no-ri --no-rdoc
12
- # gem install passenger --no-ri --no-rdoc
13
- # yes | /var/lib/gems/1.8/bin/passenger-install-apache2-module
14
- #
15
- # # 2. load passenger
16
- # echo "
17
- # LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
18
- # PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.7
19
- # PassengerRuby /usr/bin/ruby1.8
20
- # " > /etc/apache2/mods-available/passenger.load
21
- #
22
- # a2enmod passenger
23
- # /etc/init.d/apache2 restart
24
- #
25
- # # 3. create rhosync app
26
- # cd /var/www/
27
- # /var/lib/gems/1.8/bin/rhosync app rhosyncapp1
28
- # cd rhosyncapp1/
29
- # mkdir public
30
- # chown -R www-data:www-data /var/www/rhosyncapp1
31
- # touch /etc/apache2/sites-available/rhosyncapp1
32
- # echo "
33
- # <VirtualHost *:80>
34
- # ServerName $1
35
- # DocumentRoot /var/www/rhosyncapp1/public
36
- # <Directory /var/www/rhosyncapp1/public>
37
- # AllowOverride all
38
- # Options -MultiViews
39
- # </Directory>
40
- # </VirtualHost>
41
- # " > /etc/apache2/sites-available/rhosyncapp1
42
- #
43
- # # 4. enable rhosync app
44
- # a2ensite rhosyncapp1
45
- # /etc/init.d/apache2 reload
46
- #
47
- # # 5. install redis and init service
48
- # cd /root/
49
- # wget http://redis.googlecode.com/files/redis-2.2.5.tar.gz
50
- # tar -xzf redis-2.2.5.tar.gz
51
- # cd redis-2.2.5/src/
52
- # make; make install
53
- # mkdir /usr/local/etc/redis
54
- # mkdir /usr/local/redis
55
- #
56
- #
57
- # wget https://gist.github.com/raw/947446/5c4b6325f892e9da477715e4935f081497957cd7/redis
58
- # wget https://gist.github.com/raw/947485/b179e16045be76a554e2073f9c8d3dcfd073a11d/redis.conf
59
- # adduser --system --no-create-home --disabled-login --disabled-password --group redis
60
- # mv redis /etc/init.d/redis
61
- # chmod +x /etc/init.d/redis
62
- # mv redis.conf /usr/local/etc/redis/
63
- # chown -R redis:redis /usr/local/etc/redis
64
- # chown -R redis:redis /usr/local/redis
65
- #
66
- # touch /var/log/redis.log
67
- # chown redis:redis /var/log/redis.log
68
- # update-rc.d -f redis defaults
69
- #
70
- # /etc/init.d/redis start
71
- #
72
- # cd /root/
73
- # rm -rf redis-*
74
- #
75
- # # 6. setup resque
76
- # wget https://gist.github.com/raw/947510/78a36272f92aa0c67a120a36fd69ea600159676a/resque
77
- # mv resque /etc/init.d/resque
78
- # chmod +x /etc/init.d/resque
79
- #
80
- # touch /var/log/resque.log
81
- # chown www-data:www-data /var/log/resque.log
82
- # update-rc.d -f resque defaults
83
- #
84
- # /etc/init.d/resque start
@@ -1,75 +0,0 @@
1
- An online copy of the following license is available here: http://rhomobile.com/products/rhosync/license/
2
-
3
- This RhoSync Commercial License Agreement is a legal agreement between Rhomobile Inc. ("Rhomobile"), and Licensee (either an individual or a legal entity, hereafter referred to as "Licensee") for the Licensed Software (as defined below). The Licensed Software is not open source software and this is not an open source license.
4
-
5
- 1. DEFINITIONS
6
- Affiliate of a Party shall mean an entity (i) which is directly or indirectly controlling such Party; (ii) which is under the same direct or indirect ownership or control as such Party; or (iii) which is directly or indirectly owned or controlled by such Party.
7
-
8
- Licensee Application shall mean an application (a) developed using a license under Rhomobile's Rhodes framework and (b) which runs on a Mobile Device and synchronizes through the Licensed Software running on a server.
9
-
10
- Licensed Software shall mean the RhoSync computer software, online or electronic documentation, associated media and printed materials, including the source code, example programs and the documentation delivered by Rhomobile to Licensee in conjunction with this Agreement.
11
-
12
- Support shall mean standard developer support that is provided by Rhomobile to assist eligible Designated Users in using the Licensed Software in accordance with its established standard support procedures.
13
-
14
- Updates shall mean a release or version of the Licensed Software containing enhancements, new features, bug fixes, error corrections and other changes that are generally made available to users of the Licensed Software that have contracted for maintenance and support.
15
-
16
- Device shall mean a specific physical mobile device that interacts with the Licensed Software
17
-
18
- 2. OWNERSHIP
19
- The Licensed Software is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The Licensed Software is licensed, not sold.
20
-
21
- Rhomobile shall own all right, title and interest including the intellectual property rights in and to the information on bug fixes or error corrections relating to the Licensed Software that are submitted by Licensee to Rhomobile as well as any intellectual property rights to the correction of any errors, if any. To the extent any rights do not automatically vest in Rhomobile, Licensee assigns, and shall ensure that all of its Affiliates, agents, subcontractors and employees assign, all such rights to Rhomobile.
22
-
23
- 3. VALIDITY OF THE AGREEMENT
24
- By installing, copying, or otherwise using the Licensed Software, Licensee agrees to be bound by the terms of this Agreement. If Licensee does not agree to the terms of this Agreement, Licensee may not install, copy, or otherwise use the Licensed Software. In addition, by installing, copying, or otherwise using any Updates or other components of the Licensed Software that Licensee receives separately as part of the Licensed Software, Licensee agrees to be bound by any additional license terms that accompany such Updates, if any. If Licensee does not agree to the additional license terms that accompany such Updates, Licensee may not install, copy, or otherwise use such Updates. Upon Licensee's acceptance of the terms and conditions of this Agreement and payment of the licensee fee, Rhomobile grants Licensee the right to use the Licensed Software in the manner provided below.
25
-
26
- 4. LICENSE GRANT
27
-
28
- 4.1 Grant
29
- Subject to the terms and conditions of this Agreement, Rhomobile grants to Licensee a non-exclusive, non-transferable, non-sublicensable license to install and use the Licensed Software as contemplated in the applicable documentation and the applicable invoice for the Licensed Software. Licensee is not granted any rights or licenses in the Licensed Software other than those rights expressly granted in this Agreement. Unless otherwise provided in an invoice from Rhomobile or Rhomobile authorized third party sublicensor, Licensee may only install and use the Licensed Software on a single computer ("Server"). If Licensee is explicitly granted a multiple Server license by Rhomobile, or Rhomobile authorized third party sublicensor in an invoice, Licensee may install and use the Licensed Software on not more than the number of Servers listed in the applicable invoice. All uses of the Licensed Software must be in accordance with the documentation provided for the Licensed Software. The Licensed Software is licensed only to Licensee and may not be transferred to any other person or entity without Rhomobile's prior written authorization. Any authorized transferee of the Licensed Software shall be bound in writing by the terms and conditions of this Agreement. In no event may Licensee transfer, assign, rent, lease, sell, or otherwise dispose of the Licensed Software on a temporary or permanent basis except as expressly provided herein. The license granted herein will automatically terminate in the event of any violation of this Agreement by Licensee.
30
-
31
- 4.2 Capacity Restrictions
32
- The Licensed Software shall only be used to support the number of Devices and the number of Licensee Applications set forth in the applicable invoice and paid for. To replace a Device with a new Device for purposes of determining how many Devices are being supported at any one time, the replaced Device must be removed from the RhoSync directory. Increases in the number of Devices and/or the number of Licensee Applications being supported by the Licenses Software must be purchased in advance.
33
-
34
- 5 LIMITED WARRANTY AND WARRANTY DISCLAIMER
35
- Rhomobile warrants to Licensee for a period of ninety (90) days from the date of Licensee's receipt of the Licensed Software (the "Warranty Period") that the Licensed Software as delivered will conform substantially to Rhomobile's then-current published functional specifications set forth in the documentation for the Licensed Software when installed and operated as contemplated in such documentation. In the event of any nonconformity, Rhomobile (or its designee) may, in its sole discretion, either (i) remedy the nonconformity within a reasonable period after notice and verification thereof or (ii) refund the amount Licensee paid for the Software and terminate this Agreement and the license granted herein; provided, however, that Licensee must return the original and all copies of the Licensed Software to Rhomobile or its authorized representative before Licensee will be entitled to receive any such refund. THIS SECTION 5 STATES LICENSEE'S SOLE REMEDY FOR A BREACH OF THE LIMITED WARRANTY OF THE LICENSED SOFTWARE.
36
-
37
- EXCEPT AS SET FORTH IN SECTION 6, THE LICENSED SOFTWARE IS PROVIDED BY RHOMOBILE AND ITS LICENSORS "AS IS" WITHOUT ANY WARRANTY OF ANY KIND INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. NEITHER RHOMOBILE NOR ITS LICENSORS WARRANT THAT THE LICENSED SOFTWARE IS ERROR-FREE OR THAT IT WILL OPERATE WITHOUT INTERRUPTION. NEITHER RHOMOBILE NOR ITS LICENSORS WARRANT, GUARANTEE OR MAKE ANY REPRESENTATION REGARDING THE USE, OR THE RESULTS OF THE USE OF THE LICENSED SOFTWARE INCLUDING, WITHOUT LIMITATION, THE CORRECTNESS, ACCURACY OR RELIABILITY OF SUCH USE OR RESULTS. LICENSEE ACKNOWLEDGES AND AGREES THAT RHOMOBILE IS NOT RESPONSIBLE FOR AND WILL HAVE NO LIABILITY FOR HARDWARE, SOFTWARE, CONTENT OR OTHER ITEMS OR ANY SERVICES PROVIDED BY ANY PERSONS OTHER THAN RHOMOBILE.
38
-
39
- 6. LIMITATION OF LIABILITY
40
- TO THE MAXIMUM EXTENT PERMITTED BY LAW, RHOMOBILE AND ITS LICENSORS WILL NOT BE LIABLE WITH RESPECT TO ANY SUBJECT MATTER OF THIS AGREEMENT UNDER ANY CONTRACT, NEGLIGENCE, STRICT LIABILITY OR OTHER LEGAL OR EQUITABLE THEORY FOR: (I) ANY AMOUNTS IN EXCESS IN THE AGGREGATE OF THE AMOUNTS YOU PAID FOR THE LICENSED SOFTWARE; (II) ANY LOST DATA OR OTHER EXEMPLARY, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, LOSS OF DATA, OR ANY AND ALL LOST PROFITS, EVEN IF RHOMOBILE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (III) THE COST OF PROCURING SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY. THE LIMITATION OF LIABILITY SET FORTH IN THIS SECTION 6 SHALL NOT APPLY TO THE EXTENT PROHIBITED BY APPLICABLE LAW.
41
-
42
- 7. SUPPORT AND UPDATES
43
- Licensee shall be eligible to receive Support and Updates for one year from the date of the delivery of the Licensed Software to Licensee, in accordance with Rhomobile's then current policies and procedures, if any. After that time period the customer shall be entitled to execute a maintenance agreement which will entitle them to ongoing support and updates. Licensee may purchase additional Support and Updates following the Initial Term at 18% of the original price of the Licensed Software.
44
-
45
- 8. EXPORT
46
-
47
- Licensee acknowledges that the Licensed Software may be subject to the export and import control laws of the United States and any country where the Licensed Software is manufactured or received. Licensee agrees not to violate any such laws. Licensee further agrees not to export the Licensed Software to any prohibited country, entity or person for which an export license or other governmental approval is required. Obtaining any necessary governmental approval or licenses is solely the obligation of Licensee.
48
-
49
- 9. GENERAL PROVISIONS
50
-
51
- 9.1 Marketing
52
- Rhomobile may include Licensee's company name and logo in a publicly available list of Rhomobile Licensees and in its public communications.
53
-
54
- 9.2 No Assignment
55
- Licensee shall not be entitled to assign or transfer all or any of its rights, benefits and obligations under this Agreement without the prior written consent of Rhomobile, which shall not be unreasonably withheld.
56
-
57
- 9.3 Termination
58
- This Agreement will remain in force until terminated. Licensee may terminate this Agreement at any time upon providing written notice thirty days in advance of the termination. Rhomobile may terminate this Agreement if Licensee breaches any of the terms or conditions hereunder. Licensee agrees to destroy or return to Rhomobile the original and all copies of the Licensed Software immediately upon any termination of this Agreement, and certify the same in writing if requested.
59
-
60
- 9.4 Surviving Sections
61
- Any terms and conditions that by their nature or otherwise reasonably should survive a cancellation or termination of this Agreement shall also be deemed to survive. Such terms and conditions include, but are not limited to the following Sections: 2, 4, 5, 6, 7, 8, 9, 11, and 12of this Agreement. Notwithstanding the foregoing, Section 4.1 shall not survive if the Agreement is terminated for material breach.
62
-
63
- 9.5 Entire Agreement
64
- This Agreement constitutes the complete agreement between the parties and supersedes all prior or contemporaneous discussions, representations, and proposals, written or oral, with respect to the subject matters discussed herein No modification of this Agreement shall be effective unless contained in a writing executed by an authorized representative of each party. No term or condition contained in Licensee's purchase order shall apply unless expressly accepted by Rhomobile in writing. If any provision of the Agreement is found void or unenforceable, the remainder shall remain valid and enforceable according to its terms. If any remedy provided is determined to have failed for its essential purpose, all limitations of liability and exclusions of damages set forth in this Agreement shall remain in effect.
65
-
66
- 9.6 Notices
67
- Any notice given by one party to the other shall be deemed properly given and deemed received if specifically acknowledged by the receiving party in writing or when successfully delivered to the recipient by hand, fax, or special courier during normal business hours on a business day to the addresses specified below. Each communication and document made or delivered by one party to the other party pursuant to this Agreement shall be in the English language or accompanied by a translation thereof.
68
- Notices to Rhomobile shall be given to:
69
-
70
- Rhomobile, Inc.
71
- 3031 Tisch Way Suite 1002
72
- San Jose, CA 95128
73
-
74
- 9.7 Governing Law and Legal Venue
75
- This Agreement shall be governed by and construed in accordance with the federal laws of the United States of America and the internal laws of the State of California without giving effect to any choice of law rule that would result in the application of the laws of any other jurisdiction. The United Nations Convention on Contracts for the International Sale of Goods (CISG) shall not apply. Each Party (a) hereby irrevocably submits itself to and consents to the jurisdiction of the United States District Court for the Northern District of California (or if such court lacks jurisdiction, the state courts of the State of California) for the purposes of any action, claim, suit or proceeding between the Parties in connection with any controversy, claim, or dispute arising out of or relating to this Agreement; and (b) hereby waives, and agrees not to assert by way of motion, as a defense or otherwise, in any such action, claim, suit or proceeding, any claim that is not personally subject to the jurisdiction of such court(s), that the action, claim, suit or proceeding is brought in an inconvenient forum or that the venue of the action, claim, suit or proceeding is improper.
@@ -1,300 +0,0 @@
1
- #!/bin/bash
2
-
3
- # CONSTANTS
4
-
5
- PASSENGER_VERSION="passenger-3.0.9"
6
-
7
- RUBY="ruby-enterprise-1.8.7-2011.03"
8
- REDIS="redis-2.2.12"
9
- SQLITE3="sqlite-autoconf-3070701"
10
- SOFTWARE= ($REDIS $SQLITE3)
11
-
12
- RUBY_TAR="${RUBY}.tar.gz"
13
- REDIS_TAR="${REDIS}.tar.gz"
14
- SQLITE3_TAR="${SQLITE3}.tar.gz"
15
- TARS=($REDIS_TAR $SQLITE3_TAR)
16
-
17
- RUBY_URL="http://rubyenterpriseedition.googlecode.com/files/${RUBY_TAR}"
18
- REDIS_URL="http://redis.googlecode.com/files/${REDIS_TAR}"
19
- SQLITE3_URL="http://www.sqlite.org/${SQLITE3_TAR}"
20
- URLS=($REDIS_URL $SQLITE3_URL)
21
-
22
- GEMS=("bundler" "passenger")
23
-
24
- PKG_MGR="apt-get"
25
-
26
- WEB_SERVER="nginx"
27
-
28
- WEB_SERVER_URL="http://localhost/"
29
-
30
- DEFAULT_INSTALL_DIR="/opt/rhoconnect"
31
-
32
- # INITIALIZATIONS
33
-
34
- timeInitial=`date +%H%M%S`
35
- installTime=$timeInitial
36
-
37
- # FUNCTIONS
38
-
39
- echoLog(){
40
- echo -e $1 | tee -a $log
41
- } #end echoLog
42
-
43
- # cmd
44
- # This method issues the given system command and calls log_print for output
45
- cmd(){
46
- cmd=$1
47
- echoLog cmd
48
- echoLog `${cmd}`
49
- } #end cmd
50
-
51
- checkDeps(){
52
- deps=("zlib1g-dev" "libreadline5-dev" "build-essential" "libssl-dev"
53
- "libcurl4-openssl-dev" "libapr1-dev" "libaprutil1-dev"
54
- "gcc" "make" "wget")
55
- i="0"
56
- missing=""
57
-
58
- while [[ ${deps[$i]} != "" ]]; do
59
- pkg=${deps[$i]}
60
- pkgChk=`dpkg -l | grep -w ${pkg}`
61
- if [[ $pkgChk == "" ]]; then
62
- missing=$missing$pkg"\n"
63
- fi
64
- i=$[i+1]
65
- done
66
-
67
- if [[ $missing != "" ]]; then
68
- echoLog "Some dependencies must be installed before the setup can continue..."
69
- echoLog $missing
70
- exit
71
- fi
72
-
73
- } #end checkDeps
74
-
75
- setPrefixDependantPaths (){
76
- # if rubyBinDir not specified
77
- if [$rubyBinDir == ""]; then
78
- rubyBinDir="${prefix}/ruby/bin"
79
- fi
80
-
81
- # If logs directory does not exist, create it
82
- if ! [[ -d "${prefix}/logs/" ]]; then
83
- mkdir "${prefix}/logs/"
84
- fi
85
-
86
- # Make path to log file absolute and create directory if not already existent
87
- log="${prefix}/logs/${log}"
88
- touch $log
89
-
90
- # Add the log file path to the info file
91
- echo $log >> info.dat
92
- cat info.dat
93
-
94
- # Move info.dat into installation directory if not already there
95
- if ! [ -e "${prefix}/info.dat" ]; then
96
- mv info.dat "${prefix}/info.dat"
97
- fi
98
- } #end setPrefixDependantPaths
99
-
100
- setDefaults (){
101
- # if $prefix not specified set to /opt/rhoconnect
102
- if [$prefix == ""]; then
103
- prefix=$DEFAULT_INSTALL_DIR
104
- fi
105
-
106
- # if $webServer not specified set to apache2
107
- if [$webServer == ""]; then
108
- webServer=$WEB_SERVER
109
- fi
110
- } #end setDefaults
111
-
112
- logAndPrint (){
113
- $1 > tempout 2>&1
114
- exitStatus=$?
115
- cat tempout | tee -a $log
116
- } #end logAndPrint
117
-
118
- # installRuby
119
- # Installs ruby enterprise edition
120
- installRuby (){
121
- if [[ ! -d "${prefix}${RUBY}" ]]; then
122
- echoLog "Loading ruby tarball ..."
123
- cmd "wget -P ${prefix} ${RUBY_URL}"
124
- cmd "tar -xzf ${prefix}/${RUBY_TAR} -C ${prefix}"
125
- fi
126
-
127
- echoLog "Installing ruby. This may take some time..."
128
-
129
- logAndPrint "${prefix}/${RUBY}/installer --dont-install-useful-gems --no-dev-docs --auto ${prefix}"
130
-
131
- if [[ $exitStatus != 0 ]]; then
132
- echoLog "Some dependencies not installed..."
133
- echoLog "Please install them and then re-run the installation script."
134
- exit
135
- fi
136
-
137
- PATH=${prefix}:$PATH
138
-
139
- rm tempout
140
- } #end installRuby
141
-
142
- # download
143
- # Downloads file stored at given URL to the given prefix unlessit already
144
- # exists
145
- download(){
146
- url=$1
147
- prefix=$2
148
- downloads="./downloads"
149
- found=""
150
-
151
- if [ -e $downloads ]; then
152
- while read line; do
153
- if ! [ "${line}" == "${url}" ]; then
154
- found="found"
155
- fi
156
- done < $downloads
157
- fi
158
-
159
- if [ "${found}" == "" ]; then
160
- cmd "wget -P ${prefix} ${url}"
161
- echo ${url} >> $downloads
162
- fi
163
-
164
- rm $downloads
165
- } #end download
166
-
167
- # decompress
168
- # Decompresses downloaded files unless already decompressed directory
169
- # exists
170
- decompress(){
171
- tar=$1
172
- prefix=$2
173
-
174
- cmd "tar -xzvf ${prefix}/${tar} -C ${prefix}"
175
- } #end decompress
176
-
177
- # downloadAndDecompress
178
- # 1) Iterates through the the list of URLs and downloads each item
179
- # 2) Iterates through the list of TARs and unpacks each one
180
- downloadAndDecompress(){
181
- prefix=$1
182
- for (( i=0; i < ${#URLS[@]}; i++ )); do
183
- download ${URLS[$i]} ${prefix}
184
- done #for
185
-
186
- for (( i=0; i < ${#TARS[@]}; i++ )); do
187
- decompress ${#TARS[$i]} ${prefix}
188
- done #for
189
- } #end downloadAndDecompress
190
-
191
- rhoinstaller(){
192
-
193
- } #end rhoinstaller
194
-
195
- # SCRIPT
196
- checkDeps
197
-
198
- # define log file name
199
- datefile=`date +%Y%m%d%H%M%S`
200
- log=rhoconnect_$(date +$datefile).log
201
-
202
- # define option variables
203
- opts=""
204
- prefix=""
205
- getVal=""
206
- webServer=""
207
- rubyBinDir=""
208
-
209
- # Set default Values
210
- setDefaults
211
-
212
- # Set ruby insatallation variables
213
- setRubyVars
214
-
215
- # Once the prefix path is cleaned up...
216
- setPrefixDependantPaths
217
-
218
- # Install ruby if not already installed
219
- if ! [ -e "${prefix}/bin/ruby" ]; then
220
- installRuby
221
- else
222
- echoLog "Ruby already installed" | tee -a $log
223
- fi
224
-
225
- #!/opt/rhoconnect/bin/ruby
226
-
227
- #require 'rho_connect_install_constants'
228
- #require 'rho_connect_install_installers'
229
-
230
- include Installers
231
-
232
- module Utilities
233
- extend self
234
-
235
- # cleanup
236
- # This method moves all compressed files from the installation directory
237
- # that were downloaded by this installation process
238
- def cleanup(options)
239
- prefix = options[:prefix]
240
-
241
- print_header "Cleaning up"
242
-
243
- Dir.mkdir("#{prefix}/downloads") unless File.directory?("#{prefix}/downloads")
244
- Constants::URLS.each do |url|
245
- file = get_version url
246
- if File.exists?("#{prefix}/#{file}")
247
- cmd "rm -rf #{prefix}/downloads/#{file}"
248
- cmd "mv #{prefix}/#{file}* #{prefix}/downloads"
249
- end #if
250
- end # do
251
- end #cleanup
252
- end #utilities
253
-
254
- # set necessary variables
255
- :dist => "debian",
256
- :pkg_mgr => 'apt-get -y',
257
- :pkg_chkr => 'dpkg -l',
258
- :start_dir => `pwd`.strip,
259
- :web_server => Constants::WEB_SERVER}
260
-
261
- log = Logger.new(IO.readlines("#{@options[:prefix]}/info.dat").last.strip)
262
- log.datetime_format = "%Y-%m-%d %H:%M:%S" # simplify time output
263
-
264
- # execute_installation
265
- # This method orchestrates the actual installation process
266
- def execute_installation
267
- install_sqlite @options
268
-
269
- # Start installing
270
- install_all_gems @options
271
- configure_passenger @options
272
-
273
- # Install Redis
274
- install_redis @options
275
-
276
- # Install rhoconnect
277
- install_rhoconnect @options
278
-
279
- # Remove downloaded tarballs and extracted directories
280
- cleanup @options
281
- end #execute_installation
282
-
283
- # Start installation process
284
- download_and_decompress @options[:prefix]
285
-
286
- execute_installation
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
-
295
-
296
-
297
- # Cleanup
298
- rm "${prefix}/info.dat"
299
-
300
- ${prefix}/bin/ruby ./utils/create_texts.rb
@@ -1,32 +0,0 @@
1
- #!/opt/rhoconnect/bin/ruby
2
-
3
- module Constants
4
-
5
- PASSENGER_VERSION = "passenger-3.0.9"
6
-
7
- #RUBYGEMS = "rubygems-1.8.5"
8
- REDIS = "redis-2.2.12"
9
- SQLITE3 = "sqlite-autoconf-3070701"
10
-
11
- SOFTWARE = [REDIS,
12
- SQLITE3]
13
-
14
- #RUBYGEMS_URL = "http://rubyforge.org/frs/download.php/74954/" +
15
- # "#{ RUBYGEMS }.tgz"
16
- REDIS_URL = "http://redis.googlecode.com/files/#{ REDIS }.tar.gz"
17
- SQLITE3_URL = "http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz"
18
-
19
-
20
- URLS = [REDIS_URL,
21
- SQLITE3_URL]
22
-
23
- GEMS = ["bundler", "passenger"]
24
-
25
- SUPPORTED_PKG_MGRS = ["apt-get", "yum"]
26
-
27
- WEB_SERVER = "nginx"
28
-
29
- WEB_SERVER_URL = "http://localhost/"
30
-
31
- DEFAULT_INSTALL_DIR = "/opt/rhoconnect"
32
- end #Constants
@@ -1,103 +0,0 @@
1
- #!/opt/rhoconnect/bin/ruby
2
-
3
- require 'rho_connect_install_constants'
4
- require 'readline'
5
-
6
- module Installers
7
- extend self
8
- # configure_passenger
9
- # This method installs items that were retrieved via wget as well as
10
- # passenger
11
- def configure_passenger(options)
12
- @options = options
13
- installs = 0
14
- print_header "Configuring Passenger"
15
- print_header "Configuring Nginx to work with Passenger"
16
- cmd "#{@options[:prefix]}/bin/passenger-install-#{@options[:web_server]}-module " +
17
- "--auto --auto-download --prefix=/opt/rhoconnect/bin"
18
- if $? != 0
19
- log_print "Passenger not configured."
20
- exit
21
- end #if
22
- end #configure_passenger
23
-
24
- # install_all_gems
25
- # This method installs all gems specified in the GEMS list defined in the
26
- # Constants file
27
- def install_all_gems(options)
28
- @options = options
29
- @gem_path = "#{@options[:prefix]}/bin/gem"
30
- Constants::GEMS.each do |gem|
31
- install_gem gem
32
- end #do
33
- end #install_all_gems
34
-
35
- # install_gem
36
- # This method installs the given gem
37
- def install_gem(gem)
38
- cmd "#{@gem_path} install #{ gem } --no-ri --no-rdoc"
39
- end #install_gem
40
-
41
- # install_rubygems
42
- # This method installs rubygems which was downloaded and untarred earlier
43
- def install_rubygems
44
- print_header "Installing Rubygems"
45
- Dir.chdir("#{@options[:prefix]}/#{Constants::RUBYGEMS}")
46
- cmd "#{@options[:prefix]}/bin/ruby setup.rb --prefix=#{@options[:prefix]}/#{Constants::RUBYGEMS}"
47
- @gem_path = "#{@options[:prefix]}/bin/gem"
48
- cmd "sed -n '1 c\#!/opt/rhoconnect/bin/ruby' #{@options[:prefix]}/bin/gem"
49
- end #install_rubygems
50
-
51
- # install_redis
52
- # This method installs redis
53
- def install_redis(options)
54
- @options = options
55
- puts "\nWould you like to install Redis (yes / no)?"
56
- answer = STDIN.readline.strip.downcase
57
- while answer != "yes" &&
58
- answer != "no"
59
- puts "Please answer yes or no."
60
- end
61
-
62
- if answer == "yes"
63
- Dir.chdir("#{@options[:prefix]}/#{Constants::REDIS}/src")
64
- cmd "make; make PREFIX=#{@options[:prefix]} install"
65
- cmd "mkdir #{@options[:prefix]}/etc" unless File.exist? "#{@options[:prefix]}/etc"
66
-
67
- #cmd "cp ../redis.conf #{@options[:prefix]}etc"
68
- redis_conf_file = File.new("#{@options[:prefix]}/etc/redis.conf", 'w')
69
- File.foreach("../redis.conf") do |line|
70
- # daemonize no --> daemonize yes
71
- # logfile stdout --> logfile /var/log/redis.log
72
- if line =~ /^daemonize/
73
- redis_conf_file << "daemonize yes" << "\n"
74
- elsif line =~ /^logfile/
75
- redis_conf_file << "logfile /var/log/redis.log" << "\n"
76
- else
77
- redis_conf_file << line
78
- end
79
- end
80
- redis_conf_file.close
81
- end #if
82
- end #install_redis
83
-
84
- # install_sqlite
85
- # This method installs sqlite
86
- def install_sqlite(options)
87
- @options = options
88
- Dir.chdir("#{@options[:prefix]}/#{Constants::SQLITE3}")
89
- cmd "./configure --prefix=#{@options[:prefix]}"
90
- cmd "make; make install"
91
- end #install_sqlite
92
-
93
- # install_rhoconnect
94
- # This method installs rhoconnect
95
- def install_rhoconnect(options)
96
- @options = options
97
- print_header "Installing Rhoconnect"
98
-
99
- cmd "#{@gem_path} install rhoconnect-*.gem --no-ri --no-rdoc"
100
- cmd "rm -f rhoconnect-*.gem"
101
-
102
- end #install_rhoconnect
103
- end #Installers