-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathinstall_dependencies.sh
executable file
·83 lines (67 loc) · 1.96 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
#!/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:
- 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/bzip2-1.0.6" ]; then
echo "skipping dependencies 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 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 bzip2-1.0.6/libbz2.a .
cp zlib-1.2.11/libz.a .
cd ..
echo "downloaded dependencies:"
ls $dependencies_dir