From e4169513fc7adacce28ea39a7f1258293af87b6a Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sat, 14 May 2016 12:09:04 +0900 Subject: [PATCH] Fixed: compiled libevent2 in CentOS 6 i686 --- l2tp.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/l2tp.sh b/l2tp.sh index cffa4d6..baff024 100644 --- a/l2tp.sh +++ b/l2tp.sh @@ -9,6 +9,7 @@ export PATH #=======================================================================# cur_dir=`pwd` +libevent2_src_filename="libevent-2.0.22-stable" libevent2_rpm_filename="libevent2-2.0.22-1.el6.x86_64.rpm" libevent2_devel_rpm_filename="libevent2-devel-2.0.22-1.el6.x86_64.rpm" libreswan_filename="libreswan-3.17" @@ -309,9 +310,22 @@ compile_install(){ tar -zxf ${libreswan_filename}.tar.gz if centosversion 6; then - download_file "${libevent2_rpm_filename}" - download_file "${libevent2_devel_rpm_filename}" - rpm -ivh --force ${libevent2_rpm_filename} ${libevent2_devel_rpm_filename} + if is_64bit;then + download_file "${libevent2_rpm_filename}" + download_file "${libevent2_devel_rpm_filename}" + rpm -ivh --force ${libevent2_rpm_filename} ${libevent2_devel_rpm_filename} + else + download_file "${libevent2_src_filename}.tar.gz" + tar -zxf ${libevent2_src_filename}.tar.gz + cd ${libevent2_src_filename} + ./configure + make && make install + if [ $? -eq 0 ]; then + ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5 + else + echo "libevent2 install failed..." + fi + fi fi cd ${cur_dir}/l2tp/${libreswan_filename}