forked from EBIvariation/vcf-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_dependencies.sh
executable file
·118 lines (97 loc) · 3.15 KB
/
install_dependencies.sh
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
help_install_dependencies="Usage:
./install_dependencies.sh [os_name] default OS is linux
./install_dependencies.sh --help displays help
os_name can be:
- linux
- osx
it installs the given dependencies:
- odb compiler odb-2.4.0
- odb common runtime library libodb-2.4.0
- odb sqlite runtime library libodb-sqlite-2.4.0
- bzip library bzip2-1.0.6
- zlib library zlib-1.2.11
for linux:
./install_dependencies.sh linux
for mac os:
./install_dependencies.sh osx
"
if [ "$#" -eq 0 ]
then
OS_NAME="linux"
elif [ "$#" -eq 1 ]
then
if [[ "$1" == "--help" ]]
then
echo "$help_install_dependencies"
exit
elif [[ "$1" == "linux" ]]
then
OS_NAME="linux"
elif [[ "$1" == "osx" ]]
then
OS_NAME="osx"
else
echo "$help_install_dependencies"
exit
fi
else
echo "requires 1 argument at max"
echo "$help_install_dependencies"
exit
fi
dependencies_dir=$OS_NAME"_dependencies"
#check for already downloaded files
if [ -d "$dependencies_dir/libodb-2.4.0" ]; then
echo "skipping odb installation: $dependencies_dir directory found:"
ls $dependencies_dir
exit
fi
# Download ODB runtime library, sqlite DB plugin for ODB, libbz2 and libz.
echo "creating directory $dependencies_dir"
mkdir -p $dependencies_dir && cd $dependencies_dir
echo "installing libodb"
wget http://codesynthesis.com/download/odb/2.4/libodb-2.4.0.tar.bz2 -O /tmp/libodb.tar.bz2
tar jxvf /tmp/libodb.tar.bz2
cd libodb-2.4.0 && ./configure && make && cd ..
echo "installing libodb-sqlite"
wget http://codesynthesis.com/download/odb/2.4/libodb-sqlite-2.4.0.tar.bz2 -O /tmp/libodb-sqlite.tar.bz2
tar jxvf /tmp/libodb-sqlite.tar.bz2
cd libodb-sqlite-2.4.0 && ./configure --with-libodb=../libodb-2.4.0 && make && cd ..
echo "installing libbz2"
# This is commented till the bzip.org site is recovered.
# wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz -O /tmp/libbz2.tar.gz
# tar zxvf /tmp/libbz2.tar.gz
# Till then we can trust ubuntu archives.
wget http://archive.ubuntu.com/ubuntu/pool/main/b/bzip2/bzip2_1.0.6.orig.tar.bz2 -O /tmp/libbz2.tar.bz2
tar jxvf /tmp/libbz2.tar.bz2
cd bzip2-1.0.6 && make && cd ..
echo "installing libz"
wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.11.tar.gz?download -O /tmp/libz.tar.gz
tar zxvf /tmp/libz.tar.gz
cd zlib-1.2.11 && cmake . && make && cd ..
# Make easier to find the static libraries
cp libodb-2.4.0/odb/.libs/libodb.a .
cp libodb-sqlite-2.4.0/odb/sqlite/.libs/libodb-sqlite.a .
cp bzip2-1.0.6/libbz2.a .
cp zlib-1.2.11/libz.a .
# copy headers
cp -r libodb-2.4.0/odb ./
cp -r libodb-sqlite-2.4.0/odb/sqlite ./odb/
# Download odb compiler
if [[ "$OS_NAME" == "linux" ]]
then
wget http://codesynthesis.com/download/odb/2.4/odb-2.4.0-x86_64-linux-gnu.tar.bz2 -O /tmp/odb.tar.bz2
tar jxvf /tmp/odb.tar.bz2
elif [[ "$OS_NAME" == "osx" ]]
then
wget http://codesynthesis.com/download/odb/2.4/odb-2.4.0-i686-macosx.tar.bz2 -O /tmp/odb.tar.bz2
tar jxvf /tmp/odb.tar.bz2
else
echo "Invalid OS name"
echo "$help_install_dependencies"
exit
fi
cd ..
echo "downloaded odb:"
ls $dependencies_dir