summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Krause2015-06-13 11:57:00 +0200
committerChristian Krause2015-06-13 11:57:00 +0200
commit1c012681f904e3b3f380cb3eaefe5730f2357d8c (patch)
treeec259efceb3b3ad4bdbf6bd81bc68e914818b102
downloadaur-1c012681f904e3b3f380cb3eaefe5730f2357d8c.tar.gz
Initial import
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD47
-rw-r--r--bcftools-profile.sh1
-rw-r--r--makefile-system-htslib.patch78
4 files changed, 146 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..672799cc63a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = bcftools
+ pkgdesc = Reading/writing BCF2/VCF/gVCF files and calling/filtering/summarising SNP and short indel sequence variants
+ pkgver = 1.2
+ pkgrel = 3
+ url = http://samtools.github.io/bcftools/
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = gsl
+ depends = htslib
+ depends = perl
+ source = bcftools-1.2.tar.gz::https://github.com/samtools/bcftools/archive/1.2.tar.gz
+ source = bcftools-profile.sh
+ source = makefile-system-htslib.patch
+ md5sums = 87efbd0092b6e4828c17842c9ae57ec9
+ md5sums = 50efd8fdb3f4c11a5dff7748c666d90e
+ md5sums = 5ae8f6433b42acf1f4bc7b7658a10805
+
+pkgname = bcftools
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..3327eeea3a3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Christian Krause ("wookietreiber") <kizkizzbangbang@googlemail.com>
+
+pkgname=bcftools
+pkgver=1.2
+pkgrel=3
+pkgdesc="Reading/writing BCF2/VCF/gVCF files and calling/filtering/summarising SNP and short indel sequence variants"
+arch=('i686' 'x86_64')
+url="http://samtools.github.io/bcftools/"
+license=('GPL')
+depends=('gsl' 'htslib' 'perl')
+source=($pkgname-$pkgver.tar.gz::https://github.com/samtools/bcftools/archive/$pkgver.tar.gz
+ bcftools-profile.sh
+ makefile-system-htslib.patch)
+md5sums=('87efbd0092b6e4828c17842c9ae57ec9'
+ '50efd8fdb3f4c11a5dff7748c666d90e'
+ '5ae8f6433b42acf1f4bc7b7658a10805')
+
+prepare() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # patch Makefile to make it work with a system-provided htslib
+ patch -Np1 -i $srcdir/makefile-system-htslib.patch
+}
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make USE_GPL=1
+}
+
+check() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make USE_GPL=1 test
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make USE_GPL=1 DESTDIR=$pkgdir prefix=/usr install
+
+ for plugin in plugins/*.so ; do
+ install -Dm755 $plugin $pkgdir/usr/lib/bcftools/$(basename $plugin)
+ done
+
+ install -Dm644 $srcdir/bcftools-profile.sh $pkgdir/etc/profile.d/bcftools.sh
+}
diff --git a/bcftools-profile.sh b/bcftools-profile.sh
new file mode 100644
index 00000000000..c31d0ed39cb
--- /dev/null
+++ b/bcftools-profile.sh
@@ -0,0 +1 @@
+export BCFTOOLS_PLUGINS=/usr/lib/bcftools
diff --git a/makefile-system-htslib.patch b/makefile-system-htslib.patch
new file mode 100644
index 00000000000..737ab0d61d5
--- /dev/null
+++ b/makefile-system-htslib.patch
@@ -0,0 +1,78 @@
+diff -aur bcftools-1.2/Makefile bcftools-1.2-patched/Makefile
+--- bcftools-1.2/Makefile 2015-02-02 16:40:17.000000000 +0100
++++ bcftools-1.2-patched/Makefile 2015-02-04 12:33:10.627010914 +0100
+@@ -29,11 +29,9 @@
+ all: $(PROG) $(TEST_PROG)
+
+ # Adjust $(HTSDIR) to point to your top-level htslib directory
+-HTSDIR = ../htslib
+-include $(HTSDIR)/htslib.mk
+-HTSLIB = $(HTSDIR)/libhts.a
+-BGZIP = $(HTSDIR)/bgzip
+-TABIX = $(HTSDIR)/tabix
++HTSDIR = /usr/include
++BGZIP = bgzip
++TABIX = tabix
+
+ CC = gcc
+ CFLAGS = -g -Wall -Wc++-compat -O2
+@@ -52,7 +50,7 @@
+ ifdef USE_GPL
+ CFLAGS += -DUSE_GPL
+ OBJS += polysomy.o
+- LDLIBS = -lgsl -lcblas
++ LDLIBS = -lgsl -lgslcblas
+ endif
+
+ prefix = /usr/local
+@@ -90,10 +88,10 @@
+ .c.o:
+ $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $< -o $@
+
+-test: $(PROG) plugins test/test-rbuf $(BGZIP) $(TABIX)
++test: $(PROG) plugins test/test-rbuf
+ ./test/test.pl --exec bgzip=$(BGZIP) --exec tabix=$(TABIX)
+
+-test-plugins: $(PROG) plugins test/test-rbuf $(BGZIP) $(TABIX)
++test-plugins: $(PROG) plugins test/test-rbuf
+ ./test/test.pl --plugins --exec bgzip=$(BGZIP) --exec tabix=$(TABIX)
+
+
+@@ -102,8 +100,8 @@
+ PLUGINS = $(PLUGINC:.c=.so)
+ PLUGINM = $(PLUGINC:.c=.mk)
+
+-%.so: %.c version.h version.c $(HTSDIR)/libhts.so
+- $(CC) $(CFLAGS) $(INCLUDES) -fPIC -shared -o $@ version.c $< -L$(HTSDIR) -lhts
++%.so: %.c version.h version.c
++ $(CC) $(CFLAGS) $(INCLUDES) -fPIC -shared -o $@ version.c $< -lhts
+
+ -include $(PLUGINM)
+
+@@ -158,8 +156,8 @@
+ test/test-rbuf: test/test-rbuf.o
+ $(CC) $(CFLAGS) -o $@ -lm -ldl $<
+
+-bcftools: $(HTSLIB) $(OBJS)
+- $(CC) $(CFLAGS) -o $@ $(OBJS) $(HTSLIB) -lpthread -lz -lm -ldl $(LDLIBS)
++bcftools: $(OBJS)
++ $(CC) $(CFLAGS) -o $@ $(OBJS) -lpthread -lz -lm -ldl -lhts $(LDLIBS)
+
+ doc/bcftools.1: doc/bcftools.txt
+ cd doc && a2x -adate="$(DOC_DATE)" -aversion=$(DOC_VERSION) --doctype manpage --format manpage bcftools.txt
+diff -aur bcftools-1.2/plugins/fixploidy.mk bcftools-1.2-patched/plugins/fixploidy.mk
+--- bcftools-1.2/plugins/fixploidy.mk 2015-02-02 16:40:17.000000000 +0100
++++ bcftools-1.2-patched/plugins/fixploidy.mk 2015-02-04 12:23:15.376535358 +0100
+@@ -1,2 +1,2 @@
+-plugins/fixploidy.so: plugins/fixploidy.c version.h version.c ploidy.h ploidy.c $(HTSDIR)/libhts.so
+- $(CC) $(CFLAGS) $(INCLUDES) -fPIC -shared -o $@ ploidy.c version.c $< -L$(HTSDIR) -lhts
++plugins/fixploidy.so: plugins/fixploidy.c version.h version.c ploidy.h ploidy.c
++ $(CC) $(CFLAGS) $(INCLUDES) -fPIC -shared -o $@ ploidy.c version.c $< -lhts
+diff -aur bcftools-1.2/plugins/vcf2sex.mk bcftools-1.2-patched/plugins/vcf2sex.mk
+--- bcftools-1.2/plugins/vcf2sex.mk 2015-02-02 16:40:17.000000000 +0100
++++ bcftools-1.2-patched/plugins/vcf2sex.mk 2015-02-04 12:25:51.240884001 +0100
+@@ -1,2 +1,2 @@
+-plugins/vcf2sex.so: plugins/vcf2sex.c version.h version.c ploidy.h ploidy.c $(HTSDIR)/libhts.so
+- $(CC) $(CFLAGS) $(INCLUDES) -fPIC -shared -o $@ ploidy.c version.c $< -L$(HTSDIR) -lhts
++plugins/vcf2sex.so: plugins/vcf2sex.c version.h version.c ploidy.h ploidy.c
++ $(CC) $(CFLAGS) $(INCLUDES) -fPIC -shared -o $@ ploidy.c version.c $< -lhts