#!/bin/sh
# @function install linuxlib
function InstallLuaLib()
{
    ShowResult "[green]正在安装Lua lib... [/green]" 1
    
    # install
    eval cd ${_PATH_COMPILATION_} ${_SYS_SHOW_INSTALL_DETAILS_}
    eval rm -rf liblua* ${_SYS_SHOW_INSTALL_DETAILS_}
    libluapath=/usr/local/lib/lua/
    CPE_LIB_PATH=/usr/local/lib/cpe
    unzip ${_PATH_SOFTWARE_}/liblua.zip ${_SYS_SHOW_INSTALL_DETAILS_}
    cd liblua ${_SYS_SHOW_INSTALL_DETAILS_}
    mkdir -p ${libluapath} ${_SYS_SHOW_INSTALL_DETAILS_}
    cp -rf 5.4 ${libluapath} ${_SYS_SHOW_INSTALL_DETAILS_}
    mkdir -p ${CPE_LIB_PATH} ${_SYS_SHOW_INSTALL_DETAILS_}
    cp -rf toolkit/libs/* ${CPE_LIB_PATH} ${_SYS_SHOW_INSTALL_DETAILS_}
    sed -i '/\/usr\/local\/lib\/lua\/5.4/d' /etc/ld.so.conf ${_SYS_SHOW_INSTALL_DETAILS_}
    sed -i '$a /usr/local/lib/lua/5.4' /etc/ld.so.conf ${_SYS_SHOW_INSTALL_DETAILS_}
    sed -i '/\/usr\/local\/lib\/cpe/d' /etc/ld.so.conf ${_SYS_SHOW_INSTALL_DETAILS_}
    sed -i '$a '$CPE_LIB_PATH'' /etc/ld.so.conf ${_SYS_SHOW_INSTALL_DETAILS_}
    ldconfig
    ShowStatus $?
}