Skip to content

Commit

Permalink
build: bbb-freeswitch-core install pip3 to solve site-packages missing
Browse files Browse the repository at this point in the history
  • Loading branch information
antobinary committed Oct 18, 2021
1 parent 0f05cd9 commit 45d848c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 88 deletions.
102 changes: 16 additions & 86 deletions build/packages-template/bbb-freeswitch-core/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,31 @@ else
add-apt-repository -y ppa:bigbluebutton/support
fi

if [ "$DISTRO" == "xenial" ]; then
apt-get update
apt-get install -y libopusfile-dev opus-tools libopusenc-dev
fi

if [ "$DISTRO" == "bionic" ]; then
add-apt-repository ppa:bigbluebutton/support -y
# cat > /etc/apt/sources.list.d/kepstin-ubuntu-opus-bionic.list << HERE
#deb http://ppa.launchpad.net/kepstin/opus/ubuntu xenial main
# deb-src http://ppa.launchpad.net/kepstin/opus/ubuntu xenial main
#HERE
add-apt-repository ppa:bigbluebutton/support -y
apt-get update
apt-get install -y libopusfile-dev opus-tools libopusenc-dev
fi

mkdir -p staging

pushd .

# sofia-sip start
if [ ! -d sofia-sip ]; then
git clone https://github.com/freeswitch/sofia-sip.git
fi
cd sofia-sip/
git pull
./bootstrap.sh
./configure
#make DESTDIR=/var/tmp/bbb-freeswitch-core_2.3.0_bionic_develop/staging install

make -j $(nproc)
make install
cd ..
# sofia-sip end

# spandsp start
if [ ! -d spandsp ]; then
git clone https://github.com/freeswitch/spandsp.git
fi
Expand All @@ -89,52 +84,31 @@ if [ $DISTRO == "centos7" ] || [ $DISTRO == "amzn2" ]; then
make -j $(nproc)
make install
fi

popd
# spandsp end

#cat > /etc/ld.so.conf.d/myapp.conf << HERE
#/var/tmp/bbb-freeswitch-core_2.3.0_bionic_develop/staging/usr/local/lib
#HERE
ldconfig

#pushd /tmp
#git clone https://git.xiph.org/libopusenc.git
#cd libopusenc
#./autogen.sh
#./configure
#make install
#popd
# we already cloned the FS repo in freeswitch.placeholder.sh

patch -p0 < floor.patch

git fetch
git fetch --tags
git reset --hard
git checkout master
git pull

#git apply ../crash-fix2.patch

# Fix websocket lock
#cp ../websocket-fix/tport.c libs/sofia-sip/libsofia-sip-ua/tport/tport.c
#cp ../websocket-fix/tport_type_ws.c libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c
./bootstrap.sh

apt update
apt install -y python3-pip

#cp ../opus-fix/mod_opusfile.c src/mod/formats/mod_opusfile/mod_opusfile.c
#cp ../opus-fix/Makefile.am src/mod/formats/mod_opusfile/Makefile.am
pip3 --version
pip3 install
python3 -m site
python3 -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'


#if [ "$DISTRO" == "bionic" ];then
# sed -i 's/formats\/mod_opusfile//g' modules.conf
# sed -i 's/<load module="mod_opusfile"\/>//g' ../conf/modules.conf.xml
#fi

patch -p0 < floor.patch

./bootstrap.sh
./configure --disable-core-odbc-support --disable-core-pgsql-support \
--without-python --without-erlang --without-java \
--prefix=/opt/freeswitch CFLAGS="-Wno-error -Og -ggdb" CXXFLAGS="-Wno-error -Og -ggdb"
# --prefix=/opt/freeswitch CFLAGS="-Wno-error -O3 -ggdb" CXXFLAGS="-Wno-error -Og -ggdb"

make -j $(nproc)
make install
Expand All @@ -154,52 +128,8 @@ cp -r /opt/freeswitch staging/opt
mkdir -p $DESTDIR/var/freeswitch/meetings
echo "This directory holds *.wav files for FreeSWITCH" > $DESTDIR/var/freeswitch/meetings/readme.txt

#mkdir -p $DESTDIR/etc/default
#cp freeswitch.default $DESTDIR/etc/default/freeswitch

if [ 1 == 0 ]; then
cp conf/acl.conf.xml $CONFDIR/autoload_configs
cp conf/opus.conf.xml $CONFDIR/autoload_configs

# Leave these here in case administrator wants to try other settings for Opus
#
# find $(DESTDIR)/opt/freeswitch/sounds -type d -name 32000 -exec rm -rf '{}' \;
# find $(DESTDIR)/opt/freeswitch/sounds -type d -name 48000 -exec rm -rf '{}' \;

cp conf/vars.xml $CONFDIR

cp conf/external.xml $CONFDIR/sip_profiles
cp conf/external-ipv6.xml $CONFDIR/sip_profiles
cp conf/internal-ipv6.xml $CONFDIR/sip_profiles
cp conf/internal.xml $CONFDIR/sip_profiles
cp conf/public.xml $CONFDIR/dialplan

rm -rf $CONFDIR/directory/default/*
cp conf/bbbuser.xml $CONFDIR/directory/default

cp conf/modules.conf.xml $CONFDIR/autoload_configs
cp conf/conference.conf.xml $CONFDIR/autoload_configs
cp conf/switch.conf.xml $CONFDIR/autoload_configs
# cp conf/verto.conf.xml $CONFDIR/autoload_configs

rm -rf $CONFDIR/dialplan/default/*
rm -rf $CONFDIR/dialplan/public/*

cp conf/bbb_conference.xml $CONFDIR/dialplan/default
cp conf/bbb_echo_test.xml $CONFDIR/dialplan/default
cp conf/bbb_echo_to_conference.xml $CONFDIR/dialplan/default

cp conf/default.xml $CONFDIR/dialplan

cp conf/bbb_sip.xml $CONFDIR/dialplan/public
cp conf/bbb_webrtc.xml $CONFDIR/dialplan/public

mkdir -p $CONFDIR/tls

else
rm -rf $CONFDIR/*
cp -r config/freeswitch/conf/* $CONFDIR
fi

pushd $DESTDIR/opt/freeswitch
ln -s ./etc/freeswitch conf
Expand Down
4 changes: 2 additions & 2 deletions freeswitch.placeholder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ mkdir freeswitch
cd freeswitch
git init
git remote add origin https://github.com/signalwire/freeswitch.git
git fetch --depth 1 origin 5c6fd51c115f4029926197095d436d527277c0e2
git fetch --depth 1 origin master
git checkout FETCH_HEAD
cp -r ../bbb-voice-conference/config .
cp -r ../bbb-voice-conference/config .

0 comments on commit 45d848c

Please sign in to comment.