update libsodium & libmbedtls install prefix

Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
Teddysun 2017-03-03 21:57:27 +09:00
parent b5fb93e78a
commit 9929effac2
No known key found for this signature in database
GPG Key ID: 09BD4C080AD6C46D
3 changed files with 29 additions and 37 deletions

View File

@ -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() {

View File

@ -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

View File

@ -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}