my $gpath = $ENV{GPT_LOCATION};
if (!defined($gpath))
{
  $gpath = $ENV{GLOBUS_LOCATION};

}
if (!defined($gpath))
{
   die "GPT_LOCATION or GLOBUS_LOCATION needs to be set before running this script"
}

@INC = (@INC, "$gpath/lib/perl");

require Grid::GPT::Setup;

my $metadata = new Grid::GPT::Setup(package_name => "globus_mds_common_setup");

my $globusdir = $ENV{GLOBUS_LOCATION};
my $setupdir = "$globusdir/setup/globus/";
print "\nCreating...\n";
print "         $globusdir/etc/grid-info.conf\n";
my $result = `$setupdir/setup-mds-common-scripts`;
$result = system("chmod 0644 $setupdir/grid-info.conf");
$result = system("cp grid-info.conf $globusdir/etc");

print "Done\n";
$metadata->finish();
