summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sci-biology/samtools
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sci-biology/samtools')
-rw-r--r--sci-biology/samtools/Manifest5
-rw-r--r--sci-biology/samtools/files/samtools-0.1.19-buildsystem.patch183
-rw-r--r--sci-biology/samtools/files/samtools-1.0-buildsystem.patch59
-rw-r--r--sci-biology/samtools/files/samtools-1.1-buildsystem.patch153
-rw-r--r--sci-biology/samtools/files/samtools-1.2-buildsystem.patch193
-rw-r--r--sci-biology/samtools/metadata.xml8
-rw-r--r--sci-biology/samtools/samtools-0.1.12.ebuild31
-rw-r--r--sci-biology/samtools/samtools-0.1.19-r2.ebuild61
-rw-r--r--sci-biology/samtools/samtools-1.0-r1.ebuild73
-rw-r--r--sci-biology/samtools/samtools-1.0.ebuild69
-rw-r--r--sci-biology/samtools/samtools-1.1.ebuild83
-rw-r--r--sci-biology/samtools/samtools-1.2.ebuild83
12 files changed, 1001 insertions, 0 deletions
diff --git a/sci-biology/samtools/Manifest b/sci-biology/samtools/Manifest
new file mode 100644
index 000000000000..8178b5d5369f
--- /dev/null
+++ b/sci-biology/samtools/Manifest
@@ -0,0 +1,5 @@
+DIST samtools-0.1.12a.tar.bz2 355633 SHA256 377ed5cd2a4bb2b1ad572ca6fcafdd8ed644b67f01ab00fa020618fac11e59ac
+DIST samtools-0.1.19.tar.bz2 514507 SHA256 d080c9d356e5f0ad334007e4461cbcee3c4ca97b8a7a5a48c44883cf9dee63d4 SHA512 d145f1d65eefefbdfb781945684b8b591419fb109ac7401a62cae65b9ca1e1271f001496e1038334ff9ab1c0e5bf9bcc059f70aaa273551193fbd68101fd188d WHIRLPOOL 7811388ae8b24c5d7a328d2da252b8d3afaefdab508bd97684d556d2d4ee60d9c8846ffa562beaa9d0c6a5e6bfac24fcd9d211dfee20383cf452609badc8ecd5
+DIST samtools-1.0.tar.bz2 4459669 SHA256 7340b843663c3f54a902a06f2f73c68198f3a62d29a2ed20671139957f7fd7c0 SHA512 5b80995c522d08b06a4c559f60a5e200d9085be7f44c3c9618db91e3de85e36c1473e42715eae8175520d7da3df8245bafa82e625d2fc08e0197adb395851693 WHIRLPOOL 2aa0f8639da9b0b828ca7296969e5c600b0e5452ad3231b914e4a7be418700906a4d695c928eaf837b643255567ec82cfadf0b53007e0f1e3a956856f6c4c832
+DIST samtools-1.1.tar.bz2 4495373 SHA256 c24d26c303153d72b5bf3cc11f72c6c375a4ca1140cc485648c8c5473414b7f8 SHA512 a5552a6c8c4b0808b725b39ddb2fafa36c4f6623bfc7f84faadae7690223e4eec8d722af09c77145796ad9b3f01e04115dd0207207ccfafbb52ffc22d5fc09f0 WHIRLPOOL ed3131b2a8d8b4dab40b53d35a9b00b657670a949dc1597c91fbcd00392c1c1715a85a1d1e49bf0c73ae082738ccfb13d2c6809dbbeba17ff3028f6023ebc449
+DIST samtools-1.2.tar.bz2 4547126 SHA256 420e7a4a107fe37619b9d300b6379452eb8eb04a4a9b65c3ec69de82ccc26daa SHA512 4849c3274e732267516b63799f5430c5415d575d46eddf6b704dac51053281094b03b90dd9f5367bcd14c22fb0fb1bd6a412f7d4225f7be5f5385437c5d2101d WHIRLPOOL 273185764a807365a20c381769f987ef02d14ae8e20a3a7fd5af4344769c5fab68d7155523e8c0c8c3cc86092898c2c8454cce8f1560d415bc2b41549cdf04f4
diff --git a/sci-biology/samtools/files/samtools-0.1.19-buildsystem.patch b/sci-biology/samtools/files/samtools-0.1.19-buildsystem.patch
new file mode 100644
index 000000000000..d5ff3bd45da5
--- /dev/null
+++ b/sci-biology/samtools/files/samtools-0.1.19-buildsystem.patch
@@ -0,0 +1,183 @@
+ Makefile | 22 +++++++++++-----------
+ bcftools/Makefile | 12 ++++++------
+ misc/Makefile | 28 ++++++++++++++--------------
+ 3 files changed, 31 insertions(+), 31 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 2f51bfc..4dda5a4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+-CC= gcc
+-CFLAGS= -g -Wall -O2
+-#LDFLAGS= -Wl,-rpath,\$$ORIGIN/../lib
+-DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1
++CC?= gcc
++CFLAGS?= -g -Wall -O2
++#LDFLAGS+= -Wl,-rpath,\$$ORIGIN/../lib
++CPPFLAGS+= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1
+ KNETFILE_O= knetfile.o
+ LOBJS= bgzf.o kstring.o bam_aux.o bam.o bam_import.o sam.o bam_index.o \
+ bam_pileup.o bam_lpileup.o bam_md.o razf.o faidx.o bedidx.o \
+@@ -21,14 +21,14 @@ LIBCURSES= -lcurses # -lXCurses
+ .PHONY: all lib
+
+ .c.o:
+- $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@
+
+ all-recur lib-recur clean-recur cleanlocal-recur install-recur:
+ @target=`echo $@ | sed s/-recur//`; \
+ wdir=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ cd $$subdir; \
+- $(MAKE) CC="$(CC)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \
++ $(MAKE) CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
+ INCLUDES="$(INCLUDES)" LIBPATH="$(LIBPATH)" $$target || exit 1; \
+ cd $$wdir; \
+ done;
+@@ -44,16 +44,16 @@ libbam.a:$(LOBJS)
+ $(AR) -csru $@ $(LOBJS)
+
+ samtools:lib-recur $(AOBJS)
+- $(CC) $(CFLAGS) -o $@ $(AOBJS) $(LDFLAGS) libbam.a -Lbcftools -lbcf $(LIBPATH) $(LIBCURSES) -lm -lz -lpthread
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(AOBJS) libbam.a -Lbcftools -lbcf $(LIBPATH) $(LIBCURSES) -lm -lz -lpthread
+
+ razip:razip.o razf.o $(KNETFILE_O)
+- $(CC) $(CFLAGS) -o $@ $^ -lz
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lz
+
+ bgzip:bgzip.o bgzf.o $(KNETFILE_O)
+- $(CC) $(CFLAGS) -o $@ $^ -lz -lpthread
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lz -lpthread
+
+ bgzf.o:bgzf.c bgzf.h
+- $(CC) -c $(CFLAGS) $(DFLAGS) -DBGZF_CACHE $(INCLUDES) bgzf.c -o $@
++ $(CC) -c $(CFLAGS) $(CPPFLAGS) -DBGZF_CACHE $(INCLUDES) bgzf.c -o $@
+
+ razip.o:razf.h
+ bam.o:bam.h razf.h bam_endian.h kstring.h sam_header.h
+@@ -84,7 +84,7 @@ libbam.1.dylib-local:$(LOBJS)
+ libtool -dynamic $(LOBJS) -o libbam.1.dylib -lc -lz
+
+ libbam.so.1-local:$(LOBJS)
+- $(CC) -shared -Wl,-soname,libbam.so -o libbam.so.1 $(LOBJS) -lc -lz
++ $(CC) $(LDFLAGS) -shared -Wl,-soname,libbam.so -o libbam.so.1 $(LOBJS) -lc -lz -lm -lpthread
+
+ dylib:
+ @$(MAKE) cleanlocal; \
+diff --git a/bcftools/Makefile b/bcftools/Makefile
+index be831de..7ef796c 100644
+--- a/bcftools/Makefile
++++ b/bcftools/Makefile
+@@ -1,6 +1,6 @@
+-CC= gcc
+-CFLAGS= -g -Wall -O2 #-m64 #-arch ppc
+-DFLAGS= -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE
++CC?= gcc
++CFLAGS?= -g -Wall -O2 #-m64 #-arch ppc
++CPPFLAGS+= -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE
+ LOBJS= bcf.o vcf.o bcfutils.o prob1.o em.o kfunc.o kmin.o index.o fet.o mut.o bcf2qcall.o
+ OMISC= ..
+ AOBJS= call1.o main.o $(OMISC)/kstring.o $(OMISC)/bgzf.o $(OMISC)/knetfile.o $(OMISC)/bedidx.o
+@@ -11,14 +11,14 @@ SUBDIRS= .
+ .SUFFIXES:.c .o
+
+ .c.o:
+- $(CC) -c $(CFLAGS) $(DFLAGS) -I.. $(INCLUDES) $< -o $@
++ $(CC) -c $(CFLAGS) $(CPPFLAGS) -I.. $(INCLUDES) $< -o $@
+
+ all-recur lib-recur clean-recur cleanlocal-recur install-recur:
+ @target=`echo $@ | sed s/-recur//`; \
+ wdir=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ cd $$subdir; \
+- $(MAKE) CC="$(CC)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \
++ $(MAKE) CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
+ INCLUDES="$(INCLUDES)" LIBPATH="$(LIBPATH)" $$target || exit 1; \
+ cd $$wdir; \
+ done;
+@@ -31,7 +31,7 @@ libbcf.a:$(LOBJS)
+ $(AR) -csru $@ $(LOBJS)
+
+ bcftools:lib $(AOBJS)
+- $(CC) $(CFLAGS) -o $@ $(AOBJS) -L. $(LIBPATH) -lbcf -lm -lz -lpthread
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(AOBJS) -L. $(LIBPATH) -lbcf -lm -lz -lpthread
+
+ bcf.o:bcf.h
+ vcf.o:bcf.h
+diff --git a/misc/Makefile b/misc/Makefile
+index d36e7ac..7ae1dc3 100644
+--- a/misc/Makefile
++++ b/misc/Makefile
+@@ -1,8 +1,8 @@
+-CC= gcc
+-CXX= g++
+-CFLAGS= -g -Wall -O2 #-m64 #-arch ppc
+-CXXFLAGS= $(CFLAGS)
+-DFLAGS= -D_FILE_OFFSET_BITS=64
++CC?= gcc
++CXX?= g++
++CFLAGS?= -g -Wall -O2 #-m64 #-arch ppc
++CXXFLAGS?= $(CFLAGS)
++CPPFLAGS+= -D_FILE_OFFSET_BITS=64
+ OBJS=
+ PROG= md5sum-lite md5fa maq2sam-short maq2sam-long ace2sam wgsim bamcheck
+ INCLUDES= -I..
+@@ -11,7 +11,7 @@ SUBDIRS= .
+ .SUFFIXES:.c .o
+
+ .c.o:
+- $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@
+
+ all:$(PROG)
+
+@@ -20,7 +20,7 @@ lib-recur all-recur clean-recur cleanlocal-recur install-recur:
+ wdir=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ cd $$subdir; \
+- $(MAKE) CC="$(CC)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \
++ $(MAKE) CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
+ INCLUDES="$(INCLUDES)" $$target || exit 1; \
+ cd $$wdir; \
+ done;
+@@ -28,31 +28,31 @@ lib-recur all-recur clean-recur cleanlocal-recur install-recur:
+ lib:
+
+ bamcheck:bamcheck.o
+- $(CC) $(CFLAGS) -o $@ bamcheck.o -L.. -lm -lbam -lpthread -lz
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ bamcheck.o -L.. -lm -lbam -lpthread -lz
+
+ bamcheck.o:bamcheck.c ../faidx.h ../khash.h ../sam.h ../razf.h
+ $(CC) $(CFLAGS) -c -I.. -o $@ bamcheck.c
+
+ ace2sam:ace2sam.o
+- $(CC) $(CFLAGS) -o $@ ace2sam.o -lz
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ ace2sam.o -lz
+
+ wgsim:wgsim.o
+- $(CC) $(CFLAGS) -o $@ wgsim.o -lm -lz
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wgsim.o -lm -lz
+
+ md5fa:md5.o md5fa.o md5.h ../kseq.h
+- $(CC) $(CFLAGS) -o $@ md5.o md5fa.o -lz
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ md5.o md5fa.o -lz
+
+ md5sum-lite:md5sum-lite.o
+- $(CC) $(CFLAGS) -o $@ md5sum-lite.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ md5sum-lite.o
+
+ md5sum-lite.o:md5.c md5.h
+ $(CC) -c $(CFLAGS) -DMD5SUM_MAIN -o $@ md5.c
+
+ maq2sam-short:maq2sam.c
+- $(CC) $(CFLAGS) -o $@ maq2sam.c -lz
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ maq2sam.c -lz
+
+ maq2sam-long:maq2sam.c
+- $(CC) $(CFLAGS) -DMAQ_LONGREADS -o $@ maq2sam.c -lz
++ $(CC) $(CFLAGS) -DMAQ_LONGREADS $(LDFLAGS) -o $@ maq2sam.c -lz
+
+ md5fa.o:md5.h md5fa.c
+ $(CC) $(CFLAGS) -c -I.. -o $@ md5fa.c
diff --git a/sci-biology/samtools/files/samtools-1.0-buildsystem.patch b/sci-biology/samtools/files/samtools-1.0-buildsystem.patch
new file mode 100644
index 000000000000..53a8b66f918f
--- /dev/null
+++ b/sci-biology/samtools/files/samtools-1.0-buildsystem.patch
@@ -0,0 +1,59 @@
+ Makefile | 26 ++++++++++++++++++--------
+ 1 file changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index ae59abf..0d2788c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -21,11 +21,12 @@
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ # DEALINGS IN THE SOFTWARE.
+
+-CC = gcc
+-CPPFLAGS = $(DFLAGS) $(INCLUDES)
+-CFLAGS = -g -Wall -O2
+-LDFLAGS =
+-LDLIBS =
++CC ?= gcc
++CPPFLAGS += $(DFLAGS) $(INCLUDES)
++CFLAGS ?= -g -Wall -O2
++LDFLAGS +=
++LDLIBS +=
++BAMLIB ?= libbam.a
+ DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1
+ LOBJS= bam_aux.o bam.o bam_import.o sam.o \
+ sam_header.o bam_plbuf.o
+@@ -42,6 +43,7 @@ LIBCURSES= -lcurses # -lXCurses
+ prefix = /usr/local
+ exec_prefix = $(prefix)
+ bindir = $(exec_prefix)/bin
++bindir = $(exec_prefix)/lib
+ mandir = $(prefix)/share/man
+ man1dir = $(mandir)/man1
+
+@@ -115,14 +117,22 @@ version.h:
+ .c.o:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
++$(LOBJS):
++ $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
+
+-lib:libbam.a
++
++lib:libbam.a libbam.so.1.0
+
+ libbam.a:$(LOBJS)
+ $(AR) -csru $@ $(LOBJS)
+
+-samtools: $(AOBJS) libbam.a $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) libbam.a $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
++libbam.so.1.0:$(LOBJS)
++ $(CC) $(LDFLAGS) -shared -Wl,--soname,$@ -o $@ $(LOBJS) $(HTSLIB) -lz
++ ln -sf $@ libbam.so.0
++ ln -sf $@ libbam.so
++
++samtools: $(AOBJS) $(HTSLIB) lib
++ $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) $(BAMLIB) $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
+
+ bam_h = bam.h $(htslib_bgzf_h) $(htslib_sam_h)
+ bam2bcf_h = bam2bcf.h $(htslib_vcf_h) errmod.h
diff --git a/sci-biology/samtools/files/samtools-1.1-buildsystem.patch b/sci-biology/samtools/files/samtools-1.1-buildsystem.patch
new file mode 100644
index 000000000000..b9ae77de67d2
--- /dev/null
+++ b/sci-biology/samtools/files/samtools-1.1-buildsystem.patch
@@ -0,0 +1,153 @@
+ Makefile | 76 ++++++++++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 43 insertions(+), 33 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 43cefc3..743dd07 100644
+--- a/Makefile
++++ b/Makefile
+@@ -21,11 +21,12 @@
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ # DEALINGS IN THE SOFTWARE.
+
+-CC = gcc
+-CPPFLAGS = $(DFLAGS) $(INCLUDES)
+-CFLAGS = -g -Wall -O2
+-LDFLAGS =
+-LDLIBS =
++CC ?= gcc
++CPPFLAGS += $(DFLAGS) $(INCLUDES)
++CFLAGS ?= -g -Wall -O2
++LDFLAGS +=
++LDLIBS +=
++BAMLIB ?= libbam.a
+ DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1
+ LOBJS= bam_aux.o bam.o bam_import.o sam.o \
+ sam_header.o bam_plbuf.o
+@@ -42,6 +43,7 @@ LIBCURSES= -lcurses # -lXCurses
+ prefix = /usr/local
+ exec_prefix = $(prefix)
+ bindir = $(exec_prefix)/bin
++libdir = $(exec_prefix)/lib
+ mandir = $(prefix)/share/man
+ man1dir = $(mandir)/man1
+
+@@ -115,63 +117,71 @@ version.h:
+ .c.o:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
++$(LOBJS):
++ $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
+
+-lib:libbam.a
++
++lib:libbam.a libbam.so.1.0
+
+ libbam.a:$(LOBJS)
+ $(AR) -csru $@ $(LOBJS)
+
+-samtools: $(AOBJS) libbam.a $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) libbam.a $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
++libbam.so.1.0:$(LOBJS)
++ $(CC) $(LDFLAGS) -shared -Wl,--soname,$@ -o $@ $(LOBJS) $(HTSLIB) -lz
++ ln -sf $@ libbam.so.0
++ ln -sf $@ libbam.so
++
++samtools: $(AOBJS) lib
++ $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) $(BAMLIB) $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
+
+ bam_h = bam.h $(htslib_bgzf_h) $(htslib_sam_h)
+ bam2bcf_h = bam2bcf.h $(htslib_vcf_h) errmod.h
+ bam_lpileup_h = bam_lpileup.h $(htslib_sam_h)
+ bam_plbuf_h = bam_plbuf.h $(htslib_sam_h)
+-bam_tview_h = bam_tview.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(bam2bcf_h) $(HTSDIR)/htslib/khash.h $(bam_lpileup_h)
++bam_tview_h = bam_tview.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(bam2bcf_h) $(bam_lpileup_h)
+ sam_h = sam.h $(htslib_sam_h) $(bam_h)
+-sample_h = sample.h $(HTSDIR)/htslib/kstring.h
++sample_h = sample.h
+
+ bam.o: bam.c $(bam_h) sam_header.h
+-bam2bcf.o: bam2bcf.c $(htslib_sam_h) $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/kfunc.h $(bam2bcf_h) errmod.h
++bam2bcf.o: bam2bcf.c $(htslib_sam_h) $(bam2bcf_h) errmod.h
+ bam2bcf_indel.o: bam2bcf_indel.c bam2bcf.h
+ bam2depth.o: bam2depth.c $(htslib_sam_h) samtools.h
+ bam_aux.o: bam_aux.c
+ bam_cat.o: bam_cat.c $(htslib_bgzf_h) $(bam_h)
+ bam_color.o: bam_color.c $(bam_h)
+-bam_import.o: bam_import.c $(HTSDIR)/htslib/kstring.h $(bam_h) $(HTSDIR)/htslib/kseq.h
+-bam_index.o: bam_index.c $(htslib_hts_h) $(htslib_sam_h) $(HTSDIR)/htslib/khash.h
+-bam_lpileup.o: bam_lpileup.c $(bam_plbuf_h) $(bam_lpileup_h) $(HTSDIR)/htslib/ksort.h
++bam_import.o: bam_import.c $(bam_h)
++bam_index.o: bam_index.c $(htslib_hts_h) $(htslib_sam_h)
++bam_lpileup.o: bam_lpileup.c $(bam_plbuf_h) $(bam_lpileup_h)
+ bam_mate.o: bam_mate.c $(bam_h)
+ bam_md.o: bam_md.c $(htslib_faidx_h) $(sam_h) kaln.h kprobaln.h
+ bam_pileup.o: bam_pileup.c $(sam_h)
+ bam_plbuf.o: bam_plbuf.c $(htslib_hts_h) $(htslib_sam_h) $(bam_plbuf_h)
+-bam_plcmd.o: bam_plcmd.c $(htslib_sam_h) $(htslib_faidx_h) $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/khash_str2int.h sam_header.h samtools.h $(bam2bcf_h) $(sample_h)
++bam_plcmd.o: bam_plcmd.c $(htslib_sam_h) $(htslib_faidx_h) sam_header.h samtools.h $(bam2bcf_h) $(sample_h)
+ bam_reheader.o: bam_reheader.c $(htslib_bgzf_h) $(bam_h)
+-bam_rmdup.o: bam_rmdup.c $(sam_h) $(HTSDIR)/htslib/khash.h
+-bam_rmdupse.o: bam_rmdupse.c $(sam_h) $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/klist.h
+-bam_sort.o: bam_sort.c $(HTSDIR)/htslib/ksort.h $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/klist.h $(HTSDIR)/htslib/kstring.h $(htslib_sam_h)
++bam_rmdup.o: bam_rmdup.c $(sam_h)
++bam_rmdupse.o: bam_rmdupse.c $(sam_h)
++bam_sort.o: bam_sort.c $(htslib_sam_h)
+ bam_stat.o: bam_stat.c $(bam_h) samtools.h
+ bam_tview.o: bam_tview.c $(bam_tview_h) $(htslib_faidx_h) $(htslib_sam_h) $(htslib_bgzf_h)
+ bam_tview_curses.o: bam_tview_curses.c $(bam_tview_h)
+ bam_tview_html.o: bam_tview_html.c $(bam_tview_h)
+ bam_flags.o: bam_flags.c $(sam_h)
+-bamshuf.o: bamshuf.c $(htslib_sam_h) $(HTSDIR)/htslib/ksort.h samtools.h
++bamshuf.o: bamshuf.c $(htslib_sam_h) samtools.h
+ bamtk.o: bamtk.c $(bam_h) version.h samtools.h
+-bedcov.o: bedcov.c $(HTSDIR)/htslib/kstring.h $(htslib_sam_h) $(HTSDIR)/htslib/kseq.h
+-bedidx.o: bedidx.c $(HTSDIR)/htslib/ksort.h $(HTSDIR)/htslib/kseq.h $(HTSDIR)/htslib/khash.h
++bedcov.o: bedcov.c $(htslib_sam_h)
++bedidx.o: bedidx.c
+ cut_target.o: cut_target.c $(bam_h) errmod.h $(htslib_faidx_h)
+-errmod.o: errmod.c errmod.h $(HTSDIR)/htslib/ksort.h
++errmod.o: errmod.c errmod.h
+ kaln.o: kaln.c kaln.h
+ kprobaln.o: kprobaln.c kprobaln.h
+ padding.o: padding.c sam_header.h $(sam_h) $(bam_h) $(htslib_faidx_h)
+-phase.o: phase.c $(htslib_sam_h) errmod.h $(HTSDIR)/htslib/kseq.h $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/ksort.h
++phase.o: phase.c $(htslib_sam_h) errmod.h
+ sam.o: sam.c $(htslib_faidx_h) $(sam_h)
+-sam_header.o: sam_header.c sam_header.h $(HTSDIR)/htslib/khash.h
+-sam_view.o: sam_view.c $(htslib_sam_h) $(htslib_faidx_h) $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/khash.h samtools.h
+-sample.o: sample.c $(sample_h) $(HTSDIR)/htslib/khash.h
+-stats_isize.o: stats_isize.c stats_isize.h $(HTSDIR)/htslib/khash.h
+-stats.o: stats.c $(sam_h) sam_header.h samtools.h stats_isize.h $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/khash_str2int.h $(htslib_faidx_h)
++sam_header.o: sam_header.c sam_header.h
++sam_view.o: sam_view.c $(htslib_sam_h) $(htslib_faidx_h) samtools.h
++sample.o: sample.c $(sample_h)
++stats_isize.o: stats_isize.c stats_isize.h
++stats.o: stats.c $(sam_h) sam_header.h samtools.h stats_isize.h $(htslib_faidx_h)
+
+
+ # test programs
+@@ -179,8 +189,8 @@ stats.o: stats.c $(sam_h) sam_header.h samtools.h stats_isize.h $(HTSDIR)/htslib
+ # For tests that might use it, set $REF_PATH explicitly to use only reference
+ # areas within the test suite (or set it to ':' to use no reference areas).
+ # (regression.sh sets $REF_PATH to a subdirectory itself.)
+-check test: samtools $(BGZIP) $(BUILT_TEST_PROGRAMS)
+- REF_PATH=: test/test.pl --exec bgzip=$(BGZIP)
++check test: samtools $(BUILT_TEST_PROGRAMS)
++ REF_PATH=: test/test.pl --exec bgzip=bgzip
+ test/merge/test_bam_translate test/merge/test_bam_translate.tmp
+ test/merge/test_pretty_header
+ test/merge/test_rtrans_build
+@@ -253,10 +263,10 @@ misc/md5sum-lite: misc/md5sum-lite.o
+ misc/wgsim: misc/wgsim.o
+ $(CC) $(LDFLAGS) -o $@ misc/wgsim.o $(LDLIBS) -lm -lz
+
+-misc/ace2sam.o: misc/ace2sam.c $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/kseq.h
++misc/ace2sam.o: misc/ace2sam.c
+ misc/md5.o: misc/md5.c misc/md5.h
+-misc/md5fa.o: misc/md5fa.c misc/md5.h $(HTSDIR)/htslib/kseq.h
+-misc/wgsim.o: misc/wgsim.c $(HTSDIR)/htslib/kseq.h
++misc/md5fa.o: misc/md5fa.c misc/md5.h
++misc/wgsim.o: misc/wgsim.c
+
+ misc/maq2sam-short.o: misc/maq2sam.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ misc/maq2sam.c
diff --git a/sci-biology/samtools/files/samtools-1.2-buildsystem.patch b/sci-biology/samtools/files/samtools-1.2-buildsystem.patch
new file mode 100644
index 000000000000..2343b2245a29
--- /dev/null
+++ b/sci-biology/samtools/files/samtools-1.2-buildsystem.patch
@@ -0,0 +1,193 @@
+ Makefile | 94 +++++++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 52 insertions(+), 42 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e368cee..9054526 100644
+--- a/Makefile
++++ b/Makefile
+@@ -21,11 +21,12 @@
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ # DEALINGS IN THE SOFTWARE.
+
+-CC = gcc
+-CPPFLAGS = $(DFLAGS) $(INCLUDES)
+-CFLAGS = -g -Wall -O2
+-LDFLAGS =
+-LDLIBS =
++CC ?= gcc
++CPPFLAGS += $(DFLAGS) $(INCLUDES)
++CFLAGS ?= -g -Wall -O2
++LDFLAGS +=
++LDLIBS +=
++BAMLIB ?= libbam.a
+ DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1
+ LOBJS= bam_aux.o bam.o bam_import.o sam.o \
+ sam_header.o bam_plbuf.o
+@@ -42,6 +43,7 @@ LIBCURSES= -lcurses # -lXCurses
+ prefix = /usr/local
+ exec_prefix = $(prefix)
+ bindir = $(exec_prefix)/bin
++libdir = $(exec_prefix)/lib
+ mandir = $(prefix)/share/man
+ man1dir = $(mandir)/man1
+
+@@ -115,62 +117,70 @@ version.h:
+ .c.o:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
++$(LOBJS):
++ $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
+
+-lib:libbam.a
++
++lib:libbam.a libbam.so.1.0
+
+ libbam.a:$(LOBJS)
+ $(AR) -csru $@ $(LOBJS)
+
+-samtools: $(AOBJS) libbam.a $(HTSLIB)
+- $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) libbam.a $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
++libbam.so.1.0:$(LOBJS)
++ $(CC) $(LDFLAGS) -shared -Wl,--soname,$@ -o $@ $(LOBJS) $(HTSLIB) -lz
++ ln -sf $@ libbam.so.0
++ ln -sf $@ libbam.so
++
++samtools: $(AOBJS) lib
++ $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) $(BAMLIB) $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
+
+ bam_h = bam.h $(htslib_bgzf_h) $(htslib_sam_h)
+ bam2bcf_h = bam2bcf.h $(htslib_vcf_h) errmod.h
+ bam_lpileup_h = bam_lpileup.h $(htslib_sam_h)
+ bam_plbuf_h = bam_plbuf.h $(htslib_sam_h)
+-bam_tview_h = bam_tview.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(bam2bcf_h) $(HTSDIR)/htslib/khash.h $(bam_lpileup_h)
++bam_tview_h = bam_tview.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(bam2bcf_h) $(bam_lpileup_h)
+ sam_h = sam.h $(htslib_sam_h) $(bam_h)
+-sample_h = sample.h $(HTSDIR)/htslib/kstring.h
++sample_h = sample.h
+
+ bam.o: bam.c $(bam_h) sam_header.h
+-bam2bcf.o: bam2bcf.c $(htslib_sam_h) $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/kfunc.h $(bam2bcf_h) errmod.h
++bam2bcf.o: bam2bcf.c $(htslib_sam_h) $(bam2bcf_h) errmod.h
+ bam2bcf_indel.o: bam2bcf_indel.c $(htslib_sam_h) $(bam2bcf_h) kprobaln.h $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/ksort.h
+ bam2depth.o: bam2depth.c $(htslib_sam_h) samtools.h
+ bam_aux.o: bam_aux.c
+ bam_cat.o: bam_cat.c $(htslib_bgzf_h) $(bam_h)
+ bam_color.o: bam_color.c $(bam_h)
+-bam_import.o: bam_import.c $(HTSDIR)/htslib/kstring.h $(bam_h) $(HTSDIR)/htslib/kseq.h
+-bam_index.o: bam_index.c $(htslib_hts_h) $(htslib_sam_h) $(HTSDIR)/htslib/khash.h
+-bam_lpileup.o: bam_lpileup.c $(bam_plbuf_h) $(bam_lpileup_h) $(HTSDIR)/htslib/ksort.h
++bam_import.o: bam_import.c $(bam_h)
++bam_index.o: bam_index.c $(htslib_hts_h) $(htslib_sam_h)
++bam_lpileup.o: bam_lpileup.c $(bam_plbuf_h) $(bam_lpileup_h)
+ bam_mate.o: bam_mate.c $(bam_h)
+ bam_md.o: bam_md.c $(htslib_faidx_h) $(sam_h) kprobaln.h
+ bam_pileup.o: bam_pileup.c $(sam_h)
+ bam_plbuf.o: bam_plbuf.c $(htslib_hts_h) $(htslib_sam_h) $(bam_plbuf_h)
+-bam_plcmd.o: bam_plcmd.c $(htslib_sam_h) $(htslib_faidx_h) $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/khash_str2int.h sam_header.h samtools.h $(bam2bcf_h) $(sample_h)
++bam_plcmd.o: bam_plcmd.c $(htslib_sam_h) $(htslib_faidx_h) sam_header.h samtools.h $(bam2bcf_h) $(sample_h)
+ bam_reheader.o: bam_reheader.c $(htslib_bgzf_h) $(bam_h)
+-bam_rmdup.o: bam_rmdup.c $(sam_h) $(HTSDIR)/htslib/khash.h
+-bam_rmdupse.o: bam_rmdupse.c $(sam_h) $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/klist.h
+-bam_sort.o: bam_sort.c $(HTSDIR)/htslib/ksort.h $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/klist.h $(HTSDIR)/htslib/kstring.h $(htslib_sam_h)
++bam_rmdup.o: bam_rmdup.c $(sam_h)
++bam_rmdupse.o: bam_rmdupse.c $(sam_h)
++bam_sort.o: bam_sort.c $(htslib_sam_h)
+ bam_stat.o: bam_stat.c $(bam_h) samtools.h
+ bam_tview.o: bam_tview.c $(bam_tview_h) $(htslib_faidx_h) $(htslib_sam_h) $(htslib_bgzf_h)
+ bam_tview_curses.o: bam_tview_curses.c $(bam_tview_h)
+ bam_tview_html.o: bam_tview_html.c $(bam_tview_h)
+ bam_flags.o: bam_flags.c $(sam_h)
+-bamshuf.o: bamshuf.c $(htslib_sam_h) $(HTSDIR)/htslib/ksort.h samtools.h
++bamshuf.o: bamshuf.c $(htslib_sam_h) samtools.h
+ bamtk.o: bamtk.c $(htslib_hts_h) version.h samtools.h
+-bedcov.o: bedcov.c $(HTSDIR)/htslib/kstring.h $(htslib_sam_h) $(HTSDIR)/htslib/kseq.h
+-bedidx.o: bedidx.c $(HTSDIR)/htslib/ksort.h $(HTSDIR)/htslib/kseq.h $(HTSDIR)/htslib/khash.h
++bedcov.o: bedcov.c $(htslib_sam_h)
++bedidx.o: bedidx.c
+ cut_target.o: cut_target.c $(bam_h) errmod.h $(htslib_faidx_h)
+-errmod.o: errmod.c errmod.h $(HTSDIR)/htslib/ksort.h
++errmod.o: errmod.c errmod.h
+ kprobaln.o: kprobaln.c kprobaln.h
+ padding.o: padding.c sam_header.h $(sam_h) $(bam_h) $(htslib_faidx_h)
+-phase.o: phase.c $(htslib_sam_h) errmod.h $(HTSDIR)/htslib/kseq.h $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/ksort.h
++phase.o: phase.c $(htslib_sam_h) errmod.h
+ sam.o: sam.c $(htslib_faidx_h) $(sam_h)
+-sam_header.o: sam_header.c sam_header.h $(HTSDIR)/htslib/khash.h
+-sam_view.o: sam_view.c $(htslib_sam_h) $(htslib_faidx_h) $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/khash.h samtools.h
+-sample.o: sample.c $(sample_h) $(HTSDIR)/htslib/khash.h
+-stats_isize.o: stats_isize.c stats_isize.h $(HTSDIR)/htslib/khash.h
+-stats.o: stats.c $(sam_h) sam_header.h samtools.h stats_isize.h $(HTSDIR)/htslib/khash.h $(HTSDIR)/htslib/khash_str2int.h $(htslib_faidx_h)
++sam_header.o: sam_header.c sam_header.h
++sam_view.o: sam_view.c $(htslib_sam_h) $(htslib_faidx_h) samtools.h
++sample.o: sample.c $(sample_h)
++stats_isize.o: stats_isize.c stats_isize.h
++stats.o: stats.c $(sam_h) sam_header.h samtools.h stats_isize.h $(htslib_faidx_h)
+
+
+ # test programs
+@@ -178,8 +188,8 @@ stats.o: stats.c $(sam_h) sam_header.h samtools.h stats_isize.h $(HTSDIR)/htslib
+ # For tests that might use it, set $REF_PATH explicitly to use only reference
+ # areas within the test suite (or set it to ':' to use no reference areas).
+ # (regression.sh sets $REF_PATH to a subdirectory itself.)
+-check test: samtools $(BGZIP) $(BUILT_TEST_PROGRAMS)
+- REF_PATH=: test/test.pl --exec bgzip=$(BGZIP)
++check test: samtools $(BUILT_TEST_PROGRAMS)
++ REF_PATH=: test/test.pl --exec bgzip=bgzip
+ test/merge/test_bam_translate test/merge/test_bam_translate.tmp
+ test/merge/test_pretty_header
+ test/merge/test_rtrans_build
+@@ -191,31 +201,31 @@ check test: samtools $(BGZIP) $(BUILT_TEST_PROGRAMS)
+ test/split/test_parse_args
+
+
+-test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o $(HTSLIB)
++test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_bam_translate.o test/test.o $(HTSLIB) $(LDLIBS) -lz
+
+-test/merge/test_pretty_header: test/merge/test_pretty_header.o $(HTSLIB)
++test/merge/test_pretty_header: test/merge/test_pretty_header.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_pretty_header.o $(HTSLIB) $(LDLIBS) -lz
+
+-test/merge/test_rtrans_build: test/merge/test_rtrans_build.o $(HTSLIB)
++test/merge/test_rtrans_build: test/merge/test_rtrans_build.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_rtrans_build.o $(HTSLIB) $(LDLIBS) -lz
+
+-test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o $(HTSLIB)
++test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/merge/test_trans_tbl_init.o $(HTSLIB) $(LDLIBS) -lz
+
+-test/split/test_count_rg: test/split/test_count_rg.o test/test.o $(HTSLIB)
++test/split/test_count_rg: test/split/test_count_rg.o test/test.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_count_rg.o test/test.o $(HTSLIB) $(LDLIBS) -lz
+
+-test/split/test_expand_format_string: test/split/test_expand_format_string.o test/test.o $(HTSLIB)
++test/split/test_expand_format_string: test/split/test_expand_format_string.o test/test.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_expand_format_string.o test/test.o $(HTSLIB) $(LDLIBS) -lz
+
+-test/split/test_filter_header_rg: test/split/test_filter_header_rg.o test/test.o $(HTSLIB)
++test/split/test_filter_header_rg: test/split/test_filter_header_rg.o test/test.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_filter_header_rg.o test/test.o $(HTSLIB) $(LDLIBS) -lz
+
+-test/split/test_parse_args: test/split/test_parse_args.o test/test.o $(HTSLIB)
++test/split/test_parse_args: test/split/test_parse_args.o test/test.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/split/test_parse_args.o test/test.o $(HTSLIB) $(LDLIBS) -lz
+
+-test/vcf-miniview: test/vcf-miniview.o $(HTSLIB)
++test/vcf-miniview: test/vcf-miniview.o
+ $(CC) -pthread $(LDFLAGS) -o $@ test/vcf-miniview.o $(HTSLIB) $(LDLIBS) -lz
+
+ test_test_h = test/test.h $(htslib_sam_h)
+@@ -252,10 +262,10 @@ misc/md5sum-lite: misc/md5sum-lite.o
+ misc/wgsim: misc/wgsim.o
+ $(CC) $(LDFLAGS) -o $@ misc/wgsim.o $(LDLIBS) -lm -lz
+
+-misc/ace2sam.o: misc/ace2sam.c $(HTSDIR)/htslib/kstring.h $(HTSDIR)/htslib/kseq.h
++misc/ace2sam.o: misc/ace2sam.c
+ misc/md5.o: misc/md5.c misc/md5.h
+-misc/md5fa.o: misc/md5fa.c misc/md5.h $(HTSDIR)/htslib/kseq.h
+-misc/wgsim.o: misc/wgsim.c $(HTSDIR)/htslib/kseq.h
++misc/md5fa.o: misc/md5fa.c misc/md5.h
++misc/wgsim.o: misc/wgsim.c
+
+ misc/maq2sam-short.o: misc/maq2sam.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ misc/maq2sam.c
diff --git a/sci-biology/samtools/metadata.xml b/sci-biology/samtools/metadata.xml
new file mode 100644
index 000000000000..74dc02bc9826
--- /dev/null
+++ b/sci-biology/samtools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-biology</herd>
+ <upstream>
+ <remote-id type="sourceforge">samtools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-biology/samtools/samtools-0.1.12.ebuild b/sci-biology/samtools/samtools-0.1.12.ebuild
new file mode 100644
index 000000000000..34720e4b9abb
--- /dev/null
+++ b/sci-biology/samtools/samtools-0.1.12.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+MY_P="${P}a"
+
+DESCRIPTION="Utilities for SAM (Sequence Alignment/Map), a format for large nucleotide sequence alignments"
+HOMEPAGE="http://samtools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ sed -i 's/^CFLAGS=/CFLAGS+=/' "${S}"/{Makefile,misc/Makefile}
+}
+
+src_install() {
+ dobin samtools || die
+ dobin $(find misc -type f -executable) || die
+ insinto /usr/share/${PN}
+ doins -r examples || die
+ doman ${PN}.1 || die
+ dodoc AUTHORS ChangeLog NEWS
+}
diff --git a/sci-biology/samtools/samtools-0.1.19-r2.ebuild b/sci-biology/samtools/samtools-0.1.19-r2.ebuild
new file mode 100644
index 000000000000..133ababad9cc
--- /dev/null
+++ b/sci-biology/samtools/samtools-0.1.19-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-r1 toolchain-funcs
+
+DESCRIPTION="Utilities for SAM (Sequence Alignment/Map), a format for large nucleotide sequence alignments"
+HOMEPAGE="http://samtools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="examples"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+CDEPEND="sys-libs/ncurses"
+RDEPEND="${CDEPEND}
+ dev-lang/lua
+ dev-lang/perl"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-buildsystem.patch
+
+ sed -i 's~/software/bin/python~/usr/bin/env python~' "${S}"/misc/varfilter.py || die
+
+ tc-export CC AR
+}
+
+src_compile() {
+ local _ncurses="$($(tc-getPKG_CONFIG) --libs ncurses)"
+ emake dylib LIBCURSES="${_ncurses}"
+ emake LIBCURSES="${_ncurses}"
+}
+
+src_install() {
+ dobin samtools $(find bcftools misc -type f -executable)
+
+ python_replicate_script "${ED}"/usr/bin/varfilter.py
+
+ dolib.so libbam$(get_libname 1)
+ dosym libbam$(get_libname 1) /usr/$(get_libdir)/libbam$(get_libname)
+
+ insinto /usr/include/bam
+ doins *.h
+
+ doman ${PN}.1
+ dodoc AUTHORS NEWS
+
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r examples
+ fi
+}
diff --git a/sci-biology/samtools/samtools-1.0-r1.ebuild b/sci-biology/samtools/samtools-1.0-r1.ebuild
new file mode 100644
index 000000000000..802aefc91ada
--- /dev/null
+++ b/sci-biology/samtools/samtools-1.0-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-r1 toolchain-funcs
+
+DESCRIPTION="Utilities for SAM (Sequence Alignment/Map), a format for large nucleotide sequence alignments"
+HOMEPAGE="http://www.htslib.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="examples"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+CDEPEND="
+ sys-libs/ncurses
+ sci-libs/htslib"
+
+RDEPEND="${CDEPEND}
+ dev-lang/lua
+ dev-lang/perl"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ find htslib-1.0 -delete || die
+
+ sed -i 's~/software/bin/python~/usr/bin/env python~' "${S}"/misc/varfilter.py || die
+
+ epatch "${FILESDIR}"/${P}-buildsystem.patch
+
+ tc-export CC AR
+
+ sed \
+ -e '/htslib.mk/d' \
+ -i Makefile || die
+
+}
+
+src_compile() {
+ local mymakeargs=(
+ LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
+ HTSDIR="${EPREFIX}/usr/include"
+ HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
+ BAMLIB="libbam.so"
+ )
+ emake "${mymakeargs[@]}"
+}
+
+src_install() {
+ dobin samtools $(find misc -type f -executable)
+
+ python_replicate_script "${ED}"/usr/bin/varfilter.py
+ dolib.so libbam.so*
+
+ insinto /usr/include/bam
+ doins *.h
+
+ doman ${PN}.1
+ dodoc AUTHORS NEWS README
+
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r examples
+ fi
+}
diff --git a/sci-biology/samtools/samtools-1.0.ebuild b/sci-biology/samtools/samtools-1.0.ebuild
new file mode 100644
index 000000000000..d1f1f507b45c
--- /dev/null
+++ b/sci-biology/samtools/samtools-1.0.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-r1 toolchain-funcs
+
+DESCRIPTION="Utilities for SAM (Sequence Alignment/Map), a format for large nucleotide sequence alignments"
+HOMEPAGE="http://www.htslib.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="examples"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+CDEPEND="
+ sys-libs/ncurses
+ sci-libs/htslib"
+
+RDEPEND="${CDEPEND}
+ dev-lang/lua
+ dev-lang/perl"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ find htslib-1.0 -delete || die
+
+ sed -i 's~/software/bin/python~/usr/bin/env python~' "${S}"/misc/varfilter.py || die
+
+ tc-export CC AR
+
+ sed \
+ -e '/htslib.mk/d' \
+ -i Makefile || die
+
+}
+
+src_compile() {
+ local mymakeargs=(
+ LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
+ CC="$(tc-getCC)"
+ LDFLAGS="${LDFLAGS}"
+ CFLAGS="${CFLAGS}"
+ HTSDIR="${EPREFIX}/usr/include"
+ HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
+ )
+ emake "${mymakeargs[@]}"
+}
+
+src_install() {
+ dobin samtools $(find misc -type f -executable)
+
+ python_replicate_script "${ED}"/usr/bin/varfilter.py
+
+ doman ${PN}.1
+ dodoc AUTHORS NEWS README
+
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r examples
+ fi
+}
diff --git a/sci-biology/samtools/samtools-1.1.ebuild b/sci-biology/samtools/samtools-1.1.ebuild
new file mode 100644
index 000000000000..1f5b82ab4602
--- /dev/null
+++ b/sci-biology/samtools/samtools-1.1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-r1 toolchain-funcs
+
+DESCRIPTION="Utilities for SAM (Sequence Alignment/Map), a format for large nucleotide sequence alignments"
+HOMEPAGE="http://www.htslib.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="examples"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+CDEPEND="
+ sys-libs/ncurses
+ ~sci-libs/htslib-${PV}"
+
+RDEPEND="${CDEPEND}
+ dev-lang/lua
+ dev-lang/perl"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ find htslib-* -delete || die
+
+ sed -i 's~/software/bin/python~/usr/bin/env python~' "${S}"/misc/varfilter.py || die
+
+ epatch "${FILESDIR}"/${P}-buildsystem.patch
+
+ tc-export CC AR
+
+ sed \
+ -e '/htslib.mk/d' \
+ -i Makefile || die
+
+}
+
+src_compile() {
+ local mymakeargs=(
+ LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
+ HTSDIR="${EPREFIX}/usr/include"
+ HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
+ BAMLIB="libbam.so"
+ )
+ emake "${mymakeargs[@]}"
+}
+
+src_test() {
+ local mymakeargs=(
+ LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
+ HTSDIR="${EPREFIX}/usr/include"
+ HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
+ BAMLIB="libbam.so"
+ )
+ emake "${mymakeargs[@]}" test
+}
+
+src_install() {
+ dobin samtools $(find misc -type f -executable)
+
+ python_replicate_script "${ED}"/usr/bin/varfilter.py
+ dolib.so libbam.so*
+
+ insinto /usr/include/bam
+ doins *.h
+
+ doman ${PN}.1
+ dodoc AUTHORS NEWS README
+
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r examples
+ fi
+}
diff --git a/sci-biology/samtools/samtools-1.2.ebuild b/sci-biology/samtools/samtools-1.2.ebuild
new file mode 100644
index 000000000000..3a999e01e865
--- /dev/null
+++ b/sci-biology/samtools/samtools-1.2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-r1 toolchain-funcs
+
+DESCRIPTION="Utilities for SAM (Sequence Alignment/Map), a format for large nucleotide sequence alignments"
+HOMEPAGE="http://www.htslib.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="examples"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+CDEPEND="
+ sys-libs/ncurses
+ >=sci-libs/htslib-${PV}"
+
+RDEPEND="${CDEPEND}
+ dev-lang/lua
+ dev-lang/perl"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ find htslib-* -delete || die
+
+ sed -i 's~/software/bin/python~/usr/bin/env python~' "${S}"/misc/varfilter.py || die
+
+ epatch "${FILESDIR}"/${P}-buildsystem.patch
+
+ tc-export CC AR
+
+ sed \
+ -e '/htslib.mk/d' \
+ -i Makefile || die
+
+}
+
+src_compile() {
+ local mymakeargs=(
+ LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
+ HTSDIR="${EPREFIX}/usr/include"
+ HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
+ BAMLIB="libbam.so"
+ )
+ emake "${mymakeargs[@]}"
+}
+
+src_test() {
+ local mymakeargs=(
+ LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
+ HTSDIR="${EPREFIX}/usr/include"
+ HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
+ BAMLIB="libbam.so"
+ )
+ LD_LIBRARY_PATH="${S}" emake "${mymakeargs[@]}" test
+}
+
+src_install() {
+ dobin samtools $(find misc -type f -executable)
+
+ python_replicate_script "${ED}"/usr/bin/varfilter.py
+ dolib.so libbam.so*
+
+ insinto /usr/include/bam
+ doins *.h
+
+ doman ${PN}.1
+ dodoc AUTHORS NEWS README
+
+ if use examples; then
+ insinto /usr/share/${PN}
+ doins -r examples
+ fi
+}