4 NOTE: Since you're not running as root, the installation will su at
5 the appropriate time later. You will need to supply the root password
14 chop($JPL_SRC = `pwd`);
15 print "JPL_SRC = $JPL_SRC\n";
24 "/usr/local/lib/java",
26 $JAVA_HOME = $dir, last if $dir and -d "$dir/bin";
28 die "You must set the \$JAVA_HOME environment variable first.\n"
30 print "JAVA_HOME = $JAVA_HOME\n";
34 ($likelyjpl = $JAVA_HOME) =~ s#(.*)/.*#$1/jpl#;
38 You need to decide which directory JPL files are to be installed in.
39 Applications will look in subdirectories of this directory for any JPL
42 You may use the current directory ($JPL_SRC)
43 or you may use a directory such as $likelyjpl.
48 until (-d $JPL_HOME) {
49 print "Install JPL files where: [$JPL_SRC] ";
50 chop($JPL_HOME = <STDIN>);
51 $JPL_HOME ||= $JPL_SRC;
52 unless (-d $JPL_HOME) {
53 print "Warning: $JPL_HOME doesn't exist yet!\n\n";
54 print "Do you want to create it? [y] ";
57 next unless $ans =~ /^y/i;
59 system "mkdir -p $JPL_HOME";
60 if ($> and not -d $JPL_HOME) {
61 warn "Couldn't create $JPL_HOME!\nTrying again as root...running su...\n";
63 su root -c 'mkdir -p $JPL_HOME && chown $> $JPL_HOME && chmod 0755 $JPL_HOME'";
64 warn "Couldn't create $JPL_HOME!\n" unless -d $JPL_HOME;
68 print "JPL_HOME = $JPL_HOME\n";
70 #########################################################################
73 print "Writing setvars...\n";
75 unlink "$JPL_SRC/setvars";
76 open(SETVARS, ">$JPL_HOME/setvars") or die "Can't create setvars: $!\n";
78 s/^JPL_SRC=.*/JPL_SRC='$JPL_SRC'/;
79 s/^JAVA_HOME=.*/JAVA_HOME='$JAVA_HOME'/;
80 s/^JPL_HOME=.*/JPL_HOME='$JPL_HOME'/;
84 chmod 0755, "$JPL_HOME/setvars";
85 symlink "$JPL_HOME/setvars", "$JPL_SRC/setvars" if $JPL_HOME ne $JPL_SRC;
87 #########################################################################
90 eval `./setvars -perl`; # Take our own medicine.
92 print "\n\nStarting install...\n";
94 system <<'END' and die "Couldn't install JPL\n";
103 print "\nInstalling PerlInterpreter class\n";
105 system <<'END' and die "Couldn't install PerlInterpreter\n";
114 print "\nInstalling JNI module\n";
116 system <<'END' and die "Couldn't install JNI\n";
123 echo 'Attempting to install JNI as root'
124 su root -c "make install"
129 ## These should be executed as root
130 #rm -rf /usr/lib/perl5/site_perl/i586-linux/auto/JNI
131 #rm -rf /usr/lib/perl5/site_perl/auto/JNI
132 #rm -f /usr/lib/perl5/site_perl/JNI.pm
133 #make -f makefile.jv install UNINST=1
135 print "\nInstalling Sample JPL program\n";
137 system <<'END' and die "Couldn't install Sample\n";
147 print "\n\nTesting Sample...\n";
148 system <<'END' and die "Couldn't run Sample\n";
159 # You can edit this, but your changes will only last until the next
160 # time you run install-jpl.
162 # Where jpl is currently installed
167 # Where java is installed
169 JAVA_HOME=/usr/local/java
172 # Where jpl will be installed
179 JPLPERL=perl`perl -e "print $]"`
183 # Some derivative variables
184 archname=`$JPLPERL -MConfig -e 'print $Config{archname}'`
185 archlib=`$JPLPERL -MConfig -e 'print $Config{archlib}'`
187 CLASSPATH=".:$JPL_HOME/lib${CLASSPATH:+:$CLASSPATH}"
190 LD_LIBRARY_PATH=".:$JPL_HOME/lib/$archname:$archlib/CORE${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
191 export LD_LIBRARY_PATH
193 PERL5LIB="$JPL_HOME/perl${PERL5LIB:+:$PERL5LIB}"
196 # Make sure the right java programs are selected.
197 PATH="$JAVA_HOME/bin:$PATH"
203 \$ENV{PATH} = '$PATH';
204 \$ENV{JAVA_HOME} = '$JAVA_HOME';
205 \$ENV{JPL_HOME} = '$JPL_HOME';
206 \$ENV{JPLPERL} = '$JPLPERL';
207 \$ENV{CLASSPATH} = '$CLASSPATH';
208 \$ENV{LD_LIBRARY_PATH} = '$LD_LIBRARY_PATH';
209 \$ENV{PERL5LIB} = '$PERL5LIB';
214 PATH='$PATH';export PATH;JAVA_HOME='$JAVA_HOME';export JAVA_HOME;JPL_HOME='$JPL_HOME';export JPL_HOME;JPLPERL='$JPLPERL';export JPLPERL;CLASSPATH='$CLASSPATH';export CLASSPATH;LD_LIBRARY_PATH='$LD_LIBRARY_PATH';export LD_LIBRARY_PATH;PERL5LIB='$PERL5LIB';export PERL5LIB
220 setenv JAVA_HOME '$JAVA_HOME';
221 setenv JPL_HOME '$JPL_HOME';
222 setenv JPLPERL '$JPLPERL';
223 setenv CLASSPATH '$CLASSPATH';
224 setenv LD_LIBRARY_PATH '$LD_LIBRARY_PATH';
225 setenv PERL5LIB '$PERL5LIB';