[Bio] / Sprout / NMPDRSetup.pl Repository:
ViewVC logotype

Diff of /Sprout/NMPDRSetup.pl

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

revision 1.1, Mon Nov 5 21:27:47 2007 UTC revision 1.2, Thu Dec 6 14:58:03 2007 UTC
# Line 87  Line 87 
87    
88  =item 4 Fix file permissions.  =item 4 Fix file permissions.
89    
90  =item 5 Display instructions for the remaining scripts.  =item 5 Copy the cover pages.
91    
92    =item 6 Copy the drug target files.
93    
94  =back  =back
95    
# Line 153  Line 155 
155  my $blastmat_tarfile = $options->{blastMAT};  my $blastmat_tarfile = $options->{blastMAT};
156  my $base_dir = $FIG_Config::nmpdr_base;  my $base_dir = $FIG_Config::nmpdr_base;
157    
158  # Get the version number.  # Get the new version number.
159  my $version = $parameters[0];  my $version = $parameters[0];
160    # Compute the current version number.
161    $FIG_Config::nmpdr_version =~ /(\d+)/;
162    my $old_version = $1;
163    
164  # Set up the CVS data. Note that we are using an anonymous login. You can  # Set up the CVS data. Note that we are using an anonymous login. You can
165  # update from the NMPDR server but you can't commit!  # update from the NMPDR server but you can't commit!
# Line 223  Line 228 
228      # Now we create the code directories.      # Now we create the code directories.
229      Insure("$target_dir/dist");      Insure("$target_dir/dist");
230      Insure("$target_dir/dist/releases");      Insure("$target_dir/dist/releases");
231      # Finally, we create the directories that hold generated HTML files.      # Finally, we create the directory that holds the cover pages.
232      Insure("$version_dir/html");      Insure("$version_dir/html");
     Insure("$version_dir/html/includes");  
     Insure("$version_dir/html/includes/forms");  
233      # Change to the target directory. This means we're inside FIGdisk and above      # Change to the target directory. This means we're inside FIGdisk and above
234      # FIG.      # FIG.
235      ChDir($target_dir);      ChDir($target_dir);
# Line 332  Line 335 
335          # Copy the make file.          # Copy the make file.
336          copy("ReleaseTools/Makefile.top", "Makefile") ||          copy("ReleaseTools/Makefile.top", "Makefile") ||
337              Confess("Could not copy master make file.");              Confess("Could not copy master make file.");
         # Create the dummy GBrowse group files. After the database  
         # is loaded these will be rebuilt, but we need something  
         # to keep the make from failing.  
         my %sampleGenomes = (Campylobacter => '192222.1',  
                              Listeria => '169963.1',  
                              Staphylococcus => '273036.3',  
                              Streptococcus => '160490.1',  
                              Vibrio => '312309.3',  
                              Other => '83333.1'  
                             );  
         for my $group (keys %sampleGenomes) {  
             Open(\*GROUP, ">NmpdrConfigs/$group.group");  
             print GROUP "$sampleGenomes{$group}\n";  
             close GROUP;  
         }  
338          # Write out the release name.          # Write out the release name.
339          Open(\*RELFILE, ">$target_dir/DEFAULT_RELEASE");          Open(\*RELFILE, ">$target_dir/DEFAULT_RELEASE");
340          print RELFILE "$rel\n";          print RELFILE "$rel\n";
# Line 377  Line 365 
365      Trace("Stage 2 complete.") if T(2);      Trace("Stage 2 complete.") if T(2);
366  }  }
367  #  #
368  #   STAGE 3: Configure FIG_Config and the config script, set the  #   STAGE 3: Configure FIG_Config and the config script
369  #            GBrowse symlink, and protect from updates.  #            and protect from updates.
370  #  #
371  if ($options->{stage} <= 3) {  if ($options->{stage} <= 3) {
372      # Switch to the configuration directory.      # Switch to the configuration directory.
# Line 426  Line 414 
414                     attrPort          => 3306,                     attrPort          => 3306,
415                     attrSock          => undef,                     attrSock          => undef,
416                     attrDBD           => "/disks/nmpdr/v$version/FIGdisk/FIG/AttributesDBD.xml",                     attrDBD           => "/disks/nmpdr/v$version/FIGdisk/FIG/AttributesDBD.xml",
417                       phone             => "{ user => 'BruceTheHumanPet', password => 'STARl00k', api_id => '2561022' }",
418                       nmpdr_mode        => 1,
419                    );                    );
420        # Pull forward the server values from the current version.
421        for my $serverKey (qw(bbh_server_url sim_server_url pin_server_url pch_server_url use_pch_server)) {
422            my $value = eval("\$FIG_Config::$serverKey");
423            if (defined $value) {
424                $changes{$serverKey} = $value;
425            }
426        }
427    
428      # Create a list of lines to be added to the front.      # Create a list of lines to be added to the front.
429      my $inserts = [      my $inserts = [
430                     "",                     "",
# Line 438  Line 436 
436          Trace("Updating configuration file in " . getcwd() . ".") if T(2);          Trace("Updating configuration file in " . getcwd() . ".") if T(2);
437          DocUtils::ModifyConfigFile("FIG_Config.pm", \%changes, $inserts);          DocUtils::ModifyConfigFile("FIG_Config.pm", \%changes, $inserts);
438      }      }
     # Now we need to set up the Gbrowse symlink. This insures that the  
     # GBrowse can find the web pages in the correct place.  
     if ($options->{test}) {  
         Trace("Html pointer directory would be $target_dir/Html.") if T(2);  
     } else {  
         Trace("Configuring Html pointer directory.") if T(2);  
         ChDir($target_dir);  
         do_symlink("$target_dir/FIG/CGI/Html", "Html");  
         # Create the "doc_root". It's not used, but the software needs to know  
         # it's there.  
         Insure("$target_dir/doc_root");  
     }  
439      # The next step is to update the shell script. We need to add CVS information and      # The next step is to update the shell script. We need to add CVS information and
440      # the temp directory.      # the temp directory.
441      my %elims = (CVSROOT => $cvsroot,      my %elims = (CVSROOT => $cvsroot,
# Line 484  Line 470 
470          close FIGOUT;          close FIGOUT;
471          rename "fig-user-env.sh~", "fig-user-env.sh";          rename "fig-user-env.sh~", "fig-user-env.sh";
472      }      }
473        # Copy the WebApplication configuration subdirectory from the
474        # current version to the next version. First, we get our current
475        # configuration directory.
476        my $currentConfig = "$FIG_Config::fig_disk/config";
477        # Now we create the web-application subdirectory in the target directory.
478        mkdir "WebApplication";
479        # Copy across the files inside.
480        my @lines = `cp -r $currentConfig/WebApplication/* $target_dir/config/WebApplication`;
481        Trace("WebApplication configuration files copied:\n" . join("\n", @lines)) if T(2);
482      # Finally, create a marker file to protect this installation from      # Finally, create a marker file to protect this installation from
483      # automatic updates.      # automatic updates.
484      my $marker_file = "$target_dir/config/DISABLE_P2P";      my $marker_file = "$target_dir/config/DISABLE_P2P";
# Line 511  Line 506 
506          # Set the permissions.          # Set the permissions.
507          Tracer::SetPermissions($version_dir, $options->{group}, 02664, tmp => 02777);          Tracer::SetPermissions($version_dir, $options->{group}, 02664, tmp => 02777);
508      }      }
509      Trace("Stage 5 complete.") if T(2);      Trace("Stage 4 complete.") if T(2);
510  }  }
511  #  #
512  # STAGE 5: Display remaining steps.  # STAGE 5: Copy the cover pages.
513  #  #
514  if ($options->{stage} <= 5) {  if ($options->{stage} <= 5) {
515      # Get this user's name so we can put it in the command line prototypes.      Trace("Copying cover pages.") if T(2);
516      my $user = $options->{user};      my @syncData = `rsync --archive --recursive /disks/nmpdr/$old_version/html /disks/nmpdr/$version_dir/`;
517      # Compute the next release date.      Trace("Copy results\n" . join("\n", @syncData)) if T(3);
518      my @timeParts = localtime();      # Create the version number file for the wiki.
519      my $today = strftime("%B %d, %Y", @timeParts);      my $text = join("\n", "<?php",
520      # Display the instructions.                            "\$wgNmpdrVersion = $version;",
521      Trace("Switch to the new environment and then perform the following steps.") if T(2);                            "?>",
522      Trace("Log off COMPLETELY before switching to clear out the old CVS configuration.") if T(2);                            "");
523      Trace("(1) Make the new SEED.") if T(2);      my $fh = Tracer::Open(undef, ">/disks/nmpdr/$version_dir/html/wiki/extensions/NmpdrVersion.php");
524      Trace("    touch NmpdrConfigs/*.group") if T(2);      print "$fh", $text;
525      Trace("    make") if T(2);      close $fh;
526      Trace("(2) Create the code templates.") if T(2);      Trace("Version file created for wiki.") if T(2);
527      Trace("    CompileTemplate -trace=3 /disks/nmpdr/code_helpers /disks/nmpdr/next/FIGdisk/FIG/CGI/Html") if T(2);      Trace("Stage 5 complete.") if T(2);
     Trace("(3) Create the NMPDR database. (You may be prompted for a password.)") if T(2);  
     Trace("    mysqladmin -u $FIG_Config::sproutUser -p create $sprout_db_name") if T(2);  
     Trace("(4) Run LoadSproutTables to load the NMPDR database from the SEED.") if T(2);  
     Trace("(5) Run MakeGroupFiles to set up the GBrowse group files.") if T(2);  
     Trace("(6) Use Dreamweaver to move the cover pages to the WEB server.") if T(2);  
     Trace("(7) Run ShowCounts and GenomeStats to create the include pages.") if T(2);  
     Trace("(8) Run nmpdr2gff to create the GFF files, then ZIP and copy them.") if T(2);  
     Trace("    nmpdr2gff /disks/nmpdr/next/FIGdisk/FIG/var/downloads") if T(2);  
528  }  }
529    #
530    # STAGE 6: Copy the drug target files.
531    #
532    if ($options->{stage} <= 6) {
533        Trace("Copying drug target files.") if T(2);
534        my @syncData = `  rsync --archive --recursive /disks/nmpdr/$old_version/FIGdisk/FIG/var/DrugTargetData /disks/nmpdr/$version_dir/`;
535        Trace("Copy results\n" . join("\n", @syncData)) if T(3);
536        Trace("Stage 6 complete.") if T(2);
537    }
538    
539  Trace("Processing complete.") if T(0);  Trace("Processing complete.") if T(0);
540    
541  # Forge a symbolic Link.  # Forge a symbolic Link.

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3