[Bio] / FigCommon / bootstrap.pl Repository:
ViewVC logotype

Diff of /FigCommon/bootstrap.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3, Tue Dec 23 17:56:32 2003 UTC revision 1.10, Thu Apr 1 12:59:40 2004 UTC
# Line 102  Line 102 
102    
103  our $fig_disk = $ENV{FIG_HOME};  our $fig_disk = $ENV{FIG_HOME};
104  our $env_name = $ENV{FIGCONFIG_ENV};  our $env_name = $ENV{FIGCONFIG_ENV};
105    our $env_dir = "$ENV{FIGCONFIG_ENV_DIR}";
106  our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";  our $env_bin = "$ENV{FIGCONFIG_ENV_DIR}/bin";
107  our $env_lib = "$ENV{FIGCONFIG_ENV_DIR}/lib";  our $env_lib = "$ENV{FIGCONFIG_ENV_DIR}/lib";
108  #  #
# Line 111  Line 112 
112  #our $release_bin = "$ENV{FIGCONFIG_RELEASE_DIR}/bin/$ENV{FIGCONFIG_ENV}";  #our $release_bin = "$ENV{FIGCONFIG_RELEASE_DIR}/bin/$ENV{FIGCONFIG_ENV}";
113  #our $release_lib = "$ENV{FIGCONFIG_RELEASE_DIR}/lib/$ENV{FIGCONFIG_ENV}";  #our $release_lib = "$ENV{FIGCONFIG_RELEASE_DIR}/lib/$ENV{FIGCONFIG_ENV}";
114    
115  our $release_bin = "$fig_disk/dist/releases/current/bin/$ENV{FIGCONFIG_ENV}";  our $release_bin = "$fig_disk/dist/releases/current/$ENV{FIGCONFIG_ENV}/bin";
116  our $release_lib = "$fig_disk/dist/releases/current/lib/$ENV{FIGCONFIG_ENV}";  our $release_lib = "$fig_disk/dist/releases/current/$ENV{FIGCONFIG_ENV}/lib";
117    
118  our $fig_bin = "$fig_disk/FIG/bin";  our $fig_bin = "$fig_disk/FIG/bin";
119    
# Line 135  Line 136 
136      chomp $hostname;      chomp $hostname;
137    
138      push(@$Config, ["fig_disk", $fig_disk, 1]);      push(@$Config, ["fig_disk", $fig_disk, 1]);
139      push(@$Config, ["blastmast", "$fig_disk/BLASTMAT", 1]);      push(@$Config, ["blastmat", "$fig_disk/BLASTMAT", 1]);
140      push(@$Config, ["fig", $fig, 1]);      push(@$Config, ["fig", $fig, 1]);
141      push(@$Config, ["bin", $fig_bin, 1]);      push(@$Config, ["bin", $fig_bin, 1]);
142      push(@$Config, ["ext_bin", $env_bin, 1]);      push(@$Config, ["ext_bin", $env_bin, 1]);
# Line 147  Line 148 
148      push(@$Config, ["temp", "$fig_disk/FIG/Tmp", 1]);      push(@$Config, ["temp", "$fig_disk/FIG/Tmp", 1]);
149      push(@$Config, ["temp_url", "http://$hostname/FIG-Tmp", 1]);      push(@$Config, ["temp_url", "http://$hostname/FIG-Tmp", 1]);
150      push(@$Config, ["cgi_url", "http://$hostname/FIG", 1]);      push(@$Config, ["cgi_url", "http://$hostname/FIG", 1]);
151    
152        #
153        # Add values for a relative base href of temp and CGI pages.  The latter
154        # is used by HHTP.pm to write common page start.  It would make the most
155        # sense to derive the above 2 values from these.  -- GJO
156        #
157    
158        push(@$Config, ["temp_base", "/FIG-Tmp/", 1]);
159        push(@$Config, ["cgi_base", "/FIG/", 1]);
160  }  }
161    
162  sub compute_environment  sub compute_environment
# Line 213  Line 223 
223    
224  sub find_in_path  sub find_in_path
225  {  {
226      my($file) = @_;      my($file, @extra) = @_;
227      my(@path) = split(":", $ENV{PATH});      my(@path) = split(":", $ENV{PATH});
228    
229      for my $p (@path)      for my $p (@path, @extra)
230      {      {
231          my $x = "$p/$file";          my $x = "$p/$file";
232          if (-x $x)          if (-x $x)
# Line 240  Line 250 
250    
251      if ($ENV{FIGCONFIG_ENV} eq "mac")      if ($ENV{FIGCONFIG_ENV} eq "mac")
252      {      {
253          if ($python = find_in_path("pythonw"))          #
254            # We'd like to use the MacPython that is installed
255            # as pythonw.
256            #
257            if ($python = find_in_path("pythonw", "/usr/local/bin"))
258          {          {
259                $OtherConfig->{python_require_poundbang_env} = 1;
260              return $python;              return $python;
261          }          }
262    
263          #          #
264          # Didn't find it in the path; we require the          # Otherwise, we can live with the regular python.
265          # MacPython build, and that installs into          # Fall thru to the generic case.
         # /usr/local/bin/pythonw by default.  
266          #          #
   
         return "/usr/local/bin/pythonw";  
267      }      }
     else  
     {  
268          #          #
269          # Non-mac, just look in the env dir or the path.          # Non-mac, just look in the env dir or the path.
270          #          #
# Line 267  Line 277 
277    
278          return find_in_path("python");          return find_in_path("python");
279      }      }
 }  
280    
281  #  #
282  # Find the name of the perl executable we are to use.  # Find the name of the perl executable we are to use.
# Line 305  Line 314 
314  if [ -n "\$$name" ] ; then  if [ -n "\$$name" ] ; then
315      DELIM=:      DELIM=:
316  fi  fi
317  $name=\${$name}\${DELIM}$value  $name=$value\${DELIM}\${$name}
318  export $name  export $name
319  END  END
320          }          }
# Line 333  Line 342 
342    
343              print $fh <<END;              print $fh <<END;
344  if (\$?$name) then  if (\$?$name) then
345      setenv $name \${$name}:$value      setenv $name $value:\${$name}
346  else  else
347      setenv $name $value      setenv $name $value
348  endif  endif
# Line 423  Line 432 
432    
433  }  }
434    
435    sub finalize_server_scripts
436    {
437        #
438        # After any environment-specific stuff, call start_services and stop_services.
439        #
440    
441        open(F, ">>$start_servers") or die "Cannot write $start_servers: $!";
442        print F "\n$fig_bin/start_services\n";
443        close(F);
444        chmod(0775, $start_servers);
445    
446        open(F, ">>$stop_servers") or die "Cannot write $stop_servers: $!";
447        print F "\n$fig_bin/stop_services\n";
448        close(F);
449        chmod(0775, $stop_servers);
450    
451    }
452    
453  sub write_config_pm  sub write_config_pm
454  {  {
455      my($fh, $config) = @_;      my($fh, $config) = @_;
# Line 515  Line 542 
542    
543      my $python = find_python();      my $python = find_python();
544    
545        if ($OtherConfig->{python_require_poundbang_env})
546        {
547            print $fh "#!/usr/bin/env $python\n";
548        }
549        else
550        {
551      print $fh "#!$python\n";      print $fh "#!$python\n";
552        }
553      print $fh "\n";      print $fh "\n";
554    
555      print $fh "import sys\n";      print $fh "import sys\n";
# Line 548  Line 582 
582  configure_python();  configure_python();
583  configure_environment_specific();  configure_environment_specific();
584    
585    finalize_server_scripts();
586    
587  #  #
588  # Write the shell startup to the figdisk.  # Write the shell startup to the figdisk.
589  #  #

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3