From fc58f4002434d6ab3ccda864ae24792e466fd0fd Mon Sep 17 00:00:00 2001 From: emak Date: Sat, 27 Aug 2022 00:37:40 -0400 Subject: [PATCH] Add ability to build master branch Adds the ability to build mater branch by setting the existing variable `$switch_branch` to `master` in config.sh --- debian/resources/switch/source-release.sh | 50 +++++++++++++---------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/debian/resources/switch/source-release.sh b/debian/resources/switch/source-release.sh index 8dc6bb8..72c8f91 100755 --- a/debian/resources/switch/source-release.sh +++ b/debian/resources/switch/source-release.sh @@ -76,34 +76,42 @@ if [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then ldconfig fi -echo "Using version $switch_version" cd /usr/src -#git clone -b v1.8 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch -#1.8 and older -if [ $(echo "$switch_version" | tr -d '.') -lt 1100 ]; then - wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.zip - rm -R freeswitch - unzip freeswitch-$switch_version.zip - mv freeswitch-$switch_version freeswitch +#check for master +if [ $switch_branch = "master" ]; then + #master branch + echo "Using version master" + rm -r /usr/src/freeswitch + git clone https://github.com/signalwire/freeswitch.git cd /usr/src/freeswitch + ./bootstrap.sh -j fi -#1.10.0 and newer -if [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then - wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.-release.zip - unzip freeswitch-$switch_version.-release.zip - rm -R freeswitch - mv freeswitch-$switch_version.-release freeswitch - cd /usr/src/freeswitch +#check for stable release +if [ $switch_branch = "stable" ]; then + echo "Using version $switch_version" + #1.8 and older + if [ $(echo "$switch_version" | tr -d '.') -lt 1100 ]; then + wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.zip + rm -R freeswitch + unzip freeswitch-$switch_version.zip + mv freeswitch-$switch_version freeswitch + cd /usr/src/freeswitch + fi + + #1.10.0 and newer + if [ $(echo "$switch_version" | tr -d '.') -gt 1100 ]; then + wget http://files.freeswitch.org/freeswitch-releases/freeswitch-$switch_version.-release.zip + unzip freeswitch-$switch_version.-release.zip + rm -R freeswitch + mv freeswitch-$switch_version.-release freeswitch + cd /usr/src/freeswitch + #apply patch + patch -u /usr/src/freeswitch/src/mod/databases/mod_pgsql/mod_pgsql.c -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/mod_pgsql.patch + fi fi -# bootstrap is needed if using git -#./bootstrap.sh -j - -#apply patch -patch -u /usr/src/freeswitch/src/mod/databases/mod_pgsql/mod_pgsql.c -i /usr/src/fusionpbx-install.sh/debian/resources/switch/source/mod_pgsql.patch - # 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_av:formats/mod_av:'