1 $! File: Build_GNV_curl_pcsi_text.com
5 $! Build the *.pcsi$text file from the four components:
6 $! 1. Generated =product header section
7 $! 2. [--]readme. file from the Curl distribution, modified to fit
8 $! a pcsi$text file format.
9 $! 3. [--]copying file from the Curl distribution, modified to fit
10 $! a pcsi$text file format.
11 $! 4. Generated Producer section.
13 $! Set the name of the release notes from the GNV_PCSI_FILENAME_BASE
15 $! Copyright 2009, John Malmberg
17 $! Permission to use, copy, modify, and/or distribute this software for any
18 $! purpose with or without fee is hereby granted, provided that the above
19 $! copyright notice and this permission notice appear in all copies.
21 $! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
22 $! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
23 $! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
24 $! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
25 $! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
26 $! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
27 $! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30 $! 15-Jun-2009 J. Malmberg
32 $!===========================================================================
34 $ kit_name = f$trnlnm("GNV_PCSI_KITNAME")
35 $ if kit_name .eqs. ""
37 $ write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
40 $ producer = f$trnlnm("GNV_PCSI_PRODUCER")
41 $ if producer .eqs. ""
43 $ write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
46 $ producer_full_name = f$trnlnm("GNV_PCSI_PRODUCER_FULL_NAME")
47 $ if producer_full_name .eqs. ""
49 $ write sys$output "@MAKE_PCSI_CURL_KIT_NAME.COM has not been run."
54 $! Parse the kit name into components.
55 $!---------------------------------------
56 $ producer = f$element(0, "-", kit_name)
57 $ base = f$element(1, "-", kit_name)
58 $ product = f$element(2, "-", kit_name)
59 $ mmversion = f$element(3, "-", kit_name)
60 $ majorver = f$extract(0, 3, mmversion)
61 $ minorver = f$extract(3, 2, mmversion)
62 $ updatepatch = f$element(4, "-", kit_name)
63 $ if updatepatch .eqs. "-" then updatepatch = ""
66 $ product_line = "=product ''producer' ''base' ''product'"
67 $ if updatepatch .eqs. ""
69 $ product_name = " ''majorver'.''minorver'"
71 $ product_name = " ''majorver'.''minorver'-''updatepatch'"
73 $ product_line = product_line + " ''product_name' full"
76 $! If this is VAX and the file is on NFS, the names may be mangled.
77 $!-----------------------------------------------------------------
79 $ if f$search("[--]readme.") .nes. ""
81 $ readme_file = "[--]readme."
83 $ if f$search("[--]$README.") .nes. ""
85 $ readme_file = "[--]$README."
87 $ write sys$output "Can not find readme file."
92 $ if f$search("[--]copying.") .nes. ""
94 $ copying_file = "[--]copying."
96 $ if f$search("[--]$COPYING.") .nes. ""
98 $ copying_file = "[--]$COPYING."
100 $ write sys$output "Can not find copying file."
105 $! Create the file as a VMS text file.
106 $!----------------------------------------
107 $ base_file = kit_name
108 $ create 'base_file'.pcsi$text
111 $! Start building file.
112 $!----------------------
113 $ open/append ptxt 'base_file'.pcsi$text
114 $ write ptxt product_line
117 $! First insert the Readme file.
119 $ open/read rf 'readme_file'
121 $ write ptxt "1 'PRODUCT"
122 $ write ptxt "=prompt ''producter' ''product' for OpenVMS"
125 $ read/end=rf_loop_end rf line_in
126 $ if line_in .nes. ""
128 $! PCSI files use the first character in for their purposes.
129 $!--------------------------------------------------------------
130 $ first_char = f$extract(0, 1, line_in)
131 $ if first_char .nes. " " then line_in = " " + line_in
139 $! Now add in the copying file
140 $!--------------------------------
142 $ write ptxt "1 'NOTICE"
145 $ open/read cf 'copying_file'
148 $ read/end=cf_loop_end cf line_in
149 $ if line_in .nes. ""
151 $! PCSI files use the first character in for their purposes.
152 $!--------------------------------------------------------------
153 $ first_char = f$extract(0, 1, line_in)
154 $ if first_char .nes. " " then line_in = " " + line_in
161 $! Now we need the rest of the boiler plate.
162 $!--------------------------------------------
164 $ write ptxt "1 'PRODUCER"
165 $ write ptxt "=prompt ''producer_full_name'"
167 "This software product is provided by ''producer_full_name' with no warranty."
169 $ arch_type = f$getsyi("ARCH_NAME")
170 $ node_swvers = f$getsyi("node_swvers")
171 $ vernum = f$extract(1, f$length(node_swvers), node_swvers)
172 $ majver = f$element(0, ".", vernum)
173 $ minverdash = f$element(1, ".", vernum)
174 $ minver = f$element(0, "-", minverdash)
175 $ dashver = f$element(1, "-", minverdash)
176 $ if dashver .eqs. "-" then dashver = ""
177 $ vmstag = majver + minver + dashver
178 $ code = f$extract(0, 1, arch_type)
180 $ write ptxt "1 NEED_VMS''vmstag'"
182 "=prompt OpenVMS ''vernum' or later is not installed on your system."
183 $ write ptxt "This product requires OpenVMS ''vernum' or later to function."
184 $ write ptxt "1 NEED_ZLIB"
185 $ write ptxt "=prompt ZLIB 1.2-8 or later is not installed on your system."
186 $ write ptxt "This product requires ZLIB 1.2-8 or later to function."
187 $ write ptxt "1 SOURCE"
188 $ write ptxt "=prompt Source modules for ''product'"
189 $ write ptxt "The Source modules for ''product' will be installed."
190 $ write ptxt "1 RELEASE_NOTES"
191 $ write ptxt "=prompt Release notes are available in the [SYSHLP] directory."