Sha256: 573c7c6b7c39254f9aaa38f9ec0a575850b780de9664efad312e1f86adb15cb3

Contents?: true

Size: 1.73 KB

Versions: 3

Compression:

Stored size: 1.73 KB

Contents

#(c) Copyright 2011 Raoul Bonnal. All Rights Reserved. 

# create Rakefile for shared library compilation



path = File.expand_path(File.dirname(__FILE__))

path_external = File.join(path, "../lib/bio/db/sam/external")

version = File.open(File.join(path_external,"VERSION"),'r')
Version = version.read
version.close

url = "http://sourceforge.net/projects/samtools/files/samtools/#{Version}/samtools-#{Version}.tar.bz2/download"
SamToolsFile = "samtools-#{Version}.tar.bz2"

File.open(File.join(path,"Rakefile"),"w") do |rakefile|
rakefile.write <<-RAKE
require 'rbconfig'
require 'open-uri'
require 'fileutils'
include FileUtils::Verbose
require 'rake/clean'

URL = "#{url}"

task :download do
  open(URL) do |uri|
    File.open("#{SamToolsFile}",'wb') do |fout|
      fout.write(uri.read)
    end #fout 
  end #uri
end
    
task :compile do
  sh "tar xvfj #{SamToolsFile}"
  cd("samtools-#{Version}") do
    sh "patch < ../Makefile-bioruby.patch"
    case Config::CONFIG['host_os']
      when /linux/
        #sh "CFLAGS='-g -Wall -O2 -fPIC' make -e"
        sh "make"
        cp("libbam.a","#{path_external}")
        #sh "CFLAGS='-g -Wall -O2 -fPIC' make -e libbam.so.1-local"
        sh "make libbam.so.1-local"
        cp("libbam.so.1","#{path_external}")
      when /darwin/
        sh "make"
        cp("libbam.a","#{path_external}")
        sh "make libbam.1.dylib-local"
        cp("libbam.1.dylib","#{path_external}")      
      when /mswin|mingw/ then raise NotImplementedError, "BWA library is not available for Windows platform"  
    end #case
  end #cd
end
  
task :clean do
  cd("samtools-#{Version}") do
    sh "make clean"
  end
  rm("#{SamToolsFile}")
  rm_rf("samtools-#{Version}")
end

task :default => [:download, :compile, :clean]
  
RAKE
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bio-samtools-0.4.1 ext/mkrf_conf.rb
bio-samtools-0.4.0 ext/mkrf_conf.rb
bio-samtools-0.3.2 ext/mkrf_conf.rb