-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from mariux64/sra-tools-update
Sra tools update
- Loading branch information
Showing
1 changed file
with
108 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#! /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 |