fusionpbx-install.sh/ubuntu/resources/switch/source-release.sh

78 lines
3.1 KiB
Bash
Raw Normal View History

2019-06-03 14:48:27 +02:00
#!/bin/sh
#move to script directory so all relative paths work
cd "$(dirname "$0")"
#includes
. ../config.sh
#upgrade packages
apt update && apt upgrade -y
# install dependencies
apt install -y autoconf automake devscripts g++ git-core libncurses5-dev libtool make libjpeg-dev \
pkg-config flac libgdbm-dev libdb-dev gettext sudo equivs mlocate git dpkg-dev libpq-dev \
liblua5.2-dev libtiff5-dev libperl-dev libcurl4-openssl-dev libsqlite3-dev libpcre3-dev \
devscripts libspeexdsp-dev libspeex-dev libldns-dev libedit-dev libopus-dev libmemcached-dev \
libshout3-dev libmpg123-dev libmp3lame-dev yasm nasm libsndfile1-dev libuv1-dev libvpx-dev \
libavformat-dev libswscale-dev libspandsp3-dev
2019-06-03 14:48:27 +02:00
# additional dependencies
2019-06-03 15:49:49 +02:00
apt install -y swig3.0 unzip sox wget
2019-06-03 14:48:27 +02:00
#we are about to move out of the executing directory so we need to preserve it to return after we are done
CWD=$(pwd)
echo "Using version $switch_version"
cd /usr/src
#git clone -b v1.8 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch
2019-12-13 23:06:45 +01:00
#1.8 and older
#wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.zip
#unzip freeswitch-$switch_version.zip
#rm -R freeswitch
#mv freeswitch-$switch_version freeswitch
#cd /usr/src/freeswitch
#1.10.0 and newer
wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.-release.zip -O freeswitch-$switch_version.-release.zip
2019-12-13 23:06:45 +01:00
unzip freeswitch-$switch_version.-release.zip
2019-06-03 14:48:27 +02:00
rm -R freeswitch
2019-12-13 23:06:45 +01:00
mv freeswitch-$switch_version.-release freeswitch
cd /usr/src/freeswitch
2019-06-03 14:48:27 +02:00
# bootstrap is needed if using git
#./bootstrap.sh -j
# enable required modules
sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_avmd:applications/mod_avmd:'
sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_callcenter:applications/mod_callcenter:'
sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_cidlookup:applications/mod_cidlookup:'
sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_memcache:applications/mod_memcache:'
sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_curl:applications/mod_curl:'
sed -i /usr/src/freeswitch/modules.conf -e s:'#formats/mod_shout:formats/mod_shout:'
2019-08-07 17:42:42 +02:00
sed -i /usr/src/freeswitch/modules.conf -e s:'#formats/mod_pgsql:formats/mod_pgsql:'
2019-06-03 14:48:27 +02:00
2019-06-04 04:32:41 +02:00
#disable module or install dependency libks to compile signalwire
2019-06-03 17:40:10 +02:00
sed -i /usr/src/freeswitch/modules.conf -e s:'applications/mod_signalwire:#applications/mod_signalwire:'
2019-06-03 14:48:27 +02:00
# prepare the build
#./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --disable-fhs
./configure -C --enable-portable-binary --disable-dependency-tracking \
--prefix=/usr --localstatedir=/var --sysconfdir=/etc \
--with-openssl --enable-core-pgsql-support
# compile and install
make
rm -rf /usr/share/freeswitch/sounds/music/default
2019-06-03 14:48:27 +02:00
make install
2019-06-03 17:59:26 +02:00
make sounds-install moh-install
make hd-sounds-install hd-moh-install
make cd-sounds-install cd-moh-install
2019-06-03 14:48:27 +02:00
#move the music into music/default directory
mkdir -p /usr/share/freeswitch/sounds/music/default
mv /usr/share/freeswitch/sounds/music/*000 /usr/share/freeswitch/sounds/music/default
#return to the executing directory
cd $CWD