(一)将所需要用到的文件制作成一个压缩包
cd /home
tar zcvf SMS.tar.gz SMS
(二)编写安装包中将要执行的服务器安装配置shell脚本:sms_install.sh
#!/bin/sh
#1.提取出tar.gz包
LINES=73
tar_name="/home/SMS.tar.gz"
tail -n +${LINES} $0 > ${tar_name}
#2.解压tar.gz包
cd /home
tar zxvf ${tar_name}
if [ "$?" -ne 0 ];then
exit 100
fi
#3.拷贝boost相关库文件
boost_lib_src="/home/SMS/boost"
boost_lib_dst="/usr/local/include"
cp -r ${boost_lib_src} ${boost_lib_dst}
#4.拷贝mysql相关库文件
mysql_lib_src="/home/SMS/libmysql"
mysql_lib_dst="/lib64"
cp ${mysql_lib_src}/libmysql* ${mysql_lib_dst}
#5.配置SMS相关库文件
sms_lib_src="/home/SMS/bin"
sms_lib_dst="/lib64"
cp ${sms_lib_src}/*.so ${sms_lib_dst}
cp ${sms_lib_src}/*.a ${sms_lib_dst}
#6.增加可执行文件的权限
sms_server="/