#!/bin/bash Json="JSON-2.90.tar.gz" Expect="Expect-1.32.tar.gz" IO="IO-Tty-1.12.tar.gz" for rpm in perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker gcc gcc-c++ do rpm -q ${rpm} &>/dev/null || (echo "install $rpm,wait.." && yum -y install ${rpm} &>/dev/null) if [ $? -ne 0 ];then echo "Install $rpm fail,please check it" exit 0 fi done for software in ${Json} ${Expect} ${IO} do cd /usr/local/src rsync -ar rsync://[email protected]/upload/${software} . tar -xf ${software} && softwaredir=`echo ${software} | sed ‘s/\.tar.gz//g‘` && cd ${softwaredir} perl Makefile.PL >/dev/null 2>&1 make >/dev/null 2>&1 make install >/dev/null 2>&1 cd /usr/local/src && rm -rf ${software} ${softwaredir} done cat >test.pl <<EOF #!/usr/bin/perl use JSON; use Expect; EOF /usr/bin/perl test.pl if [ $? -eq 0 ];then echo "Install OK" else echo "Install Fail" fi
时间: 2024-11-10 12:08:38