Skip to content

Commit

Permalink
Merge pull request #141 from mariux64/sra-tools-update
Browse files Browse the repository at this point in the history
Sra tools update
  • Loading branch information
donald authored Feb 4, 2021
2 parents 8cf1cea + 1a1e916 commit 5a59f11
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions sra-tools-2.10.8-0.build.sh
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

0 comments on commit 5a59f11

Please sign in to comment.