Sha256: df3c5f7beab4c0588a692e13935b24e17b17288e64cfe92ca2d4c42cd5f082a5

Contents?: true

Size: 1.46 KB

Versions: 2

Compression:

Stored size: 1.46 KB

Contents

require 'rbconfig'
require 'open-uri'
require 'fileutils'
include FileUtils::Verbose
require 'rake/clean'

URL = "http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2/download"

task :download do
  open(URL) do |uri|
    File.open("samtools-0.1.18.tar.bz2",'wb') do |fout|
      fout.write(uri.read)
    end #fout 
  end #uri
end
    
task :compile do
  sh "tar xvfj samtools-0.1.18.tar.bz2"
  cd("samtools-0.1.18") 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","/Users/macleand/bioruby-samtools/ext/../lib/bio/db/sam/external")
        #sh "CFLAGS='-g -Wall -O2 -fPIC' make -e libbam.so.1-local"
        sh "make libbam.so.1-local"
        cp("libbam.so.1","/Users/macleand/bioruby-samtools/ext/../lib/bio/db/sam/external")
      when /darwin/
        sh "make"
        cp("libbam.a","/Users/macleand/bioruby-samtools/ext/../lib/bio/db/sam/external")
        sh "make libbam.1.dylib-local"
        cp("libbam.1.dylib","/Users/macleand/bioruby-samtools/ext/../lib/bio/db/sam/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-0.1.18") do
    sh "make clean"
  end
  rm("samtools-0.1.18.tar.bz2")
  rm_rf("samtools-0.1.18")
end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bio-samtools-0.4.1 ext/Rakefile
bio-samtools-0.4.0 ext/Rakefile