Sha256: 12a12d0e6a7fb4a23226bece63da2f4dd949a9777a06bf0733ca93fb90ebb834

Contents?: true

Size: 951 Bytes

Versions: 3

Compression:

Stored size: 951 Bytes

Contents

require 'fileutils'
require 'rbconfig'
require 'mkmf'

main_dir = File.expand_path(File.join(File.dirname(__FILE__),"..",".."))

# check for required programs
programs = ["R","Rscript","mongod","java","getconf"]
programs.each do |program|
  abort "Please install #{program} on your system." unless find_executable program
end

abort "Please install Rserve on your system. Execute 'install.packages('Rserve')' in a R console running as root ('sudo R')."  unless `R CMD Rserve --version`.match(/^Rserve/)

# install R packages
r_dir = File.join main_dir, "R"
FileUtils.mkdir_p r_dir
FileUtils.mkdir_p File.join(main_dir,"bin") # for Rserve binary
rinstall = File.expand_path(File.join(File.dirname(__FILE__),"rinstall.R"))
puts `Rscript --vanilla #{rinstall} #{r_dir}`

# create a fake Makefile
File.open(File.join(File.dirname(__FILE__),"Makefile"),"w+") do |makefile|
  makefile.puts "all:\n\ttrue\n\ninstall:\n\ttrue\n"
end

$makefile_created = true

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lazar-0.9.1 ext/lazar/extconf.rb
lazar-0.9.0 ext/lazar/extconf.rb
lazar-0.0.9 ext/lazar/extconf.rb