Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 108 lines (78 sloc) 2.1 KB
#! /bin/bash
PKG=sra-tools
VERSION=2.10.8
BUILD=0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/scratch/local2/$PKG-$VERSION-$BUILD ; fi
ARCHIVE=${PREFIX}/build/archive
#URL's
NGS="https://github.com/ncbi/ngs/archive/${VERSION}.tar.gz"
VDB="https://github.com/ncbi/ncbi-vdb/archive/${VERSION}.tar.gz"
SRA="https://github.com/ncbi/sra-tools/archive/${VERSION}.tar.gz"
#BUILD Dirs
NGS_DIR=`echo $NGS |cut -d"/" -f5`
VDB_DIR=`echo $VDB |cut -d"/" -f5`
SRA_DIR=`echo $SRA |cut -d"/" -f5`
function get_extract () {
pkg=`echo ${1} |cut -d"/" -f7`
dir=`echo ${1} |cut -d"/" -f5`
arc=${ARCHIVE}/${dir}-${pkg}
if [ ! -e ${arc} ]
then
wget ${1} -O ${arc}
fi
if [ ! -e $dir ]
then
mkdir $dir
tar -xof ${arc} -C ${dir} --strip-components 1 --checkpoint=1000
fi
}
set -xe
umask 022
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
exec </dev/null
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
LD_LIBRARY_PATH=$PREFIX/lib:\$LD_LIBRARY_PATH
export PATH LD_LIBRARY_PATH
EOF
. $PREFIX/profile
export MAKEFLAGS="-j $(nproc)"
BUILDDIR=$PREFIX/build
mkdir -p $BUILDDIR
cd $PREFIX
mkdir lib
ln -s lib lib64
cd $BUILDDIR
test -d ${ARCHIVE} || mkdir ${ARCHIVE}
for i in $NGS $VDB $SRA;
do
get_extract $i
done
cd ${BUILDDIR}/${NGS_DIR}
./configure --prefix=${PREFIX} \
--build-prefix=${BUILDDIR}/ngs-outdir
make -C ngs-sdk
make -C ngs-java
make -C ngs-sdk install
make -C ngs-java install
cd ${BUILDDIR}/${VDB_DIR}
./configure --prefix=${PREFIX} \
--with-ngs-sdk-prefix=${BUILDDIR}/ngs-outdir \
--build-prefix=${BUILDDIR}/ncbi-outdir
make
make install
cd ${BUILDDIR}/${SRA_DIR}
./configure --with-ngs-sdk-prefix=${BUILDDIR}/ngs-outdir \
--with-ncbi-vdb-sources=${BUILDDIR}/${VDB_DIR} \
--with-ncbi-vdb-build=${BUILDDIR}/ncbi-outdir \
--prefix=${PREFIX} \
--build-prefix=${BUILDDIR}/sra-tools-outdir
VDB_SRCDIR=${BUILDDIR}/${VDB_DIR} make
make install
exit