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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
|
#! /usr/bin/perl
#@@@@@@@@@@@@@@@@@@@@@@@@@@@ author @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# @
# created by: Kyle Stork @
# created on: June 26, 2001 @
# created at: NCSA on the campus of the University of Illinois @
# @
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
use strict;
use Getopt::Long;
#
# Do a perl check for version >= 5.005. See 'gpt-translate-interpreter' should you
# need to alter the invocation path to a valid perl interpreter in the GPT front-end
# programs.
#
if ( ! ( defined eval "require 5.005" ) )
{
die "GPT requires at least Perl version 5.005";
}
#******************** subroutine section *************************
sub commands;
#sub commands executes the ./bootstrap ./configure make and
#make install for packages that do not need a globus flavor
sub commandswithflavor;
#sub commandswithflavor executes the ./bootstrap ./configure make
#and make install for packages that require a globus flavor
sub pod2usage;
#sub pod2usage informs the user if the -flavor and/or -location
#command are not present
#******************************************************************
my $flavor;
my $globus;
GetOptions( '-flavor=s' => \$flavor, '-location=s' => \$globus)
or pod2usage(1);
#$flavor is set to the globus flavor and will be passed
#into COMMANDSWITHFLAVOR.
#This allows for the flavor to be entered once, instead of
#the user being prompted for the flavor every time the
#subroutine COMMANDSWITHFLAVOR is called.
#$globus is set so that the path of the globus utilities can be
#entered once, and used to find where each package is stored
#this saves the user from having to enter the path of the
#globus software more than once
foreach $ARGV (@ARGV)
{ #open foreach
SWITCH:
{ #open switch
if($ARGV eq "package_management")
{ #open if
chdir
"$globus/packaging/package_management/"
or die "Cant cd to package_management:$!\n";
#if the directory package_management cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commands;
last SWITCH;
} #close if
if($ARGV eq "packaging_tools")
{ #open if
chdir
"$globus/packaging/packaging_tools/"
or die "Cant cd to packaging_tools:$!\n";
#if the directory packaging_tools cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commands;
last SWITCH;
} #close if
if($ARGV eq "common")
{ #open if
chdir
"$globus/common/source/"
or die "Cant cd to common:$!\n";
#if the directory common cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commandswithflavor;
last SWITCH;
} #close if
if($ARGV eq "core")
{ #open if
chdir
"$globus/core/source/"
or die "Cant cd to core:$!\n";
#if the directory core cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commandswithflavor;
last SWITCH;
} #close if
if($ARGV eq "client")
{ #open if
chdir
"$globus/gridftp/client/source/"
or die "Cant cd to client:$!\n";
#if the directory client cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commandswithflavor;
last SWITCH;
} #close if
if($ARGV eq "control")
{ #open if
chdir
"$globus/gridftp/control/source/"
or die "Cant cd to control:$!\n";
#if the directory control cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commandswithflavor;
last SWITCH;
} #close if
if($ARGV eq "ssl_utils")
{ #open if
chdir
"$globus/gsi/ssl_utils/source/"
or die "Cant cd to ssl_utils:$!\n";
#if the directory ssl_utils cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commandswithflavor;
last SWITCH;
} #close if
if($ARGV eq "gssapi")
{ #open if
chdir
"$globus/gsi/gssapi/source/"
or die "Cant cd to gssapi:$!\n";
#if the directory gssapi cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commandswithflavor;
last SWITCH;
} #close if
if($ARGV eq "gss_assist")
{ #open if
chdir
"$globus/gsi/gss_assist/source/"
or die "Cant cd to gss_assist:$!\n";
#if the directory gss_assist cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commandswithflavor;
last SWITCH;
} #close if
if($ARGV eq "io")
{ #open if
chdir
"$globus/io/source/"
or die "Cant cd to io:$!\n";
#if the directory io cannot be accessed, the
#script will die, and print an error message to STDOUT so
#that the user will know what package he or she still has
#to install
commandswithflavor;
last SWITCH;
} #close if
} #close switch
} #close foreach
#************************ subroutine definitions *************************
sub commands
{ #open commands
system("./bootstrap")==0 or die "bootstrap failed: $?";
print "Through bootstrap\n";
system("./configure")==0 or die "configure failed: $?";
print "Through configure\n";
system("make")==0 or die "make failed: $?";
print "Through make\n";
system("make install")==0 or die "make install failed: $?";
print "Through make install\n";
#NOTE: in the event that the installation fails,
#the print messages are here to help the user
#determine where the installation failed
} #close commands
sub commandswithflavor
{ #open commandswithflavor
system("./bootstrap")==0 or die "bootstrap failed: $?";
print "Through bootstrap\n";
system("./configure --with-flavor='$flavor'")==0 or die "configure
failed: $?";
print "Through configure\n";
system("make")==0 or die "make failed: $?";
print "Through make\n";
system("make install")==0 or die "make install failed: $?";
print "Through make install\n";
#NOTE: in the event that the installation fails,
#the print messages are here to help the user
#determine where the installation failed
} #close commandswithflavor
sub pod2usage
{ #open pod2usage
my $ex=shift;
print "ERROR: Please specify a build flavor: -flavor\n";
print " or specify a globus location: -location\n";
exit $ex;
} #close pod2usage
|