Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created September 24, 2012 20:45
Show Gist options
  • Select an option

  • Save fapestniegd/3778270 to your computer and use it in GitHub Desktop.

Select an option

Save fapestniegd/3778270 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -f /etc/redhat-release ] ;then
cat /etc/redhat-release
# yum groupinstall "Development Tools"
fi
if [ -f /etc/debian_version ] ;then
cat /etc/debian_version
# apt-get install build-essential
fi
#
# get rid of old install cruft, if any
#
if [ -d "${HOME}/perl5" ];then
rm -fr "${HOME}/perl5"
fi
if [ -d "${HOME}/local-lib-1.008004" ];then
rm -fr "${HOME}/local-lib-1.008004"
fi
#
# un-pack the source
#
if [ ! -f local-lib-1.008004.tar.gz ];then
wget http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz
fi
if [ ! -d local-lib-1.008004 ];then
tar xvzf local-lib-1.008004.tar.gz
fi
#
# build local::lib
#
(
cd local-lib-1.008004;
PERL_MM_USE_DEFAULT=1 perl Makefile.PL --bootstrap
make && make install
)
grep -q 'eval $(perl -I${HOME}/perl5/lib/perl5 -Mlocal::lib)' ~/.bashrc || \
echo 'eval $(perl -I${HOME}/perl5/lib/perl5 -Mlocal::lib)' >> ~/.bashrc
source ~/.bashrc
#
# install the library we want
#
PERL_MM_USE_DEFAULT=1 perl -I${HOME}/perl5/lib/perl5 -Mlocal::lib -MCPAN -e 'CPAN::install(YAML)'
PERL_MM_USE_DEFAULT=1 perl -I${HOME}/perl5/lib/perl5 -Mlocal::lib -MCPAN -e 'CPAN::install(Digest::SHA)'
PERL_MM_USE_DEFAULT=1 perl -I${HOME}/perl5/lib/perl5 -Mlocal::lib -MCPAN -e 'CPAN::install(Net::Amazon::S3)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment