blob: fbfcd62d17cf3e578b4856720491a1022f97763d (
plain)
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
|
require 'rubygems'
require 'rake'
require 'opentox-ruby-api-wrapper'
#require 'tasks/opentox'
@gems = "sinatra rest-client emk-sinatra-url-for sinatra-respond_to"
namespace :openbabel do
desc "Install openbabel"
task :install do
puts `sudo gem sources -a http://gems.github.com`
puts `sudo gem install #{@gems}`
begin
require 'openbabel'
puts "Openbabel is already installed"
rescue Exception => exc
puts "Trying to install openbabel"
Dir.chdir('/tmp')
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')
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
end
desc "Run tests"
task :test do
load 'test/test.rb'
end
|