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 137 lines (97 sloc) 2.39 KB
#! /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