编译安装perl

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34889607/article/details/81514043

完全编译安装perl,及其模块。

在rhel6.5上做的测试,但是个人感觉在centos7上也是可行的。

安装包下载:

注意:需要把安装包解压放到/opt目录下,给脚本添加执行权限。

#!/bin/bash
# the script to install perl, YAML, YAML::XS, YAML::Syck, YAML::Tiny, YAML::Active, IO::YAML, Config::YAML
# date: 2018-8-3
# version 1.2
# by hy

# install perl 5.28
cd /opt/perl/tar_install/tar
tar xf perl-5.28.0.tar.gz
cd perl-5.28.0
./configure.gnu -des -Dprefix=/usr/local/perl -Dusethreads -Uversiononly
make && make install
mv /usr/bin/perl /usr/bin/perl.old
ln /usr/local/perl/bin/perl /usr/bin/perl

## install YAML need Test::Deep, Test::YAML;
## while Test::YAML need Test::Base;
## and Test::Base need Algorithm::Diff, Spiffy, Text::Diff;

# install Test::Deep
cd /opt/perl/tar_install/tar
tar xf Test-Deep-1.128.tar.gz
cd Test-Deep-1.128
perl Makefile.PL
make && make install

# install Algorithm::Diff
cd /opt/perl/tar_install/tar
tar xf Algorithm-Diff-1.1903.tar.gz
cd Algorithm-Diff-1.1903
perl Makefile.PL
make && make install

# install Spiffy
cd /opt/perl/tar_install/tar
tar xf Spiffy-0.46.tar.gz
cd Spiffy-0.46
perl Makefile.PL
make && make install

# install Text::Diff
cd /opt/perl/tar_install/tar
tar xf tar -xf Text-Diff-1.45.tar.gz
cd tar -xf Text-Diff-1.45
perl Makefile.PL
make && make install

# install Test::Base
cd /opt/perl/tar_install/tar
tar xf Test-Base-0.89.tar.gz
cd Test-Base-0.89
perl Makefile.PL
make && make install

# install Test::YAML
cd /opt/perl/tar_install/tar
tar xf Test-YAML-1.07.tar.gz
cd Test-YAML-1.07
perl Makefile.PL
make && make install

# install YAML
cd /opt/perl/tar_install/tar
tar xf YAML-1.26.tar.gz
cd YAML-1.26
perl Makefile.PL
make && make install

# install YAML::XS
cd /opt/perl/tar_install/tar
tar xf YAML-LibYAML-0.72.tar.gz
cd YAML-LibYAML-0.72
perl Makefile.PL
make && make install

# install YAML::Syck
cd /opt/perl/tar_install/tar
tar xf YAML-Syck-1.30.tar.gz
cd YAML-Syck-1.30
perl Makefile.PL
make && make install

# install YAML::Tiny
cd /opt/perl/tar_install/tar
tar xf YAML-Tiny-1.73.tar.gz
cd YAML-Tiny-1.73
perl Makefile.PL
make && make install

## install YAML::Active need Class::Accessor::Complex;
## while Class::Accessor::Complex need Class::Accessor, Class::Accessor::Installer, Data::Miscellany, List::MoreUtils;
## and Class::Accessor::Installer need Sub::Name, UNIVERSAL::require;
## and List::MoreUtils need Exporter::Tiny, List::MoreUtils::XS;

# install Class::Accessor
cd /opt/perl/tar_install/tar
tar xf Class-Accessor-0.51.tar.gz
cd Class-Accessor-0.51
perl Makefile.PL
make && make install

# install Sub::Name
cd /opt/perl/tar_install/tar
tar xf Sub-Name-0.21.tar.gz
cd Sub-Name-0.21
perl Makefile.PL
make && make install
UNIVERSAL::require

# install UNIVERSAL::require
cd /opt/perl/tar_install/tar
tar xf UNIVERSAL-require-0.18.tar.gz
cd UNIVERSAL-require-0.18
perl Makefile.PL
make && make install

# install Class::Accessor::Installer
cd /opt/perl/tar_install/tar
tar xf Class-Accessor-Installer-1.100880.tar.gz
cd Class-Accessor-Installer-1.100880
perl Makefile.PL
make && make install

# install Data::Miscellany
cd /opt/perl/tar_install/tar
tar xf Data-Miscellany-1.100850.tar.gz
cd Data-Miscellany-1.100850
perl Makefile.PL
make && make install

# install Exporter::Tiny
cd /opt/perl/tar_install/tar
tar xf Exporter-Tiny-1.002001.tar.gz
cd Exporter-Tiny-1.002001
perl Makefile.PL
make && make install

# install List::MoreUtils::XS
cd /opt/perl/tar_install/tar
tar xf List-MoreUtils-XS-0.428.tar.gz
cd List-MoreUtils-XS-0.428
perl Makefile.PL
make && make install

# install List::MoreUtils
cd /opt/perl/tar_install/tar
tar xf List-MoreUtils-0.428.tar.gz
cd List-MoreUtils-0.428
perl Makefile.PL
make && make install

# install Class::Accessor::Complex
cd /opt/perl/tar_install/tar
tar xf Class-Accessor-Complex-1.100880.tar.gz
cd Class-Accessor-Complex-1.100880
perl Makefile.PL
make && make install

# install YAML::Active
cd /opt/perl/tar_install/tar
tar xf YAML-Active-1.100810.tar.gz
cd YAML-Active-1.100810
perl Makefile.PL
make && make install

## install IO::YAML need IO::Scalar;

# install IO::Scalar
cd /opt/perl/tar_install/tar
tar xf IO-stringy-2.111.tar.gz
cd IO-stringy-2.111
perl Makefile.PL
make && make install

# install IO::YAML
cd /opt/perl/tar_install/tar
tar xf IO-YAML-0.10.tar.gz
cd IO-YAML-0.10
perl Makefile.PL
make && make install

# install Config::YAML
cd /opt/perl/tar_install/tar
tar xf Config-YAML-1.42.tar.gz
cd Config-YAML-1.42
perl Makefile.PL
make && make install

# test
perl -v

# test YAML
perl -le "use YAML"
if [ $? -eq 0 ]
then
    echo -e "\033[34mYAML is ok.\033[0m"
else
    echo -e "\033[33mYAML is failed.\033[0m"
fi

# test YAML::XS
perl -le "use YAML::XS"
if [ $? -eq 0 ]
then
    echo -e "\033[34mYAML::XS is ok.\033[0m"
else
    echo -e "\033[33mYAML::XS is failed.\033[0m"
fi

# test YAML::Syck
perl -le "use YAML::Syck"
if [ $? -eq 0 ]
then
    echo -e "\033[34mYAML::Syck is ok.\033[0m"
else
    echo -e "\033[33mYAML::Syck is failed.\033[0m"
fi

# test YAML::Tiny
perl -le "use YAML::Tiny"
if [ $? -eq 0 ]
then
    echo -e "\033[34mYAML::Tiny is ok.\033[0m"
else
    echo -e "\033[33mYAML::Tiny is failed.\033[0m"
fi

# test YAML::Active
perl -le "use YAML::Active"
if [ $? -eq 0 ]
then
    echo -e "\033[34mYAML::Active is ok.\033[0m"
else
    echo -e "\033[33mYAML::Active is failed.\033[0m"
fi

# test IO::YAML
perl -le "use IO::YAML"
if [ $? -eq 0 ]
then
    echo -e "\033[34mIO::YAML is ok.\033[0m"
else
    echo -e "\033[33mIO::YAML is failed.\033[0m"
fi

# test Config::YAML
perl -le "use Config::YAML"
if [ $? -eq 0 ]
then
    echo -e "\033[34mConfig::YAML is ok.\033[0m"
else
    echo -e "\033[33mConfig::YAML is failed.\033[0m"
fi

echo -e "\033[32mNow you can use perl, YAML, YAML::XS, YAML::Syck, YAML::Tiny, YAML::Active, IO::YAML, Config::YAML.\033[0m"

猜你喜欢

转载自blog.csdn.net/qq_34889607/article/details/81514043