ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/Installation/install_scram
Revision: 1.12
Committed: Fri Dec 10 13:50:58 2004 UTC (20 years, 5 months ago) by sashby
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +0 -0 lines
State: FILE REMOVED
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/usr/bin/env perl
2 ###############################################################
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
15 # Using "env" and exec doesn't work.
16 # This can be overridden (hard-coded) using the -perl option
17 my $perl="/usr/bin/env perl";
18
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 use Cwd;
32 $thisdir=cwd();
33 (($basedir=$thisdir)=~s/(.*)\/.*/\1/);
34 ($topdir=$basedir)=~s/(.*)\/.*/\1/;
35
36 # Create the directory for storing databases
37 use File::Path;
38 mkpath("$topdir/scramdb", 0, 0755);
39
40 # 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 # Get SITE name from user:
48 print "** Please enter the default location of the tools config file **","\n";
49 print "[cms]tools-".$scramsite.".conf location?: ";
50 chomp($loctools=<STDIN>);
51 if ($loctools eq '') {$loctools='NODEFAULT'};
52 print "\n";
53
54 # Copy the wrapper file with the correct base variable installed:
55 open ( WRAP , "<scramwrapper") or die "Unable to open scramwrapper $!";
56 open ( OUTFILE , ">$topdir/scram") or die "Unable to open $topdir/scram $!";
57 while ( <WRAP> ) {
58 $_=~s/__basedir__/$basedir/g;
59 $_=~s/__perlexe__/$perl/g;
60 $_=~s/__scramsite__/$scramsite/g;
61 $_=~s/__loctools__/$loctools/g;
62 print OUTFILE $_;
63 }
64 chmod 0755, "$topdir/scram";
65 close WRAP;
66
67 print "SCRAM executable is $topdir/scram","\n";