Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/scripts/lib.sh

134 lines
3.7 KiB

7 years ago
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
7 years ago
curPath=`pwd`
rootPath=$(dirname "$curPath")
serverPath=$(dirname "$rootPath")
7 years ago
sourcePath=$serverPath/source/lib
7 years ago
libPath=$serverPath/lib
7 years ago
7 years ago
mkdir -p $sourcePath
7 years ago
mkdir -p $libPath
7 years ago
rm -rf ${libPath}/lib.pl
7 years ago
3 years ago
3 years ago
bash ${rootPath}/scripts/getos.sh
OSNAME=`cat ${rootPath}/data/osname.pl`
3 years ago
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
echo "${OSNAME}:${VERSION_ID}"
6 years ago
3 years ago
# system judge
3 years ago
if [ "$OSNAME" == "macos" ]; then
5 years ago
brew install libmemcached
brew install curl
brew install zlib
brew install freetype
brew install openssl
brew install libzip
3 years ago
elif [ "$OSNAME" == "opensuse" ];then
echo "opensuse lib"
elif [ "$OSNAME" == "arch" ];then
echo "arch lib"
3 years ago
elif [ "$OSNAME" == "freebsd" ];then
echo "freebsd lib"
3 years ago
elif [ "$OSNAME" == "centos" ];then
echo "centos lib"
3 years ago
elif [ "$OSNAME" == "fedora" ];then
echo "fedora lib"
elif [ "$OSNAME" == "alma" ];then
echo "alma lib"
3 years ago
elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then
3 years ago
apt install -y devscripts
3 years ago
apt install -y net-tools
3 years ago
apt install -y python3-dev
3 years ago
apt install -y autoconf
3 years ago
apt install -y gcc
3 years ago
3 years ago
apt install -y libffi-dev
3 years ago
apt install -y cmake automake make
3 years ago
3 years ago
apt install -y webp scons
3 years ago
apt install -y libwebp-dev
apt install -y lzma lzma-dev
apt install -y libunwind-dev
3 years ago
3 years ago
apt install -y libpcre3 libpcre3-dev
3 years ago
apt install -y openssl
3 years ago
apt install -y libssl-dev
3 years ago
3 years ago
apt install -y libmemcached-dev
3 years ago
apt install -y libsasl2-dev
3 years ago
apt install -y imagemagick
apt install -y libmagickwand-dev
3 years ago
3 years ago
apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev
3 years ago
apt install -y libgmp-dev libgmp3-dev libreadline-dev libxpm-dev
3 years ago
apt install -y dia pkg-config
apt install -y zlib1g-dev
3 years ago
apt install -y libjpeg-dev libpng-dev
3 years ago
apt install -y libfreetype6
3 years ago
apt install -y libjpeg62-turbo-dev
3 years ago
apt install -y libfreetype6-dev
3 years ago
apt install -y libevent-dev libncurses5-dev libldap2-dev
3 years ago
apt install -y libzip-dev
3 years ago
apt install -y libicu-dev
3 years ago
3 years ago
apt install -y build-essential
3 years ago
3 years ago
apt install -y libcurl4-openssl-dev
3 years ago
apt install -y curl libcurl4-gnutls-dev
#https://blog.csdn.net/qq_36228377/article/details/123154344
3 years ago
# ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
3 years ago
if [ ! -d /usr/include/curl ];then
ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/curl
fi
3 years ago
3 years ago
apt install -y graphviz bison re2c flex
3 years ago
apt install -y libsqlite3-dev
3 years ago
apt install -y libonig-dev
3 years ago
3 years ago
apt install -y perl g++ libtool
3 years ago
apt install -y libxslt1-dev
3 years ago
3 years ago
apt install -y libmariadb-dev
3 years ago
#apt install -y libmysqlclient-dev
3 years ago
apt install -y libmariadb-dev-compat
3 years ago
#apt install -y libmariadbclient-dev
5 years ago
else
3 years ago
echo "OK"
5 years ago
fi
3 years ago
#面板需要的库
if [ ! -f /usr/local/bin/pip3 ];then
python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
fi
pip install --upgrade pip
pip3 install --upgrade setuptools
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
pip3 install gevent-websocket==0.10.1
pip3 install flask-caching==1.10.1
pip3 install mysqlclient
3 years ago
if [ ! -f /www/server/mdserver-web/bin/activate ];then
cd /www/server/mdserver-web && python3 -m venv .
3 years ago
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate
else
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate
fi
pip install --upgrade pip
pip3 install --upgrade setuptools
pip3 install -r /www/server/mdserver-web/requirements.txt
pip3 install gevent-websocket==0.10.1
pip3 install flask-caching==1.10.1
pip3 install mysqlclient