small tweaks to fix/cleanup install.sh

This commit is contained in:
Blake Harnden 2020-03-05 11:44:13 -08:00
parent f826a4c5e8
commit 105dd4ad7b

View file

@ -7,10 +7,6 @@ function install_python_depencencies() {
sudo python3 -m pip install -r daemon/requirements.txt sudo python3 -m pip install -r daemon/requirements.txt
} }
function install_python_dev_dependencies() {
sudo python3 -m pip install pipenv grpcio-tools
}
function install_ospf_mdr() { function install_ospf_mdr() {
rm -rf /tmp/ospf-mdr rm -rf /tmp/ospf-mdr
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr /tmp/ospf-mdr git clone https://github.com/USNavalResearchLaboratory/ospf-mdr /tmp/ospf-mdr
@ -42,8 +38,6 @@ function install_dev_core() {
sudo make install sudo make install
cd - cd -
cd daemon cd daemon
pipenv install --dev
cd -
} }
# detect os/ver for install type # detect os/ver for install type
@ -70,8 +64,12 @@ shift $((OPTIND - 1))
case ${os} in case ${os} in
"ubuntu") "ubuntu")
echo "Installing CORE for Ubuntu" echo "Installing CORE for Ubuntu"
sudo apt install -y automake pkg-config gcc libev-dev ebtables gawk iproute2 \ echo "installing core system dependencies"
python3.6 python3.6-dev python3-pip python3-tk tk libtk-img ethtool libtool libreadline-dev autoconf sudo apt install -y automake pkg-config gcc libev-dev ebtables iproute2 \
python3.6 python3.6-dev python3-pip python3-tk tk libtk-img ethtool autoconf
python3 -m pip install grpcio-tools
echo "installing ospf-mdr system dependencies"
sudo apt install -y libtool gawk libreadline-dev
install_ospf_mdr install_ospf_mdr
if [[ -z ${dev} ]]; then if [[ -z ${dev} ]]; then
echo "normal install" echo "normal install"
@ -80,23 +78,32 @@ case ${os} in
install_core install_core
else else
echo "dev install" echo "dev install"
install_python_dev_dependencies python3 -m pip install pipenv
build_core build_core
install_dev_core install_dev_core
python3 -m pipenv install --dev
fi fi
;; ;;
"centos") "centos")
echo "Installing CORE for CentOS"
echo "installing core system dependencies"
sudo yum install -y automake pkgconf-pkg-config gcc gcc-c++ libev-devel iptables-ebtables iproute \ sudo yum install -y automake pkgconf-pkg-config gcc gcc-c++ libev-devel iptables-ebtables iproute \
python36 python36-devel python3-pip python3-tkinter tk ethtool libtool readline-devel autoconf gawk python36 python36-devel python3-pip python3-tkinter tk ethtool autoconf
python3 -m pip install grpcio-tools
echo "installing ospf-mdr system dependencies"
sudo apt install -y libtool gawk readline-devel
install_ospf_mdr install_ospf_mdr
if [[ -z ${dev} ]]; then if [[ -z ${dev} ]]; then
echo "normal install"
install_python_depencencies install_python_depencencies
build_core --prefix=/usr build_core --prefix=/usr
install_core install_core
else else
install_python_dev_dependencies echo "dev install"
sudo python3 -m pip install pipenv
build_core --prefix=/usr build_core --prefix=/usr
install_dev_core install_dev_core
sudo python3 -m pipenv install --dev
fi fi
;; ;;
*) *)