diff --git a/shadowsocks-all.sh b/shadowsocks-all.sh index ce4fa88..b91022d 100644 --- a/shadowsocks-all.sh +++ b/shadowsocks-all.sh @@ -490,11 +490,11 @@ install_prepare() { } install_libsodium() { - if [ ! -f /usr/local/lib/libsodium.a ]; then + if [ ! -f /usr/lib/libsodium.a ]; then cd ${cur_dir} tar zxf ${libsodium_file}.tar.gz cd ${libsodium_file} - ./configure && make && make install + ./configure --prefix=/usr && make && make install if [ $? -ne 0 ]; then echo -e "${red}Error:${plain} ${libsodium_file} install failed." install_cleanup @@ -503,17 +503,18 @@ install_libsodium() { else echo -e "${green}Info:${plain} ${libsodium_file} already installed." fi - - echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf - ldconfig } install_mbedtls() { - cd ${cur_dir} - tar xf ${mbedtls_file}-gpl.tgz - cd ${mbedtls_file} - make SHARED=1 CFLAGS=-fPIC - make install + if [ ! -f /usr/lib/libmbedtls.a ]; then + cd ${cur_dir} + tar xf ${mbedtls_file}-gpl.tgz + cd ${mbedtls_file} + make SHARED=1 CFLAGS=-fPIC + make DESTDIR=/usr install + else + echo -e "${green}Info:${plain} ${mbedtls_file} already installed." + fi } install_shadowsocks_python() { diff --git a/shadowsocks-libev-debian.sh b/shadowsocks-libev-debian.sh index 3ba01a9..1ce32d2 100644 --- a/shadowsocks-libev-debian.sh +++ b/shadowsocks-libev-debian.sh @@ -254,13 +254,9 @@ pre_install(){ download_files(){ cd ${cur_dir} - if [ -f ${shadowsocks_libev_ver}.tar.gz ]; then - echo "${shadowsocks_libev_ver}.tar.gz [found]" - else - if ! wget --no-check-certificate -O ${shadowsocks_libev_ver}.tar.gz ${download_link}; then - echo "Failed to download ${shadowsocks_libev_ver}.tar.gz" - exit 1 - fi + if ! wget --no-check-certificate -O ${shadowsocks_libev_ver}.tar.gz ${download_link}; then + echo "Failed to download ${shadowsocks_libev_ver}.tar.gz" + exit 1 fi if ! wget --no-check-certificate -O ${libsodium_file}.tar.gz ${libsodium_url}; then @@ -305,25 +301,26 @@ EOF # Install Shadowsocks-libev install_shadowsocks(){ - if [ ! -f /usr/local/lib/libsodium.a ]; then + if [ ! -f /usr/lib/libsodium.a ]; then cd ${cur_dir} tar zxf ${libsodium_file}.tar.gz cd ${libsodium_file} - ./configure && make && make install + ./configure --prefix=/usr && make && make install if [ $? -ne 0 ]; then echo "${libsodium_file} install failed!" exit 1 fi fi - echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf - ldconfig + if [ ! -f /usr/lib/libmbedtls.a ]; then + cd ${cur_dir} + tar xf ${mbedtls_file}-gpl.tgz + cd ${mbedtls_file} + make SHARED=1 CFLAGS=-fPIC + make DESTDIR=/usr install + fi - cd ${cur_dir} - tar xf ${mbedtls_file}-gpl.tgz - cd ${mbedtls_file} - make SHARED=1 CFLAGS=-fPIC - make install + ldconfig cd ${cur_dir} tar zxf ${shadowsocks_libev_ver}.tar.gz diff --git a/shadowsocks-libev.sh b/shadowsocks-libev.sh index de347fd..7ebe027 100644 --- a/shadowsocks-libev.sh +++ b/shadowsocks-libev.sh @@ -253,13 +253,9 @@ pre_install(){ download_files(){ cd ${cur_dir} - if [ -f ${shadowsocks_libev_ver}.tar.gz ]; then - echo "${shadowsocks_libev_ver}.tar.gz [found]" - else - if ! wget --no-check-certificate -O ${shadowsocks_libev_ver}.tar.gz ${download_link}; then - echo "Failed to download ${shadowsocks_libev_ver}.tar.gz" - exit 1 - fi + if ! wget --no-check-certificate -O ${shadowsocks_libev_ver}.tar.gz ${download_link}; then + echo "Failed to download ${shadowsocks_libev_ver}.tar.gz" + exit 1 fi if ! wget --no-check-certificate -O ${libsodium_file}.tar.gz ${libsodium_url}; then @@ -338,20 +334,18 @@ firewall_set(){ # Install Shadowsocks-libev install_shadowsocks(){ - if [ ! -f /usr/local/lib/libsodium.a ]; then + if [ ! -f /usr/lib/libsodium.a ]; then cd ${cur_dir} tar zxf ${libsodium_file}.tar.gz cd ${libsodium_file} - ./configure && make && make install + ./configure --prefix=/usr && make && make install if [ $? -ne 0 ]; then echo "${libsodium_file} install failed!" exit 1 fi fi - echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf ldconfig - cd ${cur_dir} tar zxf ${shadowsocks_libev_ver}.tar.gz cd ${shadowsocks_libev_ver}