ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/Installation/install_scram
Revision: 1.9
Committed: Fri Apr 12 16:42:07 2002 UTC (23 years, 1 month ago) by sashby
Branch: MAIN
Changes since 1.8: +11 -2 lines
Log Message:
modified Installaiton script.

File Contents

# User Rev Content
1 sashby 1.6 #!/usr/bin/env perl
2 sashby 1.5 ###############################################################
3     # install_scram #
4     ###############################################################
5     # modified : Mon Nov 12 11:41:54 2001 / SFA #
6     # : #
7     # function : Installation script (to be run from Installation #
8     # : directory) #
9     # : #
10     # : Usage: #
11     # : perl install_scram [-perl perlexecutable] #
12     # : #
13     ###############################################################
14 williamc 1.4
15 sashby 1.7 # Using "env" and exec doesn't work.
16     # This can be overridden (hard-coded) using the -perl option
17 sashby 1.8 my $perl="/usr/bin/env perl";
18 williamc 1.4
19     # process options
20     while ( $ARGV[0]=~"^-" ) {
21     if ( $ARGV[0]=~/-perl/ ) {
22     shift @ARGV;
23     $perl=shift @ARGV;
24     next;
25     }
26     print "Unknown Option $ARGV[0]\n";
27     print "Usage : perl install_scram [-perl perlexecutable]\n";
28     exit 1;
29     }
30    
31 williamc 1.1 use Cwd;
32     $thisdir=cwd();
33     (($basedir=$thisdir)=~s/(.*)\/.*/\1/);
34     ($topdir=$basedir)=~s/(.*)\/.*/\1/;
35    
36 williamc 1.3 # Create the directory for storing databases
37     use File::Path;
38     mkpath("$topdir/scramdb", 0, 0755);
39    
40 sashby 1.9 # Get SITE name from user:
41     print "** Please enter the name of your SITE (e.g. CERN[default], FNAL) **","\n";
42     print "sitename: ";
43     chomp($scramsite=<STDIN>);
44     if ($scramsite eq '') {$scramsite='CERN'};
45     print "\n";
46    
47     # Copy the wrapper file with the correct base variable installed:
48 williamc 1.1 open ( WRAP , "<scramwrapper") or die "Unable to open scramwrapper $!";
49     open ( OUTFILE , ">$topdir/scram") or die "Unable to open $topdir/scram $!";
50     while ( <WRAP> ) {
51     $_=~s/__basedir__/$basedir/g;
52 williamc 1.4 $_=~s/__perlexe__/$perl/g;
53 sashby 1.9 $_=~s/__scramsite__/$scramsite/g;
54 williamc 1.1 print OUTFILE $_;
55     }
56 williamc 1.2 chmod 0755, "$topdir/scram";
57 williamc 1.1 close WRAP;
58 sashby 1.9
59     print "SCRAM executable is $topdir/scram","\n";