ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/Installation/install_scram
Revision: 1.8
Committed: Wed Jan 16 11:04:14 2002 UTC (23 years, 4 months ago) by sashby
Branch: MAIN
CVS Tags: V0_19_4_pre1, V0_19_3, V0_19_2
Changes since 1.7: +1 -1 lines
Log Message:
another attempt at a fix.

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
32     use Cwd;
33     $thisdir=cwd();
34     (($basedir=$thisdir)=~s/(.*)\/.*/\1/);
35     ($topdir=$basedir)=~s/(.*)\/.*/\1/;
36    
37 williamc 1.3 # Create the directory for storing databases
38     use File::Path;
39     mkpath("$topdir/scramdb", 0, 0755);
40    
41 williamc 1.1 # Copy the wrapper file with the correct base variable installed
42     open ( WRAP , "<scramwrapper") or die "Unable to open scramwrapper $!";
43     open ( OUTFILE , ">$topdir/scram") or die "Unable to open $topdir/scram $!";
44     while ( <WRAP> ) {
45     $_=~s/__basedir__/$basedir/g;
46 williamc 1.4 $_=~s/__perlexe__/$perl/g;
47 williamc 1.1 print OUTFILE $_;
48     }
49 williamc 1.2 chmod 0755, "$topdir/scram";
50 williamc 1.1 close WRAP;