summaryrefslogtreecommitdiffstats
path: root/packaging/dpkg/default_files/preinst
blob: f31c659686a01efaf4e0fe6b89a820853fddc96c (plain) (blame)
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
#!/bin/sh

if [ "$1" = "install" ]; then
  MISSING=0
  MISSING_MODULES=""
  
  echo ""
  echo "  Preparing installation of OpenSLX! \n"
  echo "  Checking for required perl Modules:"
  for m in Carp Clone Config::General Cwd DBI Digest::MD5 Encode Fcntl \
    File::Basename File::Find File::Glob File::Path FindBin \
    Getopt::Long List::Util Pod::Usage POSIX Socket Storable \
    Sys::Hostname Term::ReadLine ; do 
               
    echo -n "    * $m  .. "
    if ! perl -e "use $m" 2>>/dev/null ; then
      echo "not found"; 
      $MISSING=1;
      $MISSING_MODULES="$MISSING_MODULES $m";
    else 
       echo "found"
    fi; 
  done;

  if [ $MISSING -gt 0 ]; then
    echo "  Some perl Modules couldn't be found:"; 
    echo "   $MISSING_MODULES";
    echo "  Install them with cpan / aptitude and try again .. \n";
    exit 1;
  else 
    echo "  All checks successfull. Continue with installation."
    exit 0;
  fi;
fi;