build-web.pl Build Web Sites SYNOPSIS build-web.pl [options] OPTIONS --help Display this help page. --make=*makeprog* Specify make program to be used. Default value is *make*. --srcephysdir=*srcedir* Specify the path to the physical directory containing the raw html to be processed. Default value is *srce*. --copy=*[on|off]* Write the results to the destination physical directory. If --copy=*off* is specified then only the pre and post makefile processing is performed. --copy=*on* requires that the --srcewebdir, --destphysdir and --dirmap options be specified. --srcewebdir=*srcewebdir* Assume the raw html contained in the srcephysdir is written as if the root web directory is *srcewebdir*. Requires --copy=*on* --destphysdir=*destphysdir* Write the results of processing the web site to the physical directory *destphysdir*. Requires --copy=*on* --ssiprocess=*[on|off]* Replace the results of Server Side includes (virtual and file only) with the contents of the included files. Default value is *off*. Requires --copy=*on* --dirmap=*dirmap.pl* Replace occurences of directories using the map specified in the *dirmap.pl* script. Requires --copy=*on* --clean=*[on|off]* Remove files from the destphysdir if they do not exist in the srcephysdir. Default value is *off*. Requires --copy=*on* DESCRIPTION If --copy=*on*, build-web.pl will build a Web Site in a given Physical Destination directory from a Web Site contained in a given Source directory by copying the files from the Physical Source directory tree to the Physical Destination directory tree while remapping directory paths as specified in the "DIRMAP.pl" perl program, optionally processing Server Side includes, and optionally applying HTML Templates to HTML files. The Source Web Site exists in the physical directory SRCEPHYSDIR and is assumed to be written as it were located on a Web Server in the SRCEWEBDIR subdirectory of the Server's root directory. This program essentially copies a Physical Source Directory and all subdirectories and files to a Destination Directory while performing the following tasks. If Makefiles exist in the Source Directories, they are 'executed' using the make program specified in --make=*makeprog*. Makefiles with the name "Makefile.pre" will be executed in the Physical Source directory tree before any other processing and can produce new files which will be copied to the Physical Destiantion directory tree. Makefiles with the name "Makefile.post" will be executed in the Destination directory tree and can be used to post process output files generate during the build... For example, zip files of the final versions of files in the DEST directory tree can be created using post Makefiles. In the case where --copy=*off*, the Physical Source and Destination directories are the same and post Makefiles are executed in the Physical Source directory. If the Destination Directories do not exist, they are created. Source Files are not copied if their modification times are not different from the modification times of the existing Destination files. This rule is broken when the template files, include files or Makefiles are modified. A Global timestamp is maintained on the last time the build was run. If any of the templates, include files, Makefiles are modified after the last build, all files are rebuilt. The following Source Directories are not copied: CVS, _vti_* The following Source Files are not copied: Makefile.pre, Makefile.post, Makefile.log, NOWRAP, NOMENU, *-incl.html, template.html, template-nomenu.html, .cvsignore, *~, *.bak, *.swp If the --clean=*on* option is specified, files which exist in the Destination Directories but not in the Source Directories are deleted from the Destination Directories. Binary Files are copied as is. Text Files (not HTML files, i.e. *.htm or *.html) are copied with directory remapping as specified in "DIRMAP.pl". The DIRMAP.pl program specifies the remapping of referenced directories in all Text files. These include *.js, *.css, *.htm, *.html, *.psp, *.php, *.asp, *.pl files. DIRMAP.pl, which can be named anything, consists of a single Hash which specifies the old=>new directory remapping as in: $WEBDIRMAP{'/fromdir/'} = '/todir/'; Note that WEBDIRMAP must contain at least a mapping for the SRCEWEBDIR to a new Web Server directory. HTML Files are copied with directory remapping, then Server Side includes, then HTML Template wrapping. Server Side includes in HTML Files are replaced by the contents of the included files. The included files must reside in the SRCEPHYDIR tree and are not copied to the Destination Directories. The Server Side includes may be either file or virtual, but typically virtual is the most useful. HTML Templates are specified in special files in the SRCEPHYSDIR directory template.html - full template including navigation template-nomenu.html - template wihthout full navigation By default, all HTML files will be wrapped in the template.html template. This may be overridden in each directory by listing the filename on distinct lines in either the NOMENU or NOWRAP text files in each directory. Any file listed in the NOMENU file will be wrapped with the template-nomenu.html file, while any file listed in the NOWRAP file will not be wrapped in a template at all. However, all HTML Files will have their references to directories remapped according to the DIRMAP.pl program. Each Template file uses special strings which are replaced by the corresponding parts of the HTML file being wrapped: %%DOCTYPE%% %%HEAD%% %%TITLE%% %%LAST_UPDATED%% %%BODY%% %%FILENAME%%