Blame view

ingester/setup.sh 866 Bytes
9d00822b4   Paulo Gra├ža   Initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  #!/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"