[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108]
[0109]
[0110]
[0111]
[0112]
[0113]
[0114]
[0115]
[0116]
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123]
[0124]
[0125]
[0126]
[0127]
[0128]
[0129]
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149]
[0150]
[0151]
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159]
[0160]
[0161]
[0162]
[0163]
[0164]
[0165]
[0166]
[0167]
[0168]
[0169]
[0170]
[0171]
[0172]
[0173]
[0174]
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181]
[0182]
[0183]
[0184]
[0185]
[0186]
[0187]
[0188]
[0189]
[0190]
[0191]
[0192]
[0193]
[0194]
[0195]
[0196]
[0197]
[0198]
[0199]
[0200]
[0201]
[0202]
[0203]
[0204]
[0205]
[0206]
[0207]
[0208]
[0209]
[0210]
[0211]
[0212]
[0213]
[0214]
[0215]
[0216]
[0217]
[0218]
[0219]
[0220]
[0221]
[0222]
[0223]
[0224]
[0225]
[0226]
[0227]
[0228]
[0229]
[0230]
[0231]
[0232]
[0233]
[0234]
[0235]
[0236]
[0237]
[0238]
[0239]
[0240]
[0241]
[0242]
[0243]
[0244]
[0245]
[0246]
[0247]
[0248]
[0249]
[0250]
[0251]
[0252]
[0253]
[0254]
[0255]
[0256]
[0257]
[0258]
[0259]
[0260]
[0261]
[0262]
[0263]
[0264]
[0265]
[0266]
[0267]
[0268]
[0269]
[0270]
[0271]
[0272]
[0273]
[0274]
[0275]
[0276]
[0277]
[0278]
[0279]
[0280]
[0281]
[0282]
[0283]
[0284]
[0285]
[0286]
[0287]
[0288]
[0289]
[0290]
[0291]
[0292]
[0293]
[0294]
[0295]
[0296]
[0297]
[0298]
[0299]
[0300]
[0301]
[0302]
[0303]
[0304]
[0305]
[0306]
[0307]
[0308]
[0309]
[0310]
[0311]
[0312]
[0313]
[0314]
[0315]
[0316]
[0317]
[0318]
[0319]
[0320]
[0321]
[0322]
[0323]
[0324]
[0325]
[0326]
[0327]
[0328]
[0329]
[0330]
[0331]
[0332]
[0333]
[0334]
[0335]
[0336]
[0337]
[0338]
[0339]
[0340]
[0341]
[0342]
[0343]
[0344]
[0345]
[0346]
[0347]
[0348]
[0349]
[0350]
[0351]
[0352]
[0353]
[0354]
[0355]
[0356]
[0357]
[0358]
[0359]
[0360]
[0361]
[0362]
[0363]
[0364]
[0365]
[0366]
[0367]
[0368]
[0369]
[0370]
[0371]
[0372]
[0373]
[0374]
[0375]
[0376]
[0377]
[0378]
[0379]
[0380]
[0381]
[0382]
[0383]
[0384]
[0385]
[0386]
[0387]
[0388]
[0389]
[0390]
[0391]
[0392]
[0393]
[0394]
[0395]
[0396]
[0397]
[0398]
[0399]
[0400]
[0401]
[0402]
[0403]
[0404]
[0405]
[0406]
[0407]
[0408]
[0409]
[0410]
[0411]
[0412]
[0413]
[0414]
[0415]
[0416]
[0417]
[0418]
[0419]
[0420]
[0421]
[0422]
[0423]
[0424]
[0425]
[0426]
[0427]
[0428]
[0429]
[0430]
[0431]
[0432]
[0433]
[0434]
[0435]
[0436]
[0437]
[0438]
[0439]
[0440]
[0441]
[0442]
[0443]
[0444]
[0445]
[0446]
[0447]
[0448]
[0449]
[0450]
[0451]
[0452]
[0453]
[0454]
[0455]
[0456]
[0457]
[0458]
[0459]
[0460]
[0461]
[0462]
[0463]
[0464]
[0465]
[0466]
[0467]
[0468]
$!-----------------------------------------------------------------'f$verify(0)
$! CLONE.COM
$!
$! This procedure creates another DCL procedure that contains ZIP commands to
$! archive selected portions of the current system's WASD_ROOT:[000000] tree.
$! That archive can then be restored on some other system avoiding the full
$! installation process and providing a site-specific server environment.
$!
$! By default archive procedures and archives are created in the current
$! directory, so to place these in [LOCAL] use
$!
$!   $ SET DEFAULT WASD_ROOT:[LOCAL]
$!   $ @[INSTALL]CLONE
$!   $! then to create the ZIP archive in the same directory
$!   $ @[INSTALL]CLONE_WASD
$!
$! Copyright (C) 1996-2021 Mark G.Daniel.
$!
$! Licensed under the Apache License, Version 2.0 (the "License");
$! you may not use this file except in compliance with the License.
$! You may obtain a copy of the License at
$!
$!    http://www.apache.org/licenses/LICENSE-2.0
$!
$! Unless required by applicable law or agreed to in writing, software
$! distributed under the License is distributed on an "AS IS" BASIS,
$! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
$! See the License for the specific language governing permissions and
$! limitations under the License.
$!
$! 18-OCT-2021  MGD  v12.0.0, +X86_64, -VAX supports
$! 22-JUN-2020  MGD  v11.5.0, documentation via wasDOC
$! 07-NOV-2009  MGD  v10.0.0, logical naming schema
$! 14-SEP-2007  MGD  up-case procedure spec to avoid mixed-case issues
$! 23-DEC-2003  MGD  IA64 support
$! 25-NOV-2002  MGD  initial
$!-----------------------------------------------------------------------------
$!
$ if f$trnlnm("CLONE$DBUG") .nes. "" then set verify
$!
$ ss$_abort = 44
$ ss$_bugcheck = 676
$ say = "write sys$output"
$ vms_version = f$integer(f$extract(1,1,f$getsyi("version"))) * 10 +-
                f$integer(f$extract(3,1,f$getsyi("version")))
$ if vms_version .ge. 72 then set process /parse=traditional
$ set control=Y
$ on controly then exit ss$_abort
$!
$ defaultProcedure = "CLONE_WASD.COM"
$ procCom = f$element(0,";",f$edit(f$environment("procedure"),"upcase"))
$ ftime = f$extract(0,17,f$time())
$!
$ if f$environment("depth") .eq. 1 then @wasd_root:[install]copyright.com
$!
$ type sys$input
                           ***********************
                           *  CLONE THE PACKAGE  *
                           ***********************

This utility creates a separate DCL procedure containing ZIP commands to
archive specified portions of the current system's WASD_ROOT:[000000] tree. 
That procedure can then be executed to create an archive which may then be
UNZIPed on any other system(s) to create a copy of the original.  In this way
multiple WASD packages can be deployed without going through the full
installation process and using the original as a working template.

Some portions of the package are essential to any working installation.  These
are always archived.  Others are prompted for and commands to archive those are
only added to the procedure if required.  Multiple such procedures may be
created by specifying unique archive procedure names.

$ response = ""
$ read sys$command response /prompt="Create a cloning procedure? [NO]: "
$ say ""
$ if .not. response then exit
$!
$ type sys$input
                          ************************
                          *  DCL PROCEDURE NAME  *
                          ************************

If multiple cloning procedures are required enter a specific file name,
otherwise use the default.

$ response = ""
$ read sys$command response /prompt="DCL procedure? [''defaultProcedure']: "
$ say ""
$ if response .eqs. "" then response = defaultProcedure
$ zipProcedure = response + ";" - ".COM;" + ".COM"
$ zipArchive =  response + ";" - ".COM;" + ".ZIP"
$!
$ axpDetected = 0
$ ia64Detected = 0
$ x86Detected = 0
$ if f$search("WASD_ROOT:[AXP]*.EXE") .nes. "" then axpDetected = 1
$ if f$search("WASD_ROOT:[IA64]*.EXE") .nes. "" then ia64Detected = 1
$ if f$search("WASD_ROOT:[X86_64]*.EXE") .nes. "" then x86Detected = 1
$ archCount = 0
$ if axpDetected then archCount = archCount + 1
$ if ia64Detected then archCount = archCount + 1
$ if x86Detected then archCount = archCount + 1
$!
$ type sys$input
                             ******************
                             *  ARCHITECTURE  *
                             ******************

$ if archCount .eq. 0
$ then
$    type sys$input
No files detected in any of [AXP], [IA64] or [X86_64].
This does not make sense!

$    exit ss$_abort
$ endif
$ if archCount .gt. 1
$ then
$    type sys$input
Executables for multiple architectures ([AXP], [IA64], [X86_64]) detected.

$    addAxp = 0
$    if axpDetected
$    then
$       response = ""
$       read sys$command response /prompt="Add [AXP] executables? [NO]: "
$       say ""
$       if response then addAxp = 1
$    endif
$    addIa64 = 0
$    if ia64Detected
$    then
$       response = ""
$       read sys$command response /prompt="Add [IA64] executables? [NO]: "
$       say ""
$       if response then addIa64 = 1
$    endif
$    addX86 = 0
$    if x86Detected
$    then
$       response = ""
$       read sys$command response /prompt="Add [X86_64] executables? [NO]: "
$       say ""
$       if response then addX86 = 1
$    endif
$ else
$    addAxp = 0
$    addIa64 = 0
$    addX86 = 0
$    if axpDetected
$    then
$       say "Will be using [AXP] executables."
$       addAxp = 1
$    endif
$    if ia64Detected
$    then
$       say "Will be using [IA64] executables."
$       addIa64 = 1
$    endif
$    if x86Detected
$    then
$       say "Will be using [X86_64] executables."
$       addX86 = 1
$    endif
$    say ""
$ endif
$ response = ""
$ read sys$command response /prompt="Continue? [NO]: "
$ say ""
$ if .not. response then exit
$!
$ type sys$input
                               ***************
                               *  ESSENTIAL  *
                               ***************

These directories and files are essential and always included:

$ if addAxp
$ then
$    type sys$input
  [AXP]              HTTPD.EXE  HTTPD_SSL.EXE  HTTPDMON.EXE  SECHAN.EXE 
  [AXP-BIN]          Alpha script executables
$ endif
$ type sys$input
  [CGI-BIN]          architecture-neutral script files
  [HTTP$NOBODY]      server account home
  [HTTP$SERVER]      scripting account home
$ if addIa64
$ then
$    type sys$input
  [IA64]             HTTPD.EXE  HTTPD_SSL.EXE  HTTPDMON.EXE  SECHAN.EXE 
  [IA64-BIN]         IA64 script executables
$ endif
$ type sys$input
  [INSTALL]          installation, update and security procedures
  [LOCAL]            local configuration files
  [LOG]              access logs
  [LOG_SERVER]       server process logs
  [RUNTIME.HTTPD]    server runtime files (directory listing graphics, etc)
  [SCRATCH]          scripting scratch space
  [STARTUP]          startup procedures (STARTUP*.COM)
$ if addX86
$ then
$    type sys$input
  [X86_64]              HTTPD.EXE  HTTPD_SSL.EXE  HTTPDMON.EXE  SECHAN.EXE 
  [X86_64-BIN]          X86_64 script executables
$ endif
$ type sys$input

Most directories retain some files (e.g. .WWW_HIDDEN, READMEs) but are only
optionally populated with other files as requested.

$ response = ""
$ read sys$command response /prompt="Continue? [NO]: "
$ say ""
$ if .not. response then exit
$!
$ type sys$input
                             *******************
                             *  CONFIGURATION  *
                             *******************

Files from [LOCAL]*.conf (e.g. HTTPD$CONFIG, HTTPD$MAP, etc.)

$ response = ""
$ read sys$command response /prompt="Add? [NO]: "
$ say ""
$ addConfig = 0
$ if response then addConfig = 1
$!
$ type sys$input
                                *************
                                *  SCRIPTS  *
                                *************

Files from [CGI-BIN] and executables from [AXP-BIN] and/or [IA64-BIN] and/or
[X86_64-BIN].  Note that this adds ALL files from these directories.  Of course
you can manually edit the resultant procedure to remove unwanted items.

This also adds the rest of the files from the [RUNTIME...] directory tree
(remembering that [RUNTIME.HTTPD] is included with the essential files).

$ response = ""
$ read sys$command response /prompt="Add? [NO]: "
$ say ""
$ addScript = 0
$ if response then addScript = 1
$!
$ type sys$input
                             *******************
                             *  DOCUMENTATION  *
                             *******************

Files from [WASDDOC...]*.*

$ response = ""
$ read sys$command response /prompt="Add? [NO]: "
$ say ""
$ addDocumentation = 0
$ if response then addDocumentation = 1
$!
$ type sys$input
                          ************************
                          *  EXAMPLE & EXERCISE  *
                          ************************

Files from [EXAMPLE]*.* and [EXERCISE]*.*.

$ response = ""
$ read sys$command response /prompt="Add? [NO]: "
$ say ""
$ addExampleExercise = 0
$ if response then addExampleExercise = 1
$!
$ type sys$input
                                ************
                                *  SOURCE  *
                                ************

Files from [SRC...]*.*.

$ response = ""
$ read sys$command response /prompt="Add? [NO]: "
$ say ""
$ addSource = 0
$ if response then addSource = 1
$ if addSource
$ then
$    response = ""
$    read sys$command response /prompt="Include object modules? [NO]: "
$    say ""
$    addSourceObjects = 0
$    if response then addSourceObjects = 1
$ endif
$!
$ type sys$input
                      ********************************
                      *  CREATING ARCHIVE PROCEDURE  *
                      ********************************

$ if f$trnlnm("ZIPF","LNM$PROCESS") .nes. "" then close zipf
$ open /write zipf 'zipProcedure'
$ wzipf = "write zipf"
$!
$ wzipf "$! ''zipProcedure' created by ''procCom' at ''ftime'"
$ wzipf "$!"
$ wzipf "$ write sys$output """""
$ wzipf "$ write sys$output ""''zipProcedure' created by ''procCom' at ''ftime'"""
$ wzipf "$ write sys$output """""
$ wzipf "$!"
$ wzipf "$ define /user sys$output nl:"
$ wzipf "$ define /user sys$error nl:"
$ wzipf "$ zip -h"
$ wzipf "$ if .not. $status then exit $status"
$ wzipf "$!"
$ wzipf "$ zipName = """""
$ wzipf "$ read sys$command zipName /prompt=""ZIP archive name? [''zipArchive']: """
$ wzipf "$ if zipName .eqs. """" then zipName = ""''zipArchive'"""
$ wzipf "$ zipName = f$element(0,"";"",f$parse(zipName))"
$ wzipf "$ if f$search(zipName) .nes. """""
$ wzipf "$ then"
$ wzipf "$    write sys$output """""
$ wzipf "$    write sys$output ""Any existing archives should be deleted!"""
$ wzipf "$    delete = ""delete/confirm"""
$ wzipf "$    delete " + "'" + "zipName" + "'" + ";*"
$ wzipf "$ endif"
$ wzipf "$!"
$ wzipf "$ wasdRootParent = f$trnlnm(""WASD_ROOT"",,""no_conceal"")"
$ wzipf "$ wasdRootParent = wasdRootParent - "".]"" + "".-]"""
$ wzipf "$ currentDefault = f$environment(""default"")"
$ wzipf "$ set control=y"
$ wzipf "$ on controly then goto tidyup"
$ wzipf "$ set default " + "'" + "wasdRootParent" + "'"
$ wzipf "$ write sys$output """""
$ wzipf "$ write sys$output ""Parent directory for WASD_ROOT is "" + f$environment(""default"")"
$ wzipf "$ write sys$output """""
$ wzipf "$ set noon"
$!
$ zipv = """$ ZIP """"-V"""" " + "'" + "zipName" + "'" + " """
$ zipt = """$ ZIP """"-T"""" " + "'" + "zipName" + "'" + " """
$ zipd = """$!! ZIP """"-d"""" " + "'" + "zipName" + "'" + " """
$!
$ wzipf "$!"
$ wzipf "$! essential directories and files"
$ wzipf 'zipv' + "[.WASD_ROOT.CGI-BIN]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.CGI-BIN].WWW_*"
$ wzipf 'zipv' + "[.WASD_ROOT.HTTP$NOBODY]LOGIN.COM"
$ wzipf 'zipv' + "[.WASD_ROOT.HTTP$NOBODY]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.HTTP$NOBODY].WWW_*"
$ wzipf 'zipv' + "[.WASD_ROOT.HTTP$SERVER]LOGIN.COM"
$ wzipf 'zipv' + "[.WASD_ROOT.HTTP$SERVER]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.HTTP$SERVER].WWW_*"
$ wzipf 'zipv' + "[.WASD_ROOT.INSTALL]*.COM"
$ wzipf 'zipv' + "[.WASD_ROOT.INSTALL]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.LOCAL]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.LOCAL].WWW_*"
$ wzipf 'zipv' + "[.WASD_ROOT.LOG]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.LOG].WWW_*"
$ wzipf 'zipv' + "[.WASD_ROOT.LOG_SERVER]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.LOG_SERVER].WWW_*"
$ wzipf 'zipv' + "[.WASD_ROOT.SCRATCH]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.SCRATCH].WWW_*"
$ wzipf 'zipv' + "[.WASD_ROOT.STARTUP]*.COM -x *LATEST.COM"
$ wzipf 'zipv' + "[.WASD_ROOT.STARTUP]README.*"
$ wzipf 'zipv' + "[.WASD_ROOT.STARTUP].WWW_*"
$ wzipf 'zipv' + "[.WASD_ROOT.RUNTIME.HTTPD]*.*"
$ if addConfig
$ then
$    wzipf "$!"
$    wzipf "$! configuration files"
$    wzipf 'zipv' + "[.WASD_ROOT.LOCAL]*.CONF"
$ endif
$ if addAxp
$ then
$    wzipf "$!"
$    wzipf "$! Alpha (AXP) architecture directories and essential executables"
$    wzipf 'zipv' + "[.WASD_ROOT.AXP-BIN]README.*"
$    wzipf 'zipv' + "[.WASD_ROOT.AXP-BIN].WWW_*"
$    wzipf 'zipv' + "[.WASD_ROOT.AXP]HTTPD.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.AXP]HTTPD_SSL.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.AXP]HTTPDMON.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.AXP]SECHAN.EXE"
$ endif
$ if addIa64
$ then
$    wzipf "$!"
$    wzipf "$! IA64 architecture directories and essential executables"
$    wzipf 'zipv' + "[.WASD_ROOT.IA64-BIN]README.*"
$    wzipf 'zipv' + "[.WASD_ROOT.IA64-BIN].WWW_*"
$    wzipf 'zipv' + "[.WASD_ROOT.IA64]HTTPD.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.IA64]HTTPD_SSL.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.IA64]HTTPDMON.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.IA64]SECHAN.EXE"
$ endif
$ if addX86
$ then
$    wzipf "$!"
$    wzipf "$! X86_64 architecture directories and essential executables"
$    wzipf 'zipv' + "[.WASD_ROOT.X86_64-BIN]README.*"
$    wzipf 'zipv' + "[.WASD_ROOT.X86_64-BIN].WWW_*"
$    wzipf 'zipv' + "[.WASD_ROOT.X86_64]HTTPD.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.X86_64]HTTPD_SSL.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.X86_64]HTTPDMON.EXE"
$    wzipf 'zipv' + "[.WASD_ROOT.X86_64]SECHAN.EXE"
$ endif
$ if addScript
$ then
$    wzipf "$!"
$    wzipf "$! script files"
$    wzipf 'zipv' + "[.WASD_ROOT.CGI-BIN]*.*"
$    if addAxp then wzipf 'zipv' + "[.WASD_ROOT.AXP-BIN]*.*"
$    if addIa64 then wzipf 'zipv' + "[.WASD_ROOT.IA64-BIN]*.*"
$    if addX86 then wzipf 'zipv' + "[.WASD_ROOT.X86_64-BIN]*.*"
$    wzipf 'zipv' + "[.WASD_ROOT.RUNTIME...]*.* -x [.WASD_ROOT.RUNTIME.HTTPD]*"
$ endif
$ if addDocumentation
$ then
$    wzipf "$!"
$    wzipf "$! wasDOC documentation"
$    wzipf 'zipv' + "[.WASD_ROOT.WASDOC...]*.*
$ endif
$ if addExampleExercise
$ then
$    wzipf "$!"
$    wzipf "$! examples and exercise"
$    wzipf 'zipv' + "[.WASD_ROOT.EXAMPLE...]*.*"
$    wzipf 'zipv' + "[.WASD_ROOT.EXERCISE...]*.*"
$ endif
$ if addSource
$ then
$    wzipf "$!"
$    if addSourceObjects
$    then
$       wzipf "$! source files (including object modules)"
$       wzipf 'zipv' + "[.WASD_ROOT.SRC...]*.*"
$    else
$       wzipf "$! source files (excluding object modules)"
$       wzipf 'zipv' + "[.WASD_ROOT.SRC...]*.* -x *.OBJ"
$    endif
$ endif
$ wzipf "$!"
$ wzipf "$! example ZIP command to delete unwanted item(s)"
$ wzipf 'zipd' + "[.WASD_ROOT.CGI-BIN]CGI_SYMBOLS.COM"
$ wzipf "$!"
$ wzipf "$ write sys$output """""
$ wzipf "$! test integrity of archive"
$ wzipf 'zipt'
$ wzipf "$!"
$ wzipf "$ set protection=w " + "'" + "zipName" + "'"
$ wzipf "$!"
$ wzipf "$ tidyup:"
$ wzipf "$ set default " + "'" + "currentDefault" + "'"
$ wzipf "$ write sys$output """""
$!
$ close zipf
$ set protection=w 'zipProcedure'
$ say "Created " + f$search("''zipProcedure'")
$ type sys$input

The contents of this procedure can be manually modified and/or other command
lines added to archive or remove specific areas and/or files.

                            *********************
                            *  C O M P L E T E  *
                            *********************

$!-----------------------------------------------------------------------------