/usr/share/perl5/Grid/GPT/Locations.pm is in grid-packaging-tools 3.6.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | package Grid::GPT::Locations;
my ($prefix, $globus_prefix, $exec_prefix, $bindir, $sbindir, $libdir);
my ($datarootdir, $datadir, $perlmoduledir, $gptdatadir);
my ($gptexecsharedir, $amdir, $pkg_confdir, $aclocaldir);
if (exists $ENV{GPT_LOCATION})
{
$prefix = $ENV{GPT_LOCATION};
}
else
{
$prefix = "/usr";
}
if (exists $ENV{GLOBUS_LOCATION})
{
$globus_prefix = $ENV{GLOBUS_LOCATION};
}
else
{
$globus_prefix = "/usr";
}
$exec_prefix = "${prefix}";
$bindir = "${exec_prefix}/bin";
$sbindir = "${exec_prefix}/sbin";
$libdir = "${exec_prefix}/lib";
$datarootdir = "${prefix}/share";
$datadir = "${prefix}/share";
$perlmoduledir = "/usr/share/perl5";
$gptdatadir = "${datadir}/globus/gpt";
$gptexecsharedir = "${datadir}/globus/gpt";
$amdir = "${datadir}/globus/amdir";
$pkg_confdir = "${datadir}/globus/gpt";
$aclocaldir = "${datadir}/globus/aclocal";
unshift(@INC, "${perlmoduledir}");
use strict;
use Carp;
use Cwd;
require Exporter;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
$VERSION = 0.01;
@ISA = qw(Exporter);
require Grid::GPT::FilelistFunctions;
sub new
{
my ($that, %args) = @_;
my $class = ref($that) || $that;
my $me = {
tmpdir => $args{'tmpdir'},
builddir => $args{'builddir'},
bindir => $args{'bindir'},
srcdir => $args{'srcdir'},
installdir => $args{'installdir'},
gpt_etcdir => undef,
gpt_amdir => undef,
gpt_aclocaldir => undef,
gptexecsharedir => undef,
pkgdir => undef,
coredir => undef,
bundledir => undef,
setupdir => undef,
pkg_confdir => undef
};
bless $me, $class;
$me->_init();
return $me;
}
sub _init {
my ($me) =@_;
$me->_init_installdirs();
$me->_init_builddir();
$me->_init_tmpdir();
$me->_init_gptdir();
for my $d ('tmpdir',
'builddir',
'bindir',
'srcdir',
'installdir',
'pkgdir',
'bundledir',
'setupdir') {
next if ! defined $me->{$d};
$me->{$d} = Grid::GPT::FilelistFunctions::abspath($me->{$d});
}
}
sub _init_gptdir {
my ($me) =@_;
$me->{'gpt_etcdir'} = "$gptdatadir";
$me->{'gpt_amdir'} = "$amdir";
$me->{'gpt_aclocaldir'} = "$aclocaldir";
$me->{'gptexecsharedir'} = "$gptexecsharedir";
}
sub _init_tmpdir {
my ($me) =@_;
my $tmpdir= defined $me->{'tmpdir'} ? $me->{'tmpdir'} : "/tmp";
my $time=time();
my $tmpd=$tmpdir."/"."gpt-"."$$"."-".$time;
$tmpdir=$tmpd;
$me->{'tmpdir'} = $tmpd;
}
sub create_dirs {
my ($me, %args) = @_;
if ($args{'mode'} eq 'install' ) {
Grid::GPT::FilelistFunctions::mkinstalldir($me->{'bundledir'});
Grid::GPT::FilelistFunctions::mkinstalldir($me->{'setupdir'});
my $amdir = $me->{'gpt_amdir'};
$amdir =~ s!globus/amdir!gpt_amdir!;
if (-d "$amdir") {
Grid::GPT::FilelistFunctions::mkinstalldir("$me->{'installdir'}/share/globus");
Grid::GPT::FilelistFunctions::mkinstalldir("$me->{'installdir'}/share/globus/aclocal");
Grid::GPT::FilelistFunctions::mkinstalldir("$me->{'installdir'}/share/globus/flavors");
}
return
}
if ($args{'mode'} eq 'build' ) {
Grid::GPT::FilelistFunctions::mkinstalldir($me->{'builddir'});
return
}
if ($args{'mode'} eq 'bundle' ) {
Grid::GPT::FilelistFunctions::mkinstalldir($me->{'bindir'});
return
}
if ($args{'mode'} eq 'tmp' ) {
Grid::GPT::FilelistFunctions::mkinstalldir($me->{'tmpdir'});
my $result = `chmod 700 $me->{'tmpdir'}`;
return
}
}
sub _init_builddir {
my ($me) =@_;
$me->{'builddir'} = defined $me->{'builddir'} ? $me->{'builddir'} : "./BUILD";
$me->{'bindir'} = defined $me->{'bindir'} ? $me->{'bindir'} : "./bundle_pkgs";
$me->{'srcdir'} = defined $me->{'srcdir'} ? $me->{'srcdir'} : "./source";
}
sub _init_installdirs {
my ($me) =@_;
$me->{'installdir'} = defined $me->{'installdir'} ?
$me->{'installdir'} : $globus_prefix;
die "ERROR: GPT_INSTALL_LOCATION needs to be set before running this script.
Or use the -location switch"
if ! defined $me->{'installdir'};
# Determine what kind of package directory we have
$me->{'bundledir'} = "$me->{'installdir'}/share/globus/bundles";
$me->{'pkgdir'} = "$me->{'installdir'}/share/globus/packages";
$me->{'flavordir'} = "$me->{'installdir'}/share/globus/flavors";
$me->{'setupdir'} = "$me->{'installdir'}/share/globus/packages/setup";
$me->{'pkg_confdir'} = "${pkg_confdir}";
}
sub cleanbuilddir {
my ($me) = @_;
return system("rm -rf $me->{'builddir'}");
}
sub cleantmp() {
my ($me) = @_;
my $top = $me->{'tmpdir'};
opendir(DIR, $top);
my @contents = readdir DIR;
closedir DIR;
my @dirs = grep { -d "$top/$_" and ! m!^\.! } @contents;
my @files = grep { ! -d $_ } map { "$top/$_" } @contents;
for my $f (@files) {
unlink($f) or warn "WARNING: couldn't unlink $f: $!";
}
for my $d (@dirs) {
cleandir("$top/$d");
}
rmdir $top;
}
sub AUTOLOAD {
use vars qw($AUTOLOAD);
my $self = shift;
my $type = ref($self) || croak "$self is not an obj";
my $name = $AUTOLOAD;
$name =~ s/.*://; # strip fully-qualified portion
unless (exists $self->{$name} ) {
croak "Can't access `$name' field in obj of class $type";
}
if (@_) {
return $self->{$name} = shift;
} else {
return $self->{$name};
}
}
sub DESTROY {}
END { } # module clean-up code here (global destructor)
1;
__END__
|