1 $! File: MAKE_PCSI_CURL_KIT_NAME.COM
5 $! Calculates the PCSI kit name for use in building an installation kit.
6 $! PCSI is HP's PolyCenter Software Installation Utility.
8 $! The results are stored in as logical names so that other procedures
11 $! Copyright 2009, John Malmberg
13 $! Permission to use, copy, modify, and/or distribute this software for any
14 $! purpose with or without fee is hereby granted, provided that the above
15 $! copyright notice and this permission notice appear in all copies.
17 $! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
18 $! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
19 $! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
20 $! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21 $! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
22 $! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
23 $! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 $! 11-Jun-2009 J. Malmberg
27 $!========================================================================
30 $ default_dir = f$environment("DEFAULT")
32 $! Move to the base directories
35 $! Put things back on error.
36 $ on warning then goto all_exit
38 $! The producer is the name or common abbreviation for the entity that is
39 $! making the kit. It must be set as a logical name before running this
42 $! HP documents the producer as the legal owner of the software, but for
43 $! open source work, it should document who is creating the package for
46 $ producer = f$trnlnm("GNV_PCSI_PRODUCER")
47 $ if producer .eqs. ""
49 $ write sys$output "The logical name GNV_PCSI_PRODUCER needs to be defined."
50 $ write sys$output "This should be set to the common abbreviation or name of"
51 $ write sys$output "the entity creating this kit. If you are an individual"
52 $ write sys$output "then use your initials."
55 $ producer_full_name = f$trnlnm("GNV_PCSI_PRODUCER_FULL_NAME")
56 $ if producer_full_name .eqs. ""
58 $ write sys$output "The logical name GNV_PCSI_PRODUCER_FULL_NAME needs to"
59 $ write sys$output "be defined. This should be set to the full name of"
60 $ write sys$output "the entity creating this kit. If you are an individual"
61 $ write sys$output "then use your name."
62 $ write sys$output "EX: DEFINE GNV_PCSI_PRODUCER_FULL_NAME ""First M. Last"""
66 $ write sys$output "*****"
67 $ write sys$output "***** Producer = ''producer'"
68 $ write sys$output "*****"
71 $! Base is one of 'VMS', 'AXPVMS', 'I64VMS', 'VAXVMS' and indicates what
72 $! binaries are in the kit. A kit with just 'VMS' can be installed on all
76 $ arch_type = f$getsyi("ARCH_NAME")
77 $ code = f$extract(0, 1, arch_type)
78 $ if (code .eqs. "I") then base = "I64VMS"
79 $ if (code .eqs. "V") then base = "VAXVMS"
80 $ if (code .eqs. "A") then base = "AXPVMS"
86 $! We need to get the version from curlver_h. It will have a line like
87 $! #define LIBCURL_VERSION "7.31.0"
89 $! #define LIBCURL_VERSION "7.32.0-20130731".
91 $! The dash indicates that this is a daily pre-release.
94 $ open/read/error=version_loop_end vhf [.include.curl]curlver.h
97 $ if line_in .eqs. "" then goto version_loop
98 $ if f$locate("#define LIBCURL_VERSION ", line_in) .ne. 0
102 $ raw_version = f$element(2," ", line_in) - """" - """"
108 $ if f$search("''default_dir'vms_eco_level.h") .nes. ""
110 $ open/read ef 'default_dir'vms_eco_level.h
112 $ read/end=ecolevel_loop_end ef line_in
113 $ prefix = f$element(0, " ", line_in)
114 $ if prefix .nes. "#define" then goto ecolevel_loop
115 $ key = f$element(1, " ", line_in)
116 $ value = f$element(2, " ", line_in) - """" - """"
117 $ if key .eqs. "VMS_ECO_LEVEL"
119 $ eco_level = "''value'"
120 $ if eco_level .eqs. "0"
124 $ eco_level = "E" + eco_level
126 $ goto ecolevel_loop_end
134 $! This translates to V0732-0 or D0732-0
135 $! We encode the snapshot date into the version as an ECO since a daily
136 $! can never have an ECO.
138 $! version_type = 'V' for a production release, and 'D' for a build from a
139 $! daiy snapshot of the curl source.
140 $ majorver = f$element(0, ".", raw_version)
141 $ minorver = f$element(1, ".", raw_version)
142 $ raw_update = f$element(2, ".", raw_version)
143 $ update = f$element(0, "-", raw_update)
144 $ if update .eqs. "0" then update = ""
145 $ daily_tag = f$element(1, "-", raw_update)
148 $ if daily_tag .nes. "-"
151 $ daily_tag_len = f$length(daily_tag)
152 $ daily_tag = f$extract(4, daily_tag_len - 4, daily_tag)
153 $ patch = vtype + daily_tag
154 $ product = product + "_d"
157 $ if eco_level .nes. "" then patch = eco_level
161 $ version_fao = "!2ZB!2ZB"
162 $ mmversion = f$fao(version_fao, 'majorver', 'minorver')
163 $ version = vtype + "''mmversion'"
164 $ if update .nes. "" .or. patch .nes. ""
166 $! The presence of a patch implies an update
167 $ if update .eqs. "" .and. patch .nes. "" then update = "0"
168 $ version = version + "-" + update + patch
172 $ version = version + "-"
175 $! Kit type 1 is complete kit, the only type that this procedure will make.
178 $! Write out a logical name for the resulting base kit name.
179 $ name = "''producer'-''base'-''product'-''version'-''kittype'"
180 $ define GNV_PCSI_KITNAME "''name'"
181 $ fname = "''product'-''fversion'"
182 $ define GNV_PCSI_FILENAME_BASE "''fname'"
183 $ write sys$output "*****"
184 $ write sys$output "***** GNV_PCSI_KITNAME = ''name'."
185 $ write sys$output "***** GNV_PCSI_FILENAME_BASE = ''fname'."
186 $ write sys$output "*****"
189 $ set def 'default_dir'