[Bio] / FigCommon / configure-env Repository:
ViewVC logotype

Diff of /FigCommon/configure-env

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

revision 1.1, Mon Dec 1 16:52:59 2003 UTC revision 1.2, Wed Dec 3 01:13:11 2003 UTC
# Line 4  Line 4 
4  # FIG/SEED configuration script  # FIG/SEED configuration script
5  #  #
6  # This script takes as an argument the name of the environment  # This script takes as an argument the name of the environment
7  # that we are configuring for.  # that we are configuring for.  It takes a second argument specifying
8    # the path to the code installation, i.e., the dirname under which we
9    # can find FigKernelPackages, bin, and CGI.  This is no longer the same
10    # as where the data are installed
11  #  #
12  # If no argument is passed, a list of valid environment names will be  # If no argument is passed, a list of valid environment names will be
13  # displayed.  # displayed.
# Line 13  Line 16 
16  # We configure the following files (all paths relative to the top  # We configure the following files (all paths relative to the top
17  # of the FIGdisk directory):  # of the FIGdisk directory):
18  #  #
19    # NOTE:  all these are now made in ., not in the directories shown.
20    # That's because this is now called from a makefile, e.g., and the
21    # caller is responsible for mv'ing them to the right place.
22    #
23  # fig-user-env.sh  # fig-user-env.sh
24  # FIG/Packages/FIG_Config.pm  # FIG/Packages/FIG_Config.pm
25  # FIG/Packages/FIG_Config.py  # FIG/Packages/FIG_Config.py
# Line 21  Line 28 
28  # bin/start-servers  # bin/start-servers
29  # bin/stop-servers  # bin/stop-servers
30  #  #
31    ########################################################################
32    
33    #
34    # Where the output files are to be placed
35  #  #
36    GenDir=`pwd`
37    
38  #  #
39  # Make sure we're running from a real FIGdisk directory.  # Figure out where we are; set the FIG_HOME and
40    # EnvDir values.
41    #
42    # Now that the code is in one place and the core stuff and
43    # data are in another, we can't assume we are building in
44    # the root of the FIG installation.
45  #  #
46  if [ ! -d env -o ! -d FIG ] ; then  # Take it from the env for now.  Ick
47      echo "Please run $0 from a FIGdisk directory"  
48    #FIG_HOME=`pwd`
49    echo "Using FIG_HOME=$FIG_HOME"
50    
51    
52    #
53    # Make sure we're running from a real FIGdisk directory, i.e.,
54    # that FIG_HOME is set right.
55    #
56    if [ ! -d $FIG_HOME/env -o ! -d $FIG_HOME/FIG ] ; then
57        echo "Please set FIG_HOME correctly"
58      exit      exit
59  fi  fi
60    
# Line 37  Line 64 
64  #  #
65    
66  AvailableEnvironments=""  AvailableEnvironments=""
67  for d in env/* ; do  for d in $FIG_HOME/env/* ; do
68      e=`basename $d`      e=`basename $d`
69      AvailableEnvironments="$AvailableEnvironments $e"      AvailableEnvironments="$AvailableEnvironments $e"
70  done  done
71    
72  if [ $# -eq 0 ] ; then  if [ $# -ne 2 ] ; then
73      echo "Available environments: $AvailableEnvironments"      echo "Usage: $0 environment-name pathToCodeInstallation"
     exit  
 fi  
   
 if [ $# -gt 1 ] ; then  
     echo "Usage: $0 environment-name"  
74      echo "Available environments: $AvailableEnvironments"      echo "Available environments: $AvailableEnvironments"
75      exit      exit
76  fi  fi
# Line 57  Line 79 
79  # Check to see if the user picked a valid environment.  # Check to see if the user picked a valid environment.
80  #  #
81    
82  if [ ! -d "env/$1" ] ; then  if [ ! -d "$FIG_HOME/env/$1" ] ; then
83      echo "Invalid environment name $1"      echo "Invalid environment name $1"
84      echo "Available environments: $AvailableEnvironments"      echo "Available environments: $AvailableEnvironments"
85      exit      exit
# Line 65  Line 87 
87    
88  Env=$1  Env=$1
89    
 #  
 # Figure out where we are; set the FIG_HOME and  
 # EnvDir values.  
 #  
   
 FIG_HOME=`pwd`  
 echo "Using FIG_HOME=$FIG_HOME"  
   
90  EnvDir=$FIG_HOME/env/$Env  EnvDir=$FIG_HOME/env/$Env
91    
92  if [ ! -d $EnvDir ] ; then  if [ ! -d $EnvDir ] ; then
# Line 81  Line 95 
95  fi  fi
96    
97  #  #
98    # pull off the path to the base of the code installation
99    #
100    
101    CodeInstallDir=$2
102    
103    if [ ! -d $CodeInstallDir ] ; then
104        echo "Code Installation Directory $CodeInstallDir does not exist, exiting"
105        exit
106    fi
107    if [ ! -d $CodeInstallDir/FigKernelPackages ] ; then
108        echo "No FigKernelPackages in $CodeInstallDir, exiting"
109        exit
110    fi
111    
112    
113    #
114  # Define the tool_hdr locations.  # Define the tool_hdr locations.
115  #  #
116    
117  ToolHeaderPerl=$FIG_HOME/FIG/tool_hdr  ToolHeaderPerl=./tool_hdr
118  ToolHeaderPython=$FIG_HOME/FIG/tool_hdr_py  ToolHeaderPython=./tool_hdr_py
119    
120    
121  #  #
# Line 135  Line 165 
165  # Compute some paths.  # Compute some paths.
166  #  #
167    
168  UserPath="$FIG_HOME/FIG/bin:$FIG_HOME/bin:$EnvDir/bin"  UserPath="$CodeInstallDir/bin/$RTARCH:$FIG_HOME/FIG/bin:$FIG_HOME/bin:$EnvDir/bin"
169  BLASTMAT="$FIG_HOME/BLASTMAT"  BLASTMAT="$FIG_HOME/BLASTMAT"
170  OurPythonStuff="$FIG_HOME/FIG/Packages:$EnvDir/lib/python$PythonVersion/site-packages"  OurPythonStuff="$CodeInstallDir/lib/$RTARCH:$EnvDir/lib/python$PythonVersion/site-packages"
171    
172  #  #
173  # fig-user-env.sh  # fig-user-env.sh
# Line 165  Line 195 
195  # FIG_Config.pm  # FIG_Config.pm
196  #  #
197    
198  cat <<EOF > FIG/Packages/FIG_Config.pm  cat <<EOF > FIG_Config.pm
199  package FIG_Config;  package FIG_Config;
200    
201  # Each setting of a variable MUST be on a single line.  We use code during  # Each setting of a variable MUST be on a single line.  We use code during
# Line 175  Line 205 
205  \$fig_disk    = "$FIG_HOME";  \$fig_disk    = "$FIG_HOME";
206  \$blastmat    = "\$fig_disk/BLASTMAT";  \$blastmat    = "\$fig_disk/BLASTMAT";
207  \$fig         = "\$fig_disk/FIG";  \$fig         = "\$fig_disk/FIG";
208  \$bin         = "\$fig/bin";  \$bin         = "$CodeInstallDir/bin/$RTARCH";
209  \$ext_bin     = "$EnvDir/bin";  \$ext_bin     = "$EnvDir/bin";
210  \$data        = "\$fig/Data";  \$data        = "\$fig/Data";
211  \$global      = "\$data/Global";  \$global      = "\$data/Global";
# Line 192  Line 222 
222  # FIG_Config.py  # FIG_Config.py
223  #  #
224    
225  cat <<EOF > FIG/Packages/FIG_Config.py  cat <<EOF > FIG_Config.py
226    
227  import os.path  import os.path
228    
# Line 203  Line 233 
233  fig_disk    = "$FIG_HOME"  fig_disk    = "$FIG_HOME"
234  blastmat    = os.path.join(fig_disk, "BLASTMAT")  blastmat    = os.path.join(fig_disk, "BLASTMAT")
235  fig         = os.path.join(fig_disk, "FIG")  fig         = os.path.join(fig_disk, "FIG")
236  bin         = os.path.join(fig, "bin")  bin         = os.path.join("$CodeInstallDir/bin/$RTARCH/", "bin")
237  ext_bin     = os.path.join("$EnvDir", "bin")  ext_bin     = os.path.join("$EnvDir", "bin")
238  data        = os.path.join(fig, "Data")  data        = os.path.join(fig, "Data")
239  global_dir      = os.path.join(data, "Global")  global_dir      = os.path.join(data, "Global")
# Line 226  Line 256 
256  use Data::Dumper;  use Data::Dumper;
257  use Carp;  use Carp;
258    
259  use lib "$FIG_HOME/FIG/Packages";  use lib "$CodeInstallDir/lib/$RTARCH/FigKernelPackages";
260    
261  use FIG_Config;  use FIG_Config;
262    
# Line 242  Line 272 
272  # Start and stop servers scripts.  # Start and stop servers scripts.
273  #  #
274    
275  cat <<EOF >bin/start-servers  cat <<EOF > start-servers
276  #!/bin/sh  #!/bin/sh
277    
278  EOF  EOF
279  chmod +x bin/start-servers  chmod +x start-servers
280    
281  cat <<EOF >bin/stop-servers  cat <<EOF > stop-servers
282  #!/bin/sh  #!/bin/sh
283    
284  EOF  EOF
285  chmod +x bin/stop-servers  chmod +x stop-servers
286    
287    
288  #  #
289  # Do environment-specific configurations.  # Do environment-specific configurations.  We pass the path in
290    # which the config tools are to find the files to modify
291  #  #
292    
293  if [ -f $EnvDir/configure-env-specific ] ; then  if [ -f $EnvDir/configure-env-specific ] ; then
294      . $EnvDir/configure-env-specific      . $EnvDir/configure-env-specific $GenDir
295  fi  fi
296    
297    
298  #  #
299  # Make sure this file ends properly for a perl module.  # Make sure this file ends properly for a perl module.
300  #  #
301  echo "1;" >> FIG/Packages/FIG_Config.pm  echo "1;" >> FIG_Config.pm
302    
 #  
 # We're set. Go ahead and run make in the bin and CGI dirs to regenerate  
 # scripts from tool_hdr.  
 #  
   
 for tooldir in FIG/bin FIG/CGI ; do  
     (cd $tooldir; make)  
 done  

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3