1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#!/bin/bash
set -x
set -e
start_dir=$(pwd)
MUMMER_VERSION="3.23"
MUMMER_DOWNLOAD_URL="http://sourceforge.net/projects/mummer/files/mummer/${MUMMER_VERSION}/MUMmer${MUMMER_VERSION}.tar.gz/download"
# Make an install location
if [ ! -d 'build' ]; then
mkdir build
fi
cd build
build_dir=$(pwd)
# DOWNLOAD ALL THE THINGS
download () {
url=$1
download_location=$2
if [ -e $download_location ]; then
echo "Skipping download of $url, $download_location already exists"
else
echo "Downloading $url to $download_location"
wget $url -O $download_location
fi
}
download $MUMMER_DOWNLOAD_URL "mummer-${MUMMER_VERSION}.tgz"
# Build all the things
cd $build_dir
## Mummer
mummer_dir=$(pwd)/MUMmer${MUMMER_VERSION}
if [ ! -d $mummer_dir ]; then
tar xzf mummer-${MUMMER_VERSION}.tgz
fi
cd $mummer_dir
if [ -e "${mummer_dir}/mummer" ]; then
echo "Already built Mummer; skipping build"
else
make check
make
cd ./src/tigr
make
fi
cd $build_dir
# Setup environment variables
update_path () {
new_dir=$1
export PATH=${PATH:-$new_dir}
if [[ ! "$PATH" =~ (^|:)"${new_dir}"(:|$) ]]; then
export PATH=${new_dir}:${PATH}
fi
}
update_path ${mummer_dir}
update_path ${mummer_dir}/src/tigr
cd $start_dir
set +x
set +e
|