forked from CESNET/netopeer2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-install-libs.sh
87 lines (77 loc) · 2.85 KB
/
.travis-install-libs.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
#!/bin/sh
if [[ (( "$TRAVIS_BRANCH" == *"master"* )) || (( "$TRAVIS_TAG" =~ "v"[0-9]+"."[0-9]+"."[0-9]+ )) ]]; then
BRANCH="master"
else
BRANCH="devel"
fi
sudo apt-get update -qq
sudo apt-get install -y zlib1g-dev libssl-dev
sudo apt-get install -y --force-yes libavl-dev libev-dev coreutils acl valgrind
if [ ! -d "cmocka-1.1.1/build" ]; then
echo "Building cmocka from source."
wget https://cmocka.org/files/1.1/cmocka-1.1.1.tar.xz
tar -xJvf cmocka-1.1.1.tar.xz
cd cmocka-1.1.1 && mkdir build && cd build
(cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install) > /dev/null
cd ../..
else
echo "Using cmocka from cache."
cd cmocka-1.1.1/build
sudo make install > /dev/null
cd ../..
fi
git clone -b $BRANCH https://github.com/CESNET/libyang.git
cd libyang; mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=Release .. > /dev/null
(make -j2 && sudo make install) > /dev/null
cd ../..
if [ ! -d "libssh-0.8.5/build" ]; then
echo "Building libssh from source."
wget https://www.libssh.org/files/0.8/libssh-0.8.5.tar.xz
tar -xJf libssh-0.8.5.tar.xz
mkdir libssh-0.8.5/build && cd libssh-0.8.5/build
(cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install) > /dev/null
cd ../..
else
echo "Using libssh from cache."
cd libssh-0.8.5/build
sudo make install > /dev/null
cd ../..
fi
git clone -b $BRANCH https://github.com/CESNET/libnetconf2.git
cd libnetconf2; mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=Release .. > /dev/null
(make -j2 && sudo make install) > /dev/null
cd ../..
if [ ! -f "protobuf/Makefile" ]; then
echo "Building protobuf from source."
wget https://github.com/google/protobuf/archive/v3.2.0.tar.gz
tar -xzf v3.2.0.tar.gz
cd protobuf-3.2.0
(./autogen.sh && ./configure --prefix=/usr && make -j2 && sudo make install) > /dev/null
cd ..
else
echo "Using protobuf from cache."
cd protobuf
sudo make install > /dev/null
cd ..
fi
if [ ! -f "protobuf-c/Makefile" ]; then
echo "Building protobuf-c from source."
wget https://github.com/protobuf-c/protobuf-c/archive/v1.2.1.tar.gz
tar -xzf v1.2.1.tar.gz
cd protobuf-c-1.2.1
(./autogen.sh && ./configure --prefix=/usr && make -j2 && sudo make install) > /dev/null
cd ..
else
echo "Using protobuf-c from cache."
cd protobuf-c
sudo make install > /dev/null
cd ..
fi
git clone -b $BRANCH https://github.com/sysrepo/sysrepo.git
cd sysrepo; mkdir build; cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DBUILD_EXAMPLES=False -DENABLE_TESTS=False -DGEN_LANGUAGE_BINDINGS=0 -DREPOSITORY_LOC:PATH=/ets/sysrepo .. > /dev/null
(make -j2 && sudo make install) > /dev/null
cd ../..
if [ "${CC}" = "gcc" ]; then pip install --user codecov; export CFLAGS="-coverage"; fi