Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
26344df
commit a99652d
Showing
3 changed files
with
47 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,50 @@ | ||
require 'rbconfig' | ||
require 'open-uri' | ||
require 'open_uri_redirections' | ||
#require 'open_uri_redirections' | ||
require 'fileutils' | ||
include FileUtils::Verbose | ||
require 'rake/clean' | ||
|
||
URL = "http://sourceforge.net/projects/samtools/files/samtools/0.1.19/samtools-0.1.19.tar.bz2/download" | ||
|
||
URL = "https://github.com/samtools/samtools/releases/download/1.3.1/samtools-1.3.1.tar.bz2" | ||
URL_bcf = "https://github.com/samtools/bcftools/releases/download/1.3.1/bcftools-1.3.1.tar.bz2" | ||
task :download do | ||
open(URL, :allow_redirections => :all) do |uri| | ||
File.open("samtools-0.1.19.tar.bz2",'wb') do |fout| | ||
open(URL) do |uri| | ||
File.open("samtools-1.3.1.tar.bz2",'wb') do |fout| | ||
fout.write(uri.read) | ||
end #fout | ||
end #uri | ||
|
||
open(URL_bcf) do |uri| | ||
File.open("bcftools-1.3.1.tar.bz2",'wb') do |fout| | ||
fout.write(uri.read) | ||
end #fout | ||
end #uri | ||
|
||
end | ||
|
||
task :compile do | ||
sh "tar xvfj samtools-0.1.19.tar.bz2" | ||
cd("samtools-0.1.19") do | ||
sh "patch < ../Makefile-bioruby.patch" | ||
# This patch replace CURSES lib with NCURSES which it is the only one available in OpenSUSE | ||
sh "patch < ../Makefile-suse.patch" | ||
sh "tar xvfj samtools-1.3.1.tar.bz2" | ||
cd("samtools-1.3.1") do | ||
sh "make" | ||
cp('samtools', "/Users/ramirezr/Documents/public_code/git_merge/bioruby-samtools/ext/../lib/bio/db/sam/external") | ||
cp('samtools', "/Users/ramirezr/Documents/public_code/helios/bioruby-samtools/ext/../lib/bio/db/sam/external") | ||
end #cd | ||
cd("samtools-0.1.19/bcftools") do | ||
|
||
sh "tar xvfj bcftools-1.3.1.tar.bz2" | ||
cd("bcftools-1.3.1") do | ||
sh "make" | ||
cp('bcftools', "/Users/ramirezr/Documents/public_code/git_merge/bioruby-samtools/ext/../lib/bio/db/sam/external") | ||
end | ||
cp('bcftools', "/Users/ramirezr/Documents/public_code/helios/bioruby-samtools/ext/../lib/bio/db/sam/external") | ||
end #cd | ||
end | ||
|
||
task :clean do | ||
cd("samtools-0.1.19") do | ||
cd("samtools-1.3.1") do | ||
sh "make clean" | ||
end | ||
rm("samtools-0.1.19.tar.bz2") | ||
rm_rf("samtools-0.1.19") | ||
rm("samtools-1.3.1.tar.bz2") | ||
rm_rf("samtools-1.3.1") | ||
rm("bcftools-1.3.1.tar.bz2") | ||
rm_rf("bcftools-1.3.1") | ||
end | ||
|
||
task :default => [:download, :compile, :clean] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.19 | ||
1.3.1 |