#! /bin/ksh # # installation script for gpt-1.0 Globus Grid Packaging Technology # if [[ $1 = "" ]] then kit_location="`/usr/bin/dirname $0`/.." else kit_location=$1 fi # Because the update procedure potentially (very high likelyhood) # needs to replace shared libraries or other package dependent rpm's # (temporarily breaking packages), we can only perform those upgrades # by making use of the --nodeps flag, otherwhise RPM will refuse to # install them. The --nodeps flag should only be necessary while we're # called via the upgrade-packages.ksh script. It is quite possible # that this particular package does not require the --nodeps flag # during the upgrade procedure, but rather than chance an oversight # (it is difficult to test all permutations as the upgrade procedure # is performed on a random list), the --nodeps flag is employed for # virtually all packages during the upgrade step. if [[ $3 = "Upgrade" ]] then depsflag="--nodeps" fi # # First let's make sure we have superuser privilege # if [ `whoami` != "root" ] then echo "You must be superuser to run this script" exit 1 fi # # We need to ensure that it's a V5.1 or V5.1A system... # OS_VERSION=`/usr/sbin/sizer -v | cut -d" " -f 4 | cut -b 2-5` if [[ $OS_VERSION < "5.1" ]] then echo "You need Tru64 UNIX V5.1 to install any of the" echo "rpm kits from this CD-ROM!" echo "Please refer to the /mnt/README file for instructions" echo exit 1 fi # let's make sure that there's a /tmp directory if [[ ! -d /tmp ]] then echo "directory /tmp was not found." echo "This script requires a writable /tmp directory" echo "Exiting gpt-1.0 installation script..." echo exit 1 fi if [[ ! -w /usr/tmp ]] then echo "directory /tmp is not writable." echo "This script requires a writable /tmp directory" echo "Exiting gpt-1.0 installation script..." echo exit 1 fi # let's make sure that there's a /usr/local directory if [[ ! -d /usr/local ]] then echo "directory /usr/local was not found." echo "rather than create a /usr/local directory for you," echo "you are advised to mount a separate (from /usr) 800Mb+ file system" echo "at /usr/local ." echo "Exiting gpt-1.0 installation script..." echo exit 1 fi if [[ ! -w /usr/local ]] then echo "directory /usr/local is not writable." echo "Exiting gpt-1.0 installation script..." echo exit 1 fi # Need to ensure that /usr/local is not an nfs mounted file system: /sbin/mount -t nfs | awk '$3=="/usr/local"{exit 1}' if [ $? != 0 ]; then echo "This script cannot install this kit to an NFS mounted file system." echo "Exiting gpt-1.0 installation script..." echo exit 1 fi # We don't want to look anywhere other than /usr/local/globus echo "Checking if gpt-1.0 is already installed..." if [[ -f /usr/local/globus/sbin/globus-install ]] then echo echo "gpt-1.0 is already installed on this system." echo "Exiting gpt-1.0 installation script..." echo exit fi # # Now let's check for required free space. # gpt-1.0 requires 7110656 bytes in /tmp # gpt-1.0 requires 843776 bytes in /usr/local space_avail="`/sbin/df /tmp | tail -1 | awk '{print $4}'`" let "space_avail=space_avail*512" if (( $space_avail < 7110656 )) then echo echo "The amount of required free space in /tmp to build and install" echo "gpt-1.0 on this system is: 7110656 bytes" echo echo "Sorry, you don't have enough space in /tmp to install gpt-1.0" echo echo "Exiting gpt-1.0 installation script..." echo exit 1 else Required_space=843776 space_avail="`/sbin/df /usr/local | tail -1 | awk '{print $4}'`" let "space_avail=space_avail*512" echo "The amount of required free space to install gpt-1.0" echo "on this system is: $Required_space bytes, leaving you with" let "Remaining_space=$space_avail-$Required_space" echo "$Remaining_space bytes free in your /usr/local file system" echo echo "Do you want to continue? [y/n]: \c" read answer echo if [ "$answer" = "n" ] || [ "$answer" = "N" ] then exit fi if [ "$answer" != "y" -a "$answer" != "Y" ] then echo "Response $answer is not recognized, " echo "Exiting gpt-1.0 installation script..." echo exit 1 fi fi # # Building and Installing gpt-1.0 kit... # echo echo "NOTE: This script will now unpack the gpt-1.0 sources in /tmp" echo "and build and install the software." echo "Please be patient..." echo cd /tmp/ gzip -dc $kit_location/GLOBUS/gpt-1.0.tar.gz | tar xf - cd gpt-1.0 GLOBUS_LOCATION=/usr/local/globus; export GLOBUS_LOCATION GPT_LOCATION=/usr/local/globus; export GPT_LOCATION CC=cc ./build_gpt if [[ -f /usr/local/globus/sbin/globus-install ]] then echo echo "gpt-1.0 is now installed on this system." echo echo " -----------------------------------------------------------" echo else echo echo "An unknown ERROR was encountered. This script FAILED to" echo "install gpt-1.0 on your system !!" echo echo exit fi echo echo "It is recommended that you allow this script to remove" echo "the /tmp/gpt-1.0 source directory." echo echo "Do you want to remove /tmp/gpt-1.0 ? [y/n]: \c" read answer echo if [ "$answer" = "n" ] || [ "$answer" = "N" ] then exit fi if [ "$answer" != "y" -a "$answer" != "Y" ] then echo "Response $answer is not recognized, " echo "Exiting gpt-1.0 installation script..." echo exit 1 fi cd /tmp rm -r /tmp/gpt-1.0 echo echo "the /tmp/gpt-1.0 directory has been removed." echo exit # Klaus2> df /tmp #Filesystem 512-blocks Used Available Capacity Mounted on #root_domain#root 1160528 160030 989584 14% / #Klaus2> gzip -dc ~/gpt-1.0.tar.gz| tar xf - # AFTER ./build_gpt # df /tmp #Filesystem 512-blocks Used Available Capacity Mounted on #root_domain#root 1160528 174142 975696 16% / # #before ./build_gpt #$ df /usr/local #Filesystem 512-blocks Used Available Capacity Mounted on #usr_domain#usr 18194128 8769928 9283168 49% /usr # #after ./build_gpt # df /usr/local #Filesystem 512-blocks Used Available Capacity Mounted on #usr_domain#usr 18194128 8772340 9281520 49% /usr