Chinaunix首页 | 论坛 | 博客
  • 博客访问: 57525
  • 博文数量: 20
  • 博客积分: 101
  • 博客等级: 民兵
  • 技术积分: 125
  • 用 户 组: 普通用户
  • 注册时间: 2011-12-09 00:54
文章分类
文章存档

2012年(3)

2011年(17)

分类:

2011-12-09 00:56:19

#! /bin/bash
#mv /root/cpan/mysql-mmm-* /root
pathname="/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD"
cpanpath=/root/cpan
echo "/usr/local/mysql/lib/mysql/" >> /etc/ld.so.conf
ldconfig
file1="DBD-mysql-4.020.tar.gz"
file2="perl-DBI-1.52-2.el5.i386.rpm"
ls $cpanpath > /root/file
while read i
do
        file3=$(rpm -qa perl-DBI |awk -F "1" '{print $1}')
        if [ "$file3" != "perl-DBI-" ]
        then
                rpm -ivh $cpanpath/$i
                sleep 2
#                mv /root/cpan/perl-DBI* /root
        else
                if [ -d $pathname ]
                then
                        tar xf $cpanpath/$i -C /tmp && cd /tmp/$(echo $i |awk -F ".tar" '{print $1}')

                        perl Makefile.PL && make test && make install
                        mv $cpanpath/$i /root
                else
                        if [ "$i" = "$file1" ]
                        then
                                tar xf $cpanpath/$i -C /tmp && cd /tmp/$(echo $i |awk -F ".tar" '{print $1}')
                                perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql && make test && make install  && mv $cpanpath/$i /root
                                continue
                        fi
                fi
        fi

done < /root/file

for j in `ls /root/cpan`
do
         tar xf $cpanpath/$j -C /tmp && cd /tmp/$(echo $j |awk -F ".tar" '{print $1}')
         perl Makefile.PL && make test && make install
         mv $cpanpath/$j /root
done

tar xf /root/mysql-mmm* -C /tmp && cd /tmp/mysql-mmm* && make install
rm -rf /root/file


阅读(966) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~