#!/usr/bin/perl
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# bos720 src/bos/usr/lpp/bosinst/samples/AE/setup.pl 1.1 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2008,2009 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 

# @(#)31        1.1  src/bos/usr/lpp/bosinst/samples/AE/setup.pl, bosinst, bos720 3/30/09 13:41:09

if (-e 'RPMS')
{
  while (<RPMS/*.rpm>)
  {
    `rpm --install $_`;
  }
}

my $result = `ar -vt /usr/lib/libxml2.a | grep libxml2.so.2 | wc -l`;
if ($result == 0)
{
  `rm libxml2.a` if (-e 'libxml2.a');
  `rm libxml2.shr.o` if (-e 'libxml2.shr.o');

  `slibclean`;

  `ar -xv /usr/lib/libxml2.a`;
  `mv libxml2.shr.o libxml2.so.2`;
  `ar -rv libxml2.a libxml2.so.2`;

  `rm libxml2.so.2` if (-e 'libxml2.so.2');

  use Env qw(LIBPATH);
  if ($Env{'LIBPATH'})
  {
    $Env{'LIBPATH'} .= ':.';
  }
  else
  {
    $Env{'LIBPATH'} .= '.';
  }

  #
  # print "LIBPATH=$Env{'LIBPATH'}\n";
}
