diff --git a/build-and-install.sh b/build-and-install.sh new file mode 100755 index 0000000..ce43e7d --- /dev/null +++ b/build-and-install.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +source $(dirname $0)/common.source + +SDR=$1 +ROOT=`pwd` + +usage () { + echo "# - Usage: $0 radio-type" + echo "# - Valid radio types are: SDR1, USRP1, B100, B110, B200, B210, N200, N210" + exit 1 +} + +if [ "$EUID" -ne 0 ] + then echo "# - $(whoami) please run ${0}(me) as root" + # sudo $0 $SDR + exit 1 +fi + +if [ -z "$SDR" ]; then + echo "# - ERROR : radio type must be specified" + usage + exit 1 +fi + +./clone.sh +./build.sh $SDR asterisk +./build.sh $SDR liba53 + +cd ${ROOT}/libcoredumper +./build.sh LOCAL +sayAndDo "dpkg -i libcoredumper1_1.2.1-1_*.deb" +sayAndDo "dpkg -i libcoredumper-dev_1.2.1-1_*.deb" + +cd $ROOT +./build.sh $SDR subscriberRegistry +./build.sh $SDR smqueue +./build.sh $SDR openbts +./build.sh $SDR asterisk-config + +sayAndDo "find BUILDS -name range-asterisk_11.7.0.5_*.deb -exec dpkg -i {} \;" +sayAndDo "find BUILDS -name liba53_0.1_*.deb -exec dpkg -i {} \;" +sayAndDo "find BUILDS -name smqueue_5.0_*.deb -exec dpkg -i {} \;" +sayAndDo "find BUILDS -name openbts_5.0_*.deb -exec dpkg -i {} \;" +sayAndDo "find BUILDS -name range-asterisk-config_5.0_all.deb -exec dpkg -i {} \;" + +sayAndDo cp systemd-service-units-configuration/asterisk.service /etc/systemd/system/ +sayAndDo cp systemd-service-units-configuration/sipauthserve.service /etc/systemd/system/ +sayAndDo cp systemd-service-units-configuration/smqueue.service /etc/systemd/system/ +sayAndDo cp systemd-service-units-configuration/openbts.service /etc/systemd/system/ +sayAndDo systemctl daemon-reload + +sayAndDo cp ./NodeManager/nmcli.py /OpenBTS/ +sayAndDo chown -R asterisk:www-data /var/lib/asterisk + +exit 0 diff --git a/build.sh b/build.sh index 0f5622a..aa2c779 100755 --- a/build.sh +++ b/build.sh @@ -6,12 +6,12 @@ # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # See the COPYING file in the main directory for details. @@ -115,6 +115,7 @@ installIfMissing libreadline-dev installIfMissing libncurses5 installIfMissing libncurses5-dev installIfMissing pkg-config +installIfMissing libboost-all-dev # libsqliteodbc deps installIfMissing cdbs installIfMissing libsqlite0-dev diff --git a/systemd-service-units-configuration/asterisk.service b/systemd-service-units-configuration/asterisk.service new file mode 100644 index 0000000..edafd85 --- /dev/null +++ b/systemd-service-units-configuration/asterisk.service @@ -0,0 +1,16 @@ +[Unit] +Description=Asterisk PBX for OpenBTS +After=network.target +Documentation=man:asterisk(8) + +[Service] +Type=simple +Environment=statedir=/var/run/asterisk +Environment=LC_ALL=C +ExecStartPre=/bin/mkdir -p ${statedir} +ExecStart=/usr/sbin/asterisk -f -g +ExecStop=/usr/sbin/asterisk -rx 'core stop now' +ExecReload=/usr/sbin/asterisk -rx 'core reload' + +[Install] +WantedBy=multi-user.target diff --git a/systemd-service-units-configuration/openbts.service b/systemd-service-units-configuration/openbts.service new file mode 100644 index 0000000..719f2e1 --- /dev/null +++ b/systemd-service-units-configuration/openbts.service @@ -0,0 +1,10 @@ +[Unit] +Description=OpenBTS + +[Service] +Type=simple +ExecStart=/OpenBTS/OpenBTS +WorkingDirectory=/OpenBTS + +[Install] +WantedBy=multi-user.target diff --git a/systemd-service-units-configuration/sipauthserve.service b/systemd-service-units-configuration/sipauthserve.service new file mode 100644 index 0000000..18b5d4d --- /dev/null +++ b/systemd-service-units-configuration/sipauthserve.service @@ -0,0 +1,9 @@ +[Unit] +Description=OpenBTS SIP Authorization Service + +[Service] +Type=simple +ExecStart=/OpenBTS/sipauthserve + +[Install] +WantedBy=multi-user.target diff --git a/systemd-service-units-configuration/smqueue.service b/systemd-service-units-configuration/smqueue.service new file mode 100644 index 0000000..3d4f448 --- /dev/null +++ b/systemd-service-units-configuration/smqueue.service @@ -0,0 +1,9 @@ +[Unit] +Description=OpenBTS Store-and-Forward Short Message Service + +[Service] +Type=simple +ExecStart=/OpenBTS/smqueue + +[Install] +WantedBy=multi-user.target