-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.pl
executable file
·60 lines (53 loc) · 1.41 KB
/
install.pl
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
#!/bin/perl
# ^^^^^^^^^
# CUSTOMIZE THIS TO POINT TO YOUR PERL BINARY!!!!
#
# WatCH installation script
# Time-stamp: <Paul Sanschagrin -- Tue Jul 17 09:38:37 EDT 2001>
#
# to run: ./install.pl
use Cwd;
$perl = $^X;
$current_dir = cwd();
system "mkdir $current_dir/bin";
# unpack the Perl scripts and change the path to the perl binary
open IN, $current_dir."/perl/perl_scripts";
print "\n*** extracting Perl scripts ***\n";
while ( <IN> )
{
if ( /^____FILE\_START/ )
{
chop;
# grep the name of packed Perl script
@line = split;
$file = "$current_dir/bin/$line[1]";
open OUT, ">$file" or die "Can't \n";
# read the line that includes the path to the Perl binary
$_ = <IN>;
print OUT "\#\!$perl\n";
next;
}
if ( /^____FILE\_END/ )
{
# end of this script, close filehandle and change permissions
close OUT;
chmod 0755, "$file";
next;
}
print OUT $_;
}
close IN;
# compile WatCH
chdir "$current_dir/src";
print "\n*** compiling ***\n\n";
system "make";
system "mv cluster $current_dir/bin";
system "make clean";
# copy the run script, with the addition of the installation directory
$sed_dir = $current_dir;
$sed_dir =~ s/\//\\\//g;
system "sed 's/DIRECTORY/$sed_dir\\/bin/g' prep_WatCH > ".
"$current_dir/bin/prep_WatCH";
system "chmod +x $current_dir/bin/prep_WatCH";
print "\n*** installation completed ***\n";
print "\n\n*** Please see license.txt for licensing and use information ***\n\n";