Skip to content

Commit

Permalink
Merge pull request #206 from mariux64/update-sra-tools
Browse files Browse the repository at this point in the history
Update sra tools
  • Loading branch information
david authored Aug 15, 2022
2 parents f88ba52 + 9a2ae77 commit 8cc8dd7
Showing 1 changed file with 137 additions and 0 deletions.
137 changes: 137 additions & 0 deletions sra-tools-3.0.0-0.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#! /bin/bash -x

COOKIE=$(mcookie|cut -c-8); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 0.2; exec bash /dev/shm/runme-$COOKIE.sh $1

PKG=sra-tools
VERSION=3.0.0
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-tools/archive/refs/tags/${VERSION}.tar.gz"
VDB="https://github.com/ncbi/ncbi-vdb/archive/refs/tags/${VERSION}.tar.gz"
SRA="https://github.com/ncbi/sra-tools/archive/refs/tags/${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=/scratch/local2/$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

NJOBS=$(( $(nproc) * 4 / 5 + 1 ))

export MAKEFLAGS="-j $NJOBS"

BUILDDIR=$PREFIX/build

mkdir -p $BUILDDIR

cd $PREFIX
if [ ! -e lib ]; then
mkdir lib
fi
if [ ! -e lib64 ]; then
ln -s lib lib64
fi

cd $BUILDDIR

test -d ${ARCHIVE} || mkdir ${ARCHIVE}
for i in $NGS $VDB $SRA;
do
get_extract $i
done

ngstools-build() {

cd ${BUILDDIR}/${NGS_DIR}

echo -e "\n\n++++++++++++++ngs+++++++++++++++++\n\n"

}

#ngs-build()

vdb-build() {

cd ${BUILDDIR}/${VDB_DIR}

cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} \
.
make ${MAKEFLAGS}

make install

}

vdb-build

#ngs-build() {
#jetzt neu im repo von sratools
#}

sratools-build() {

echo -e "\n\n++++++++++++++sra-tools++++++++++++++++\n\n"

cd ${BUILDDIR}/${SRA_DIR}

test -d obj || mkdir obj
cd obj
test -e ngs || ln -s ../ngs .

cd ${BUILDDIR}/${SRA_DIR}

cmake \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DVDB_LIBDIR=${PREFIX}/lib \
-DVDB_BINDIR=${BUILDDIR}/${VDB_DIR} \
-DVDB_INCDIR=${BUILDDIR}/${VDB_DIR}/interfaces \
-DCMAKE_VERBOSE_MAKEFILE=ON \
.

make ${MAKEFLAGS}

make install
}
sratools-build

exit

0 comments on commit 8cc8dd7

Please sign in to comment.