summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2009-11-17 13:49:00 +0100
committerChristoph Helma <helma@in-silico.de>2009-11-17 13:49:00 +0100
commitc796b25c1a70217a7f542bda4a7a51efb66f5b86 (patch)
treebafd702bcd34145bdbda37f745e2ff14e7a43ee4
parent9dadb01e2f973f1f33415e79eaddfd408fa5ae8f (diff)
Passenger (re)start fixed
-rw-r--r--Rakefile5
-rw-r--r--bin/opentox-install-debian.sh105
-rw-r--r--lib/tasks/opentox.rb16
-rw-r--r--opentox-ruby-api-wrapper.gemspec20
4 files changed, 129 insertions, 17 deletions
diff --git a/Rakefile b/Rakefile
index 2c4322f..9d042a5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -15,10 +15,13 @@ begin
gem.add_dependency "rack"
gem.add_dependency "rack-contrib"
gem.add_dependency "thin"
- gem.add_dependency "cucumber"
gem.add_dependency "ezmobius-redis-rb"
gem.add_dependency "emk-sinatra-url-for"
gem.add_dependency "cehoffman-sinatra-respond_to"
+ gem.add_dependency "dm-core"
+ gem.add_dependency "datamapper"
+ gem.add_dependency "do_sqlite3"
+ gem.add_development_dependency "cucumber"
gem.files = FileList["[A-Z]*", "{bin,generators,lib,test}/**/*", 'lib/jeweler/templates/.gitignore']
gem.files.include %w(lib/tasks/opentox.rb, lib/tasks/redis.rb, lib/environment.rb, lib/algorithm.rb, lib/compound.rb, lib/dataset.rb, lib/feature.rb, lib/model.rb, lib/utils.rb, lib/templates/*)
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
diff --git a/bin/opentox-install-debian.sh b/bin/opentox-install-debian.sh
new file mode 100644
index 0000000..cf173da
--- /dev/null
+++ b/bin/opentox-install-debian.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+#Installation is tested on Debian Lenny Ubuntu 9.04
+#Update the system
+
+ERRLOG='install_err.log'
+INSTALLLOG='install_log.log'
+DATE=$(date +%Y/%m/%d\ %H:%M:%S)
+
+echo "================================================="
+echo "Please enshure that the sudo package is installed"
+echo "on your system. "
+echo "On Ubuntu Linux sudo is installed by default."
+echo "If you are unshure check with it 'sudo ls'"
+echo "and installed it with 'apt-get install sudo'"
+echo "and add your username with visudo."
+echo "================================================="
+echo -n "To continue installation press y: "
+read answer
+if [ "$answer" != "y" ]
+then
+ echo "exiting the script..."
+ exit 1
+fi
+
+echo "opentox webservice install log - " $DATE > $INSTALLLOG
+echo "Installing: build-essential"
+sudo apt-get install build-essential >> $INSTALLLOG 2>>$ERRLOG
+echo "Installing: ruby 1.8 with its dev files"
+sudo apt-get install ruby ruby1.8-dev >> $INSTALLLOG 2>>$ERRLOG
+echo "Installing: gems rdoc rubygems and rake"
+sudo apt-get install gems rdoc rubygems rake >> $INSTALLLOG 2>>$ERRLOG
+
+echo "Installing rubygems from source. This may take some time"
+wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz >> $INSTALLLOG 2>>$ERRLOG
+tar xzfv rubygems-1.3.5.tgz 2>>$ERRLOG
+cd rubygems-1.3.5 >> $INSTALLLOG 2>>$ERRLOG
+sudo ruby setup.rb 2>>$ERRLOG
+cd ..
+
+echo "Adding http://gems.github.com to ruby gem sources"
+sudo gem sources -a http://gems.github.com >> $INSTALLLOG 2>>$ERRLOG
+
+#for debian lenny:
+echo "Installing packages: zlib1g-dev tcl curl perl ssh tcl tk8.5"
+sudo apt-get install zlib1g-dev tcl curl perl ssh tcl tk8.5 >> $INSTALLLOG 2>>$ERRLOG
+echo "Installing git from source"
+wget http://www.kernel.org/pub/software/scm/git/git-1.6.5.2.tar.gz >> $INSTALLLOG 2>>$ERRLOG
+tar xzfv git-1.6.5.2.tar.gz 2>>$ERRLOG
+cd git-1.6.5.2 >> $INSTALLLOG 2>>$ERRLOG
+./configure 2>>$ERRLOG
+make 2>>$ERRLOG
+make install 2>>$ERRLOG
+
+echo "Installing the opentox webservices"
+mkdir webservices >> $INSTALLLOG 2>>$ERRLOG
+cd webservices >> $INSTALLLOG 2>>$ERRLOG
+
+git clone git://github.com/helma/opentox-compound.git >> $INSTALLLOG 2>>$ERRLOG
+git clone git://github.com/helma/opentox-feature.git >> $INSTALLLOG 2>>$ERRLOG
+git clone git://github.com/helma/opentox-dataset.git >> $INSTALLLOG 2>>$ERRLOG
+git clone git://github.com/helma/opentox-algorithm.git >> $INSTALLLOG 2>>$ERRLOG
+git clone git://github.com/helma/opentox-model.git >> $INSTALLLOG 2>>$ERRLOG
+git clone git://github.com/helma/opentox-test.git >> $INSTALLLOG 2>>$ERRLOG
+
+cd opentox-compound >> $INSTALLLOG 2>>$ERRLOG
+git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
+cd ../opentox-feature >> $INSTALLLOG 2>>$ERRLOG
+git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
+cd ../opentox-dataset >> $INSTALLLOG 2>>$ERRLOG
+git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
+cd ../opentox-algorithm >> $INSTALLLOG 2>>$ERRLOG
+git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
+cd ../opentox-model >> $INSTALLLOG 2>>$ERRLOG
+git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
+cd .. >> $INSTALLLOG 2>>$ERRLOG
+git clone git://github.com/helma/opentox-ruby-api-wrapper.git >> $INSTALLLOG 2>>$ERRLOG
+cd opentox-ruby-api-wrapper >> $INSTALLLOG 2>>$ERRLOG
+git checkout -b development origin/development >> $INSTALLLOG 2>>$ERRLOG
+rake install >> $INSTALLLOG 2>>$ERRLOG
+
+
+cd ../opentox-compound >> $INSTALLLOG 2>>$ERRLOG
+echo "Installing libopenssl-ruby"
+sudo apt-get install libopenssl-ruby >> $INSTALLLOG 2>>$ERRLOG
+echo "Installing dtach"
+rake dtach:install >> $INSTALLLOG 2>>$ERRLOG
+echo "Installing openbabel"
+rake openbabel:install >> $INSTALLLOG 2>>$ERRLOG
+
+#debian lenny missed liblink:
+ln -s /usr/local/lib/libopenbabel.so.3 /usr/lib/libopenbabel.so.3 >> $INSTALLLOG 2>>$ERRLOG
+
+rake redis:download >> $INSTALLLOG 2>>$ERRLOG
+rake redis:install >> $INSTALLLOG 2>>$ERRLOG
+#edit /home/[username]/.opentox/config/test.yaml set :base_dir: /home/[username]/webservices
+sudo apt-get install libgsl0-dev >> $INSTALLLOG 2>>$ERRLOG
+sudo apt-get install swig >> $INSTALLLOG 2>>$ERRLOG
+sudo apt-get install curl >> $INSTALLLOG 2>>$ERRLOG
+cd ../opentox-algorithm >> $INSTALLLOG 2>>$ERRLOG
+echo "Installing fminer"
+rake fminer:install >> $INSTALLLOG 2>>$ERRLOG
+sudo apt-get install libsqlite3-dev >> $INSTALLLOG 2>>$ERRLOG
+
+
+mkdir ../opentox-model/db >> $INSTALLLOG 2>>$ERRLOG
diff --git a/lib/tasks/opentox.rb b/lib/tasks/opentox.rb
index 8018fff..38202dd 100644
--- a/lib/tasks/opentox.rb
+++ b/lib/tasks/opentox.rb
@@ -22,16 +22,6 @@ end
namespace :opentox do
- desc "Install required gems"
- task :install do
- puts `sudo gem install #{@gems}`
- end
-
- desc "Update gems"
- task :update do
- puts `sudo gem update #{@gems}`
- end
-
namespace :services do
desc "Run opentox services"
@@ -51,7 +41,8 @@ namespace :opentox do
puts "Cannot start #{service} on port #{port}."
end
when 'passenger'
- `touch #{File.join(dir, 'tmp/restart.txt')}`
+ FileUtils.mkdir_p File.join(dir, 'tmp')
+ FileUtils.touch File.join(dir, 'tmp/restart.txt')
puts "#{service} restarted."
else
puts "not yet implemented"
@@ -108,7 +99,8 @@ task :start do
puts "Cannot start #{service} on port #{port}."
end
when 'passenger'
- `touch tmp/restart.txt`
+ FileUtils.mkdir_p File.join(dir, 'tmp')
+ FileUtils.touch File.join(dir, 'tmp/restart.txt')
puts "#{service} restarted."
else
puts "not yet implemented"
diff --git a/opentox-ruby-api-wrapper.gemspec b/opentox-ruby-api-wrapper.gemspec
index 17be199..c5b293d 100644
--- a/opentox-ruby-api-wrapper.gemspec
+++ b/opentox-ruby-api-wrapper.gemspec
@@ -5,13 +5,15 @@
Gem::Specification.new do |s|
s.name = %q{opentox-ruby-api-wrapper}
- s.version = "1.1.1"
+ s.version = "1.1.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Christoph Helma"]
s.date = %q{2009-11-17}
+ s.default_executable = %q{opentox-install-debian.sh}
s.description = %q{Ruby wrapper for the OpenTox REST API (http://www.opentox.org)}
s.email = %q{helma@in-silico.ch}
+ s.executables = ["opentox-install-debian.sh"]
s.extra_rdoc_files = [
"LICENSE",
"README.rdoc"
@@ -21,6 +23,7 @@ Gem::Specification.new do |s|
"README.rdoc",
"Rakefile",
"VERSION",
+ "bin/opentox-install-debian.sh",
"lib/algorithm.rb",
"lib/compound.rb",
"lib/dataset.rb",
@@ -56,20 +59,26 @@ Gem::Specification.new do |s|
s.add_runtime_dependency(%q<rack>, [">= 0"])
s.add_runtime_dependency(%q<rack-contrib>, [">= 0"])
s.add_runtime_dependency(%q<thin>, [">= 0"])
- s.add_runtime_dependency(%q<cucumber>, [">= 0"])
s.add_runtime_dependency(%q<ezmobius-redis-rb>, [">= 0"])
s.add_runtime_dependency(%q<emk-sinatra-url-for>, [">= 0"])
s.add_runtime_dependency(%q<cehoffman-sinatra-respond_to>, [">= 0"])
+ s.add_runtime_dependency(%q<dm-core>, [">= 0"])
+ s.add_runtime_dependency(%q<datamapper>, [">= 0"])
+ s.add_runtime_dependency(%q<do_sqlite3>, [">= 0"])
+ s.add_development_dependency(%q<cucumber>, [">= 0"])
else
s.add_dependency(%q<rest-client>, [">= 0"])
s.add_dependency(%q<sinatra>, [">= 0"])
s.add_dependency(%q<rack>, [">= 0"])
s.add_dependency(%q<rack-contrib>, [">= 0"])
s.add_dependency(%q<thin>, [">= 0"])
- s.add_dependency(%q<cucumber>, [">= 0"])
s.add_dependency(%q<ezmobius-redis-rb>, [">= 0"])
s.add_dependency(%q<emk-sinatra-url-for>, [">= 0"])
s.add_dependency(%q<cehoffman-sinatra-respond_to>, [">= 0"])
+ s.add_dependency(%q<dm-core>, [">= 0"])
+ s.add_dependency(%q<datamapper>, [">= 0"])
+ s.add_dependency(%q<do_sqlite3>, [">= 0"])
+ s.add_dependency(%q<cucumber>, [">= 0"])
end
else
s.add_dependency(%q<rest-client>, [">= 0"])
@@ -77,9 +86,12 @@ Gem::Specification.new do |s|
s.add_dependency(%q<rack>, [">= 0"])
s.add_dependency(%q<rack-contrib>, [">= 0"])
s.add_dependency(%q<thin>, [">= 0"])
- s.add_dependency(%q<cucumber>, [">= 0"])
s.add_dependency(%q<ezmobius-redis-rb>, [">= 0"])
s.add_dependency(%q<emk-sinatra-url-for>, [">= 0"])
s.add_dependency(%q<cehoffman-sinatra-respond_to>, [">= 0"])
+ s.add_dependency(%q<dm-core>, [">= 0"])
+ s.add_dependency(%q<datamapper>, [">= 0"])
+ s.add_dependency(%q<do_sqlite3>, [">= 0"])
+ s.add_dependency(%q<cucumber>, [">= 0"])
end
end