Merge remote-tracking branch 'upstream/master'

pull/7/head
PrajwalaNagaraj 2020-10-28 22:59:54 -04:00
commit e82d950f90
4 changed files with 83 additions and 59 deletions

View File

@ -3,6 +3,7 @@ import sys
sys.path.append('../')
from scripts.Link import Link
import subprocess
import os
class EvtTools:
@ -28,24 +29,24 @@ class EvtTools:
help="Install openfire server.")
parser.add_argument("--build_docker", action="store_true", default=False, dest="dkrimg",
help="Builds the docker image if you have already built the debian package.")
parser.add_argument("--build_webrtc", action="store_true", default=False, dest="webrtc",
parser.add_argument("--build_wrtc", action="store_true", default=False, dest="webrtc",
help="Clones and builds the webrtc libraries for ubuntu and returns a debug build.")
parser.add_argument("--build_webrtc_release", action="store_true", default=False, dest="webrtc_r",
parser.add_argument("--build_wrtc_rel", action="store_true", default=False, dest="webrtc_r",
help="Clones and builds the webrtc libraries for ubuntu and returns a release build.")
parser.add_argument("--build_webrtc_raspberry_debug", action="store_true", default=False, dest="webrtc_r_d",
parser.add_argument("--build_wrtc_rpi_dbg", action="store_true", default=False, dest="webrtc_r_d",
help="Clones and builds the webrtc libraries for raspberry and returns a debug build.")
parser.add_argument("--build_webrtc_raspberry_release", action="store_true", default=False, dest="webrtc_r_r",
parser.add_argument("--build_wrtc_rpi_rel", action="store_true", default=False, dest="webrtc_r_r",
help="Clones and builds the webrtc libraries for raspberry and returns a release build.")
parser.add_argument("--build_tincan", action="store_true", default=False, dest="tincan",
help="Builds the tincan debug executable for ubuntu. It assumes you have the webrtc "
"libraries already cloned or built")
parser.add_argument("--build_tincan_release", action="store_true", default=False, dest="tincan_r",
parser.add_argument("--build_tincan_rel", action="store_true", default=False, dest="tincan_r",
help="Builds the tincan release executable for ubuntu. It assumes you have the webrtc "
"libraries already cloned or built")
parser.add_argument("--build_tincan_raspberry_debug", action="store_true", default=False, dest="tincan_r_d",
parser.add_argument("--build_tincan_rpi_dbg", action="store_true", default=False, dest="tincan_r_d",
help="Builds the tincan debug executable for raspberry. It assumes you have the webrtc "
"libraries already cloned or built")
parser.add_argument("--build_tincan_raspberry_release", action="store_true", default=False, dest="tincan_r_r",
parser.add_argument("--build_tincan_rpi_rel", action="store_true", default=False, dest="tincan_r_r",
help="Builds the tincan release executable for raspberry. It assumes you have the webrtc "
"libraries already cloned or built")
parser.add_argument("--all", action="store_true", default=False, dest="all",
@ -57,57 +58,81 @@ class EvtTools:
link.sync(None)
def clean(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh clean"], shell=True)
def build_tools(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh deps"], shell=True)
def pull_src(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh src"], shell=True)
def tincan(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh tincan"], shell=True)
def debpak(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh debpak"], shell=True)
def testbed(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh testbed"], shell=True)
def venv(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh venv"], shell=True)
def xmpp(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh xmpp"], shell=True)
def build_docker(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh dkrimg"], shell=True)
def build_webrtc(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh build_webrtc"], shell=True)
def build_webrtc_release_ubuntu(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh build_webrtc_with_release_ubuntu"], shell=True)
def build_webrtc_debug_raspberry(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh build_webrtc_with_debug_raspberry_pi"], shell=True)
def build_webrtc_release_raspberry(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh build_webrtc_with_release_raspberry_pi"], shell=True)
def build_tincan(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh build_tincan"], shell=True)
def build_tincan_release_ubuntu(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh build_tincan_release_ubuntu"], shell=True)
def build_tincan_debug_raspberry(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh build_tincan_debug_raspberry"], shell=True)
def build_tincan_release_raspberry(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh build_tincan_release_raspberry"], shell=True)
def check_for_link(self):
if os.path.isfile("ev-tools.sh"):
return True
else:
print("Please run evt --sync and then retry the command.")
def all(self):
if self.check_for_link():
subprocess.run(["ev-tools.sh all"], shell=True)
def main():

View File

@ -47,16 +47,13 @@ fi
Workspace_root=`pwd`
cd "$Workspace_root"/EdgeVPNio
#mkdir -p ~/workspace
#cd ~/workspace
#assuming this script runs from a place a directory where all three -evio, tools,external exist
if [[ "$target_os" == "ubuntu" ]]; then
git clone -b "$platform" --single-branch https://github.com/EdgeVPNio/external.git
elif [[ "$target_os" == "raspberry-pi" ]]; then
git clone -b "$platform" --single-branch https://github.com/EdgeVPNio/external.git
fi
cd evio/tincan
export PATH="$Workspace_root"/EdgeVPNio/tools/bin:"$PATH"
#ubuntu debug build
if [ "$target_os" == "ubuntu" ] && [ "$debug_flag" = true ]; then
gn gen out/"$platform"/"$build_type" "--args=is_debug=$debug_flag target_sysroot_dir=\"\"$Workspace_root\"/EdgeVPNio/external\" use_debug_fission=false clang_base_path=\"\"$Workspace_root\"/EdgeVPNio/tools/llvm/bin"\"

View File

@ -1,7 +1,7 @@
#!/bin/bash
EVIO=https://github.com/EdgeVPNio/evio.git
#EXLIBS=https://github.com/ipop-project/3rd-Party-Libs.git
EXLIBS=https://github.com/ipop-project/3rd-Party-Libs.git
PY=python3.8
function install_build_tools
@ -24,30 +24,26 @@ function pull_src
cd $wd
}
function make_tincan
{
wd=$(pwd)
cd ../evio/tincan/trunk/build
make clean; make
cd $wd
}
function make_debpak
{
wd=$(pwd)
cp ../evio/controller/Controller.py debian-package/edge-vpnio/opt/edge-vpnio/ && \
mkdir -p debian-package/edge-vpnio/etc/opt/edge-vpnio/
cp ../evio/controller/template-config.json debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
cp -r ../evio/controller/modules/ ../evio/controller/framework/ debian-package/edge-vpnio/opt/edge-vpnio/ && \
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \
chmod 0664 debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \
chmod 0664 debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
cp ../evio/tincan/trunk/out/release/x86_64/tincan debian-package/edge-vpnio/opt/edge-vpnio/ && \
chmod 0775 debian-package/edge-vpnio/opt/edge-vpnio/tincan && \
cd debian-package/ && \
cd ../../..
mkdir -p out
cd $wd
cp ../debian-package ../../../out
cp ../evio/controller/Controller.py ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \
mkdir -p ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/
cp ../evio/controller/template-config.json ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
cp -r ../evio/controller/modules/ ../evio/controller/framework/ ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \
chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/framework/ && \
chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/framework/* && \
chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/modules/ && \
chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/modules/* && \
chmod 0664 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/Controller.py && \
chmod 0664 ../../../out/debian-package/edge-vpnio/etc/opt/edge-vpnio/config.json && \
cp ../evio/tincan/trunk/out/release/x86_64/tincan ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/ && \
chmod 0775 ../../../out/debian-package/edge-vpnio/opt/edge-vpnio/tincan && \
cd ../../../out/debian-package/ && \
./deb-gen && \
rm -rf edge-vpnio/opt/edge-vpnio/framework \
edge-vpnio/opt/edge-vpnio/modules \
@ -128,8 +124,8 @@ function do_clean
make clean;
cd $wd
#debian pak
cd debian-package/ && \
rm -ri ./../edge-vpnio_20.7_amd64.deb \
cd ../debian-package/ && \
rm -ri ./edge-vpnio_20.7_amd64.deb \
edge-vpnio/opt/edge-vpnio/framework \
edge-vpnio/opt/edge-vpnio/modules \
edge-vpnio/opt/edge-vpnio/tincan \
@ -240,9 +236,6 @@ case $1 in
src)
pull_src
;;
tincan)
build_tincan
;;
debpak)
make_debpak
;;

View File

@ -1,4 +1,13 @@
#!/bin/bash
sudo apt install -y python3.8 python3.8-dev python3.8-venv python3-pip
# ls /usr/bin/python*
# update-alternatives --display python
# sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
# sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 20
# sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 30
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 40
# update-alternatives --display python
# python -V
deactivate 2>/dev/null
python -m venv venv && \
source venv/bin/activate && \