install_hss.sh 2.55 KB
Newer Older
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
# !/bin/sh

CURRENT_PATH=`pwd`

sudo apt-get install autoconf automake gawk cmake make gcc flex bison libsctp1 libsctp-dev libidn2-0-dev \
libidn11-dev libmysqlclient-dev libxml2-dev swig python-dev cmake-curses-gui \
valgrind guile-2.0-dev libgmp-dev libgcrypt11-dev gdb unzip libtasn1-3-dev g++ \
linux-headers-`uname -r` build-essential -y

source ./utils.bash

if [ -f install_log.txt ]
    then
    rm -f install_log.txt
fi

if [ ! -d /usr/local/src/ ]
    then
    echo "/usr/local/src/ doesn't exist please create one"
    exit -1
fi

if [ ! -w /usr/local/src/ ]
    then
    echo "You don't have permissions to write to /usr/local/src/"
    exit -1
fi

cd /usr/local/src/
echo "Downloading nettle archive"

if [ -f nettle-2.5.tar.gz ]
    then
    rm -f nettle-2.5.tar.gz
fi
if [ -f nettle-2.5.tar ]
    then
    rm -f nettle-2.5.tar
fi
if [ -d nettle-2.5 ]
    then
    rm -rf nettle-2.5/
fi

wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz > install_log.txt
gunzip nettle-2.5.tar.gz > install_log.txt
echo "Uncompressing nettle archive"
tar -xf nettle-2.5.tar
cd nettle-2.5/
./configure --disable-openssl --enable-shared --prefix=/usr > install_log.txt
if [ $? -ne 0 ]
then
    exit -1
fi
echo "Compiling nettle"
make -j2 > install_log.txt 2>&1
make check > install_log.txt
sudo make install > install_log.txt
cd ../

echo "Downloading gnutls archive"

if [ -f gnutls-3.1.0.tar.xz ]
    then
    rm -f gnutls-3.1.0.tar.xz
fi
if [ -d gnutls-3.1.0/ ]
    then
    rm -rf gnutls-3.1.0/
fi

wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.0.tar.xz > install_log.txt
tar -xf gnutls-3.1.0.tar.xz
echo "Uncompressing gnutls archive"
cd gnutls-3.1.0/
./configure --prefix=/usr
if [ $? -ne 0 ]
then
    exit -1
fi
echo "Compiling gnutls"
make -j2 > install_log.txt 2>&1
sudo make install > install_log.txt
cd ../

echo "Downloading freeDiameter archive"

if [ -f 1.1.5.tar.gz ]
    then
    rm -f 1.1.5.tar.gz
fi
if [ -d freeDiameter-1.1.5/ ]
    then
    rm -rf freeDiameter-1.1.5/
fi

wget http://www.freediameter.net/hg/freeDiameter/archive/1.1.5.tar.gz > install_log.txt
tar -xzf 1.1.5.tar.gz > install_log.txt
echo "Uncompressing freeDiameter archive"
cd freeDiameter-1.1.5
patch -p1 < $CURRENT_PATH/freediameter-1.1.5.patch > install_log.txt
mkdir build
cd build
gauthier's avatar
gauthier committed
104
# optionaly if needed add -DCMAKE_BUILD_TYPE=debug
105
106
107
108
109
110
111
112
113
114
115
116
117
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../ > install_log.txt
if [ $? -ne 0 ]
then
    exit -1
fi
echo "Compiling freeDiameter"
make -j2 > install_log.txt 2>&1
#make help
make test > install_log.txt
sudo make install > install_log.txt

cd $CURRENT_PATH
./make_certs.sh