Skip to content

Commit

Permalink
update libsodium & libmbedtls install prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Teddysun <[email protected]>
  • Loading branch information
teddysun committed Mar 3, 2017
1 parent b5fb93e commit 9929eff
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 37 deletions.
21 changes: 11 additions & 10 deletions shadowsocks-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
29 changes: 13 additions & 16 deletions shadowsocks-libev-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 5 additions & 11 deletions shadowsocks-libev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 9929eff

Please sign in to comment.