File:  [LON-CAPA] / doc / build / generate_web_pages.pl
Revision 1.39: download - view: text, annotated - select for diffs
Wed Dec 10 19:13:41 2008 UTC (15 years, 5 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_99_1, version_2_7_99_0, HEAD, GCI_3, GCI_2, GCI_1
Installation instructions for CentOS 5.

    1: #!/usr/bin/perl -w
    2: 
    3: =pod
    4: 
    5: =NAME
    6: 
    7: generate_web_pages.pl - generate the web pages for the install site
    8: 
    9: =SYNOPSIS
   10: 
   11: Yeah, it does that.
   12: 
   13: Basically, there's a few comments in shell.hemp that we replace with
   14:     what we really want in the files. Pretty simple.
   15: 
   16: The point of this is to look like the main site.
   17: 
   18: =cut
   19: 
   20: # This is the list of pages to generate: Change this to
   21: # add/subtract/etc. pages. Index is done seperately.
   22: # Title, source
   23: 
   24: my @pages = (
   25:               ['Fedora 9 Install', 'F9_install'],
   26:               ['Fedora 8 Install', 'F8_install'], 
   27:               ['Fedora 7 Install', 'F7_install'],
   28:               ['Fedora Core 6 Install', 'FC6_install'], 
   29: 	      ['Fedora Core 5 Install', 'FC5_install'],
   30: #             ['Fedora Core 4 Install', 'FC4_install'],
   31: #             ['Fedora Core 3 Install', 'FC3_install'],
   32: #	      ['Fedora Install', 'fedora_install'],
   33: #	      ['Red Hat 7.3 Install', 'rh73'],
   34:               ['CentOS Linux 5 Install','centos5_install'],
   35:               ['Red Hat Enterprise Linux 5 Install','RHEL5_install'],
   36:               ['Red Hat Enterprise Linux 4 Install','RHEL4_install'],
   37:               ['SuSE Linux 10.3 Install', 'suse10.3_install'],
   38:               ['SuSE Linux 10.2 Install', 'suse10.2_install'],
   39:               ['SuSE Linux 10.1 Install', 'suse10.1_install'],
   40: #              ['SuSE Linux Professional 9.3 Install', 'suse9.3_install'],
   41: #              ['SuSE Linux Professional 9.2 Install', 'suse9.2_install'],
   42:               ['SuSE Linux Enterprise Server 10 Install', 'sles10_install'],
   43:               ['SuSE Linux Enterprise Server 9 Install', 'sles9_install'],
   44: #	      ['Manual Install from Tarballs', 'manual_install'],
   45: 	      ['Upgrading from Previous LON-CAPA install', 'upgrade'],
   46: 	      ['LON-CAPA License (Gnu Public License)', 'license']
   47: 	      );
   48: 
   49: my @testing_pages = ( 
   50: 		      );
   51: my @other_pages = ( 
   52: 		    ['Developer Information', 'dev'],
   53: 		    ['Configuration Information', 'config'],
   54: 		    );
   55: 
   56: open SHELL, '<', "shell.html";
   57: my $shell = join '', <SHELL>;
   58: $shell =~ s/\r/\n/g;
   59: 
   60: # Call with: The title, breadcrumb, and content
   61: sub replaceText {
   62:     my ($title, $links, $breadcrumb, $content) = @_;
   63: 
   64:     my $page = $shell;
   65:     $page =~ s/\<!-- *title *--\>/$title/g;
   66:     $page =~ s/\<!-- *links *--\>/$links/g;
   67:     $page =~ s/\<!-- *breadcrumb *--\>/$breadcrumb/g;
   68:     $page =~ s/\<!-- *content *--\>/$content/g;
   69: 
   70:     return $page;
   71: }
   72: 
   73: # Do the index page
   74: 
   75: open INDEX, '>', "index.html";
   76: my $content = <<PRELUDE; 
   77: 
   78: <p>LON-CAPA is based upon a lot of Open Source modules, so it's
   79: important to have the right environment on your computer. This is most
   80: easily done by installing on a dedicated machine while installing the
   81: operating system.</p>
   82: 
   83: <p>The configuring of LON-CAPA is part of the install process of the
   84: software. However, In case something needs to be altered, or isn't
   85: working, here is some <a href="config.html">information on configuring
   86: LON-CAPA</a>.</p>
   87: 
   88: <hr />
   89: PRELUDE
   90: 
   91: $content .= "<ul>\n";
   92: for (@pages) {
   93:     $content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
   94: }
   95: 
   96: $content .= "</ul>\n";
   97: 
   98: my $testing_content = '';
   99: if (@testing_pages) {
  100:     $testing_content .= "<hr/><p>Installation on the following systems requires the use of a testing release of LON-CAPA.</p>\n";
  101:     $testing_content .= "<ul>\n";
  102:     for (@testing_pages) {
  103: 	$testing_content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
  104:     }
  105:     $testing_content .= "</ul>\n";
  106: }
  107: 
  108: 
  109: $content .= <<"POSTLUDE";
  110: <hr />
  111: <a name="download" />
  112: <h3>Downloading LON-CAPA</h3>
  113: 
  114: <p>
  115: <b>Current Production Release is Version LATESTVERSION.
  116: This version was released on LATESTDATE.</b>
  117: </p>
  118: <p>
  119: You can download the <b>most current production version of LON-CAPA</b> at
  120: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
  121: http://install.lon-capa.org/versions/loncapa-current.tar.gz</a>
  122: (version LATESTVERSION).
  123: </p>
  124: TESTINGRELEASE_START
  125: <p>
  126: <b>Current Testing Release is Version LATESTTESTINGVERSION.
  127: This version was released on LATESTTESTINGDATE.</b>
  128: </p>
  129: <p>
  130: You can download the <b>testing version of the upcoming LON-CAPA</b> at
  131: <a href="http://install.lon-capa.org/versions/loncapa-testing.tar.gz">
  132: http://install.lon-capa.org/versions/loncapa-testing.tar.gz</a>
  133: (version LATESTTESTINGVERSION).
  134: </p>
  135: $testing_content
  136: TESTINGRELEASE_END
  137: 
  138: <hr />
  139: POSTLUDE
  140: 
  141: open(RELEASE, '<', "release.frag");
  142: $content .= join('',<RELEASE>);
  143: close(RELEASE);
  144: 
  145: $content .= "<ul>\n";
  146: for (@other_pages) {
  147:     $content .= "<li><a href='$_->[1].html'>$_->[0]</a></li>\n";
  148: }
  149: 
  150: $content .= "</ul>\n";
  151: 
  152: $links='<link rel="alternate" type="application/rss+xml" title="CVS RSS" href="loncapa.rss" />';
  153: 
  154: my $index = replaceText("Install LON-CAPA", $links, "Install LON-CAPA",
  155: 			$content);
  156: 
  157: print INDEX $index;
  158: close INDEX;
  159: 
  160: # Build the pages
  161: for (@pages,@other_pages,@testing_pages) {
  162:     my ($title, $source) = @$_;
  163: 
  164:     # read in content
  165:     open SOURCE, '<', $source.'.frag';
  166:     $content = join '', <SOURCE>;
  167:     close SOURCE;
  168: 
  169:     $content = replaceText($title, '', '<a href="/">Install LON-CAPA</a> &gt; ' . $title,
  170: 			   $content);
  171:     open DEST, '>', $source.'.html';
  172:     print DEST $content;
  173:     close DEST;
  174: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>