support ubuntu14.04

This commit is contained in:
程煊 2019-07-23 10:34:55 +08:00
parent bcedd87855
commit 8512e29e5d
2 changed files with 34 additions and 22 deletions

View File

@ -23,15 +23,15 @@ An automatic configuration program for vim
为防止vimplus显示乱码需设置mac终端字体为`Droid Sans Mono Nerd Font` 为防止vimplus显示乱码需设置mac终端字体为`Droid Sans Mono Nerd Font`
### Linux ### Linux 64-bit
#### 支持以下发行版 #### 支持以下发行版
- `Ubuntu16.04`及其以上系统 - `Ubuntu14.04`及其以上系统
- `Centos7`及其以上系统 - `Centos7`及其以上系统
- Debian
- Deepin - Deepin
- Linux Mint - Linux Mint
- Debian
- ArchLinux - ArchLinux
- openSUSE - openSUSE

View File

@ -6,22 +6,33 @@ function get_platform_type()
echo $(uname) echo $(uname)
} }
# 获取linux平台类型ubuntu还是centos # 获取linux平台类型
function get_linux_platform_type() function get_linux_platform_type()
{ {
if which zypper > /dev/null ; then if which zypper > /dev/null ; then
echo "opensuse" echo "opensuse"
elif which apt-get > /dev/null ; then elif which apt-get > /dev/null ; then
echo "ubuntu" # debian ubuntu系列 echo "ubuntu" # debian,ubuntu,deepin,linuxmint
elif which yum > /dev/null ; then elif which yum > /dev/null ; then
echo "centos" # centos redhat系列 echo "centos" # centos,redhat
elif which pacman > /dev/null; then elif which pacman > /dev/null; then
echo "archlinux" # archlinux系列 echo "archlinux"
else else
echo "invaild" echo "invaild"
fi fi
} }
# 判断是否是ubuntu14.04LTS版本
function is_ubuntu1404()
{
version=$(cat /etc/lsb-release | grep "DISTRIB_RELEASE")
if [ ${version} == "DISTRIB_RELEASE=14.04" ]; then
echo 1
else
echo 0
fi
}
# 判断是否是ubuntu16.04LTS版本 # 判断是否是ubuntu16.04LTS版本
function is_ubuntu1604() function is_ubuntu1604()
{ {
@ -33,7 +44,6 @@ function is_ubuntu1604()
fi fi
} }
# 判断是否是Debian版本 # 判断是否是Debian版本
function is_debian() function is_debian()
{ {
@ -125,7 +135,7 @@ function install_prepare_software_on_mac()
# 安装centos发行版必要软件 # 安装centos发行版必要软件
function install_prepare_software_on_centos() function install_prepare_software_on_centos()
{ {
sudo yum install -y ctags automake gcc gcc-c++ kernel-devel cmake python-devel python3-devel curl fontconfig ack bzip2 sudo yum install -y ctags automake gcc gcc-c++ kernel-devel cmake python-devel python3-devel curl fontconfig ack bzip2 git
compile_vim_on_centos compile_vim_on_centos
} }
@ -133,19 +143,21 @@ function install_prepare_software_on_centos()
function install_prepare_software_on_ubuntu() function install_prepare_software_on_ubuntu()
{ {
sudo apt-get update sudo apt-get update
sudo apt-get install -y ctags build-essential cmake python python-dev python3-dev fontconfig curl libfile-next-perl ack-grep
ubuntu_1604=`is_ubuntu1604`
debian=`is_debian`
echo ${ubuntu_1604}
if [ ${ubuntu_1604} == 1 ]; then ubuntu1404=`is_ubuntu1404`
echo "Ubuntu 16.04 LTS" if [ ${ubuntu1404} == 1 ]; then
compile_vim_on_ubuntu sudo apt-get install -y cmake3
elif [ ${debian} == 1 ]; then else
echo "Debian" sudo apt-get install -y cmake
fi
sudo apt-get install -y ctags build-essential python python-dev python3-dev fontconfig curl libfile-next-perl ack-grep git
ubuntu1604=`is_ubuntu1604`
debian=`is_debian`
if [ ${ubuntu1404} == 1 ] || [ ${ubuntu1604} == 1 ] || [ ${debian} == 1 ]; then
compile_vim_on_ubuntu compile_vim_on_ubuntu
else else
echo "Not ubuntu 16.04 LTS"
sudo apt-get install -y vim sudo apt-get install -y vim
fi fi
} }
@ -153,14 +165,13 @@ function install_prepare_software_on_ubuntu()
# 安装archlinux发行版必要软件 # 安装archlinux发行版必要软件
function install_prepare_software_on_archlinux() function install_prepare_software_on_archlinux()
{ {
sudo pacman -S --noconfirm vim ctags automake gcc cmake python3 python2 curl ack sudo pacman -S --noconfirm vim ctags automake gcc cmake python3 python2 curl ack git
} }
# 安装opensuse发行版必要软件 # 安装opensuse发行版必要软件
function install_prepare_software_on_opensuse() function install_prepare_software_on_opensuse()
{ {
sudo zypper install -y vim ctags gcc gcc-c++ cmake python-devel python3-devel curl ack fontconfig sudo zypper install -y vim ctags gcc gcc-c++ cmake python-devel python3-devel curl ack fontconfig git ncurses5-devel
sudo ln -s /lib64/libtinfo.so.6.1 /lib64/libtinfo.so.5
} }
# 拷贝文件 # 拷贝文件
@ -281,6 +292,7 @@ function install_vimplus_on_mac()
print_logo print_logo
} }
# 开始安装vimplus
function begin_install_vimplus() function begin_install_vimplus()
{ {
copy_files copy_files