summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <ch@in-silico.ch>2009-08-14 13:22:21 +0200
committerChristoph Helma <ch@in-silico.ch>2009-08-14 13:22:21 +0200
commitd9bd72ffa304257191b611dc2ad86cf3365bd77f (patch)
tree9250f2c7bd959d787ae01913ab50db70b3cdddd5
parent632f04c25f83c9d11adaa5f1b53af296ee16a7ea (diff)
Openbabel installation task fixed
-rw-r--r--Rakefile32
1 files changed, 21 insertions, 11 deletions
diff --git a/Rakefile b/Rakefile
index 602ea40..6ba8585 100644
--- a/Rakefile
+++ b/Rakefile
@@ -3,22 +3,32 @@ require 'rake'
desc "Install required gems and openbabel"
task :install do
- `sudo gem sources -a http://gems.github.com`
- `sudo gem install sinatra rest-client emk-sinatra-url-for cehoffman-sinatra-respond_to`
+ puts `sudo gem sources -a http://gems.github.com`
+ puts `sudo gem install sinatra rest-client emk-sinatra-url-for cehoffman-sinatra-respond_to`
begin
require 'openbabel'
puts "Openbabel is already installed"
- rescue
+ rescue Exception => exc
+ puts "Trying to install openbabel"
Dir.chdir('/tmp')
- `wget http://downloads.sourceforge.net/project/openbabel/openbabel/2.2.2/openbabel-2.2.2.tar.gz`
- `tar xzf openbabel-2.2.2.tar.gz`
+ puts `wget http://downloads.sourceforge.net/project/openbabel/openbabel/2.2.2/openbabel-2.2.2.tar.gz` unless File.exists?('openbabel-2.2.2.tar.gz')
+ puts `tar xzf openbabel-2.2.2.tar.gz` unless File.exists?('openbabel-2.2.2')
Dir.chdir('openbabel-2.2.2')
- `configure && make`
- `sudo make install`
- Dir.cd('srcipts/ruby')
- `ruby extconf.rb --with-openbabel-include=../../include --with-openbabel-lib=../../src/.libs`
- `make`
- `make install`
+ puts `./configure`
+ puts "Compiling Openbabel - this may take some time ..."
+ puts `make`
+ puts `sudo make install`
+ Dir.chdir('scripts/ruby')
+ puts `ruby extconf.rb --with-openbabel-include=../../include --with-openbabel-lib=../../src/.libs`
+ puts "Compiling Ruby extension for Openbabel - this may take some time ..."
+ puts `make`
+ puts `sudo make install`
+ begin
+ require 'openbabel'
+ puts "Openbabel sucessfully installed"
+ rescue Exception => exc
+ puts "Failed to install Openbabel - please try manually."
+ end
end
end