-
Notifications
You must be signed in to change notification settings - Fork 118
/
build.sh
executable file
·58 lines (52 loc) · 2.02 KB
/
build.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
#!/bin/bash
set -x
# install dependencies
apt-get update
apt-get install -y --quiet --no-install-recommends git curl build-essential make autoconf automake gcc g++ cmake libssl-dev libtool libtool-bin libjpeg-dev pkg-config libsqlite3-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libldns-dev libedit-dev libssl-dev yasm liblua5.2-dev libopus-dev libsndfile-dev
# check out supporting code
cd /usr/local/src/
git clone https://github.com/davehorton/drachtio-freeswitch-modules.git
git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git
curl -L https://grpc.io/release
git clone -b v1.18.0 https://github.com/grpc/grpc
cd freeswitch/libs
git clone -b v3.1.0 https://github.com/warmcat/libwebsockets.git
# patch freeswitch
cd /usr/local/src/freeswitch
patch -b < /usr/local/src/drachtio-freeswitch-modules/ansible-role-drachtio-freeswitch/files/configure.ac.patch
patch -b < /usr/local/src/drachtio-freeswitch-modules/ansible-role-drachtio-freeswitch/files/Makefile.am.patch
cd build
patch -b < /usr/local/src/drachtio-freeswitch-modules/ansible-role-drachtio-freeswitch/files/modules.conf.in.patch
cd /usr/local/src/freeswitch/conf/vanilla/autoload_configs
patch -b < /usr/local/src/drachtio-freeswitch-modules/ansible-role-drachtio-freeswitch/files/modules.conf.vanilla.xml.patch
cd /usr/local/src/freeswitch/src/mod/applications
cp -r /usr/local/src/drachtio-freeswitch-modules/modules/mod_* .
# build libwebsockets
cd /usr/local/src/freeswitch/libs
cd libwebsockets/
mkdir build && cd $_
cmake ..
make
make install
cd /usr/local/src/
# build grpc
cd /usr/local/src/grpc
git submodule update --init --recursive
cd third_party/protobuf
./autogen.sh
./configure
make install
cd ../..
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH && make
make install
# now make freeswitch
cd ../freeswitch/libs/
git clone https://github.com/googleapis/googleapis
cd googleapis
LANGUAGE=cpp make
cd /usr/local/src/freeswitch
./bootstrap.sh -j
./configure --with-lws=yes --with-grpc=yes
make
make install
make sounds-install moh-install