11#! bin/bash
22tempBuildFolder=' deps'
33lsbCommand=' lsb_release'
4- lsbDebian= ' Debian'
4+ lsbDebianFamily=( " Debian Ubuntu Mint Kali " )
55lsbArch=' Arch'
66
77function PSM() {
@@ -21,7 +21,7 @@ PEM " This script will try to install some packages in your system."
2121PEM " Plase use it only in a development environment."
2222
2323while true ; do
24- read -p " Do you want to coninue ? (Yes/No):" yn
24+ read -p " Do you want to continue ? (Yes/No):" yn
2525 case $yn in
2626 [Yy]* ) break ;;
2727 [Nn]* ) exit ;;
4141
4242LSB_DISTRO=$( lsb_release -is)
4343
44- if [ $LSB_DISTRO == $lsbDebian ]; then
44+ if [[ " ${lsbDebianFamily[@]} " =~ " ${LSB_DISTRO} " ] ]; then
4545 LD_FLAGS=' /usr/lib/x86_64-linux-gnu/libcrypto.a'
4646 repoUpdate=' apt-get update'
4747elif [ $LSB_DISTRO == $lsbArch ]; then
@@ -70,8 +70,8 @@ printf " - Checking latest repos \n";
7070# ================================================
7171
7272printf " - Installing build dependencies \n" ;
73- if [ $LSB_DISTRO == $lsbDebian ]; then
74- INSTALL_DEPS_ERROR=$( { sudo apt-get install libssl1.0-dev gcc cmake git pkg-config -y > /dev/null; } 2>&1 )
73+ if [[ " ${lsbDebianFamily[@]} " =~ " ${LSB_DISTRO} " ] ]; then
74+ INSTALL_DEPS_ERROR=$( { sudo apt-get install libssl1.0-dev gcc cmake git pkg-config tcl -y > /dev/null; } 2>&1 )
7575elif [ $LSB_DISTRO == $lsbArch ]; then
7676 INSTALL_DEPS_ERROR=$( { sudo pacman -S --noconfirm base-devel cmake git pkg-config openssl tcl > /dev/null; } 2>&1 )
7777fi
@@ -140,8 +140,10 @@ printf " - Preparing build \n";
140140cd ./civetweb > /dev/null
141141printf " - Making install civetweb \n" ;
142142make slib > /dev/null
143- sudo cp include/* /usr/include/ > /dev/null
144- sudo cp libcivetweb.so* /usr/lib/ > /dev/null
143+ sudo cp include/* /usr/local/include/ > /dev/null
144+ sudo cp libcivetweb.so* /usr/local/lib/ > /dev/null
145+ make lib > /dev/null
146+ sudo cp libcivetweb.a /usr/local/lib > /dev/null
145147if [ $? -ne 0 ]; then
146148 PEM " Failed to make install civetweb" ;
147149 removeTempFolder3;
0 commit comments