setup.sh 866 Bytes
#!/bin/bash

ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')

if [ -f /etc/lsb-release ]; then
    . /etc/lsb-release
    OS=$DISTRIB_ID
    VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
    OS=Debian  # XXX or Ubuntu??
    VER=$(cat /etc/debian_version)
elif [ -f /etc/redhat-release ]; then
    OS=Redhat  # XXX or Centos??
    VER=$(cat /etc/redhat-release)
else
    OS=$(uname -s)
    VER=$(uname -r)
fi

echo "install poppler-utils (pdftotext)"
if ("$OS" == "Redhat"); then
     yum install poppler-utils
elif ("$OS" == "Debian"); then
    sudo apt-get install poppler-utils
else
    echo "unsupported distro"
    exit
fi

echo "install cpanm"
wget -O - http://cpanmin.us | perl - --self-upgrade


echo "install required libs"
cpanm Data::Dumper
cpanm XML::LibXML
cpanm XML::LibXSLT
cpanm File::Spec
cpanm JSON::Parse

echo "instalation complete"