|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +# github repository to pull from |
| 4 | +repname=samtools |
| 5 | + |
| 6 | +# directory to do the pull and build |
| 7 | +TMPDIR=`readlink -f $TMPDIR` |
| 8 | + |
| 9 | +# directory to install into |
| 10 | +PREFIX=`readlink -f $PREFIX` |
| 11 | + |
| 12 | +# clean up TMPDIR |
| 13 | +mkdir -p $TMPDIR |
| 14 | +rm -fr $TMPDIR/* |
| 15 | +cd $TMPDIR |
| 16 | + |
| 17 | +# build each repository in turn |
| 18 | +for repo in htslib htslib-plugins samtools bcftools; do |
| 19 | + echo Building $repo |
| 20 | + git clone [email protected]: $repname/ $repo.git |
| 21 | + cd $repo |
| 22 | + version=`git log -1 --format="%h"` |
| 23 | + date=`date +"%d %B %Y"` |
| 24 | + rm -fr .git* |
| 25 | + sed -i "s/PACKAGE_VERSION[ ][ ]*=.*/PACKAGE_VERSION = $version/" Makefile |
| 26 | + if [ -e htsfile.1 ]; then |
| 27 | + sed -i "s/^.TH.*/.TH htsfile 1 \"$date\" \"htslib-$version\" \"Bioinformatics tools\"/" htsfile.1 |
| 28 | + fi |
| 29 | + if [ -e tabix.1 ]; then |
| 30 | + sed -i "s/^.TH.*/.TH tabix 1 \"$date\" \"htslib-$version\" \"Bioinformatics tools\"/" tabix.1 |
| 31 | + fi |
| 32 | + if [ -e samtools.1 ]; then |
| 33 | + sed -i "s/^.TH.*/.TH samtools 1 \"$date\" \"samtools-$version\" \"Bioinformatics tools\"/" samtools.1 |
| 34 | + fi |
| 35 | + if [ -e misc/wgsim.1 ]; then |
| 36 | + sed -i "s/^.TH.*/.TH wgsim 1 \"$date\" \"samtools-$version\" \"Bioinformatics tools\"/" misc/wgsim.1 |
| 37 | + fi |
| 38 | + if [ -e README ]; then |
| 39 | + sed -i "s/samtools-.*/samtools-$version # Within the unpacked release directory/" README |
| 40 | + sed -i "s/htslib-.*/htslib-$version/" README |
| 41 | + fi |
| 42 | + if [ -e bam.h ]; then |
| 43 | + sed -i "s/BAM_VERSION.*/BAM_VERSION \"$version+\"/" bam.h |
| 44 | + fi |
| 45 | + |
| 46 | + if [ -e doc/bcftools.1 ]; then |
| 47 | + echo make DOC_VERSION=\"$version\" DOC_DATE=`date +"%Y-%m-%d"` docs |
| 48 | + make -n DOC_VERSION=\"$version\" DOC_DATE=`date +"%Y-%m-%d"` docs |
| 49 | + fi |
| 50 | + cd .. |
| 51 | +done |
| 52 | + |
| 53 | +# Build htslib plugins |
| 54 | +cd $TMPDIR/htslib-plugins |
| 55 | +IRODS_HOME=/software/solexa/pkg/irods/4.1.10/usr HTSDIR=$TMPDIR/htslib make |
| 56 | +make prefix=$PREFIX/htslib-plugins/nightly install |
| 57 | + |
| 58 | +# Build htslib |
| 59 | +cd $TMPDIR/htslib |
| 60 | +autoreconf -i |
| 61 | +./configure --prefix=$PREFIX/htslib/nightly --enable-libcurl --enable-plugins --with-plugin-dir=$PREFIX/htslib-plugins/nightly/libexec/htslib |
| 62 | +make |
| 63 | +make test |
| 64 | +make install |
| 65 | + |
| 66 | +# Build samtools |
| 67 | +cd $TMPDIR/samtools |
| 68 | +autoreconf -i |
| 69 | +./configure --prefix=$PREFIX/samtools/nightly --with-htslib=$TMPDIR/htslib |
| 70 | +make |
| 71 | +make test |
| 72 | +make install |
| 73 | + |
| 74 | +# Build bcftools |
| 75 | +cd $TMPDIR/bcftools |
| 76 | +make HTSDIR=$TMPDIR/htslib |
| 77 | +make |
| 78 | +make test |
| 79 | +make prefix=$PREFIX/bcftools/nightly install |
| 80 | + |
0 commit comments