geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

223 lines
9.1 KiB

  1. $!
  2. $ olddir = f$environment("default")
  3. $ on error then goto End
  4. $!
  5. $ gosub Init
  6. $!
  7. $ call WriteProductDescriptionFile
  8. $ call WriteProductTextFile
  9. $!
  10. $! backup tree
  11. $!
  12. $ backup [-...]*.*;0/excl=([]*.exe,*.obj,*.opt,*.hlp,*.hlb,*.bck,*.com,*.pcsi*) -
  13. libssh2-'versionname''datename'_src.bck/save
  14. $ purge libssh2-'versionname''datename'_src.bck
  15. $!
  16. $! backup examples
  17. $!
  18. $ backup [-.example]*.c;0 libssh2_examples-'versionname''datename'.bck/save
  19. $ dire libssh2_examples-'versionname''datename'.bck
  20. $ purge libssh2_examples-'versionname''datename'.bck
  21. $!
  22. $ set default [-]
  23. $!
  24. $ defdir = f$environment( "default" )
  25. $ thisdev = f$parse(defdir,,,"device","no_conceal")
  26. $ thisdir = f$parse(defdir,,,"directory","no_conceal") - "][" - "][" - "][" - "]["
  27. $!
  28. $ libssh2_kf = thisdev + thisdir
  29. $ libssh2_kf = libssh2_kf - "]" + ".]"
  30. $!
  31. $ set default 'mdir'
  32. $!
  33. $ define/translation_attributes=concealed libssh2_kf 'libssh2_kf'
  34. $!
  35. $ product package libssh2 -
  36. /base='arch' -
  37. /producer=jcb -
  38. /source=[] - ! where to find PDF and PTF
  39. /destination=[] - ! where to put .PCSI file
  40. /material=libssh2_kf:[000000...] - ! where to find product material
  41. /version="''vms_majorv'.''minorv'-''patchv'''datename'" -
  42. /format=sequential
  43. $!
  44. $End:
  45. $!
  46. $ set noon
  47. $ if f$search("*.pcsi$desc;*") .nes. "" then delete *.pcsi$desc;*
  48. $ if f$search("*.pcsi$text;*") .nes. "" then delete *.pcsi$text;*
  49. $ if f$search("libssh2-''versionname'''datename'_src.bck;*") .nes. "" then delete libssh2-'versionname''datename'_src.bck;*
  50. $ if f$search("libssh2_examples-''versionname'''datename'.bck;*") .nes. "" then delete libssh2_examples-'versionname''datename'.bck;*
  51. $!
  52. $ if f$trnlnm("libssh2_kf") .nes. "" then deassign libssh2_kf
  53. $ set default 'olddir'
  54. $!
  55. $exit
  56. $!
  57. $!--------------------------------------------------------------------------------
  58. $!
  59. $Init:
  60. $ set process/parse=extended
  61. $!
  62. $ say = "write sys$output"
  63. $!
  64. $ mdir = f$environment("procedure")
  65. $ mdir = mdir - f$parse(mdir,,,"name") - f$parse(mdir,,,"type") - f$parse(mdir,,,"version")
  66. $!
  67. $ set default 'mdir'
  68. $!
  69. $ pipe search [-.include]*.h libssh2_version_major/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
  70. define/job majorv &l )
  71. $ pipe search [-.include]*.h libssh2_version_minor/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
  72. define/job minorv &l )
  73. $ pipe search [-.include]*.h libssh2_version_patch/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
  74. define/job patchv &l )
  75. $!
  76. $ majorv = f$trnlnm("majorv")
  77. $ minorv = f$integer(f$trnlnm("minorv"))
  78. $ patchv = f$integer( f$trnlnm("patchv"))
  79. $!
  80. $ deassign/job majorv
  81. $ deassign/job minorv
  82. $ deassign/job patchv
  83. $!
  84. $ vms_majorv = f$trnlnm("vms_majorv")
  85. $ if vms_majorv .eqs. "" then vms_majorv = majorv
  86. $!
  87. $ arch = "UNKNOWN"
  88. $ if f$getsyi("arch_type") .eq. 2 then arch = "AXPVMS"
  89. $ if f$getsyi("arch_type") .eq. 3 then arch = "I64VMS"
  90. $!
  91. $ if arch .eqs. "UNKNOWN"
  92. $ then
  93. $ say "Unsupported or unknown architecture, only works on Alpha and Itanium"
  94. $ exit 2
  95. $ endif
  96. $!
  97. $! is this a proper release or a daily snapshot?
  98. $! crummy, but should work.
  99. $!
  100. $ daily = "TRUE"
  101. $ firstdash = f$locate("-",mdir)
  102. $ restdir = f$extract( firstdash + 1, 80, mdir)
  103. $ seconddash = f$locate("-", restdir)
  104. $ if seconddash .ge. f$length( restdir )
  105. $ then
  106. $ daily = "FALSE"
  107. $ datename = "Final"
  108. $ else
  109. $ datename = "D" + f$extract(seconddash+1,8,restdir)
  110. $ endif
  111. $!
  112. $ if daily
  113. $ then
  114. $ productname = "JCB ''arch' LIBSSH2 V''vms_majorv'.''minorv'-''patchv'''datename'"
  115. $ else
  116. $ productname = "JCB ''arch' LIBSSH2 V''vms_majorv'.''minorv'-''patchv'''datename'"
  117. $ endif
  118. $!
  119. $ productfilename = "JCB-''arch'-LIBSSH2-" + f$fao("V!2ZL!2ZL-!2ZL!AS-1", f$integer(vms_majorv),minorv,patchv,datename)
  120. $!
  121. $ versionname = "''vms_majorv'_''minorv'_''patchv'"
  122. $!
  123. $return
  124. $!
  125. $!--------------------------------------------------------------------------------
  126. $!
  127. $WriteProductDescriptionFile: subroutine
  128. $!
  129. $ open/write pd 'productfilename'.PCSI$DESC
  130. $!
  131. $ write pd "product ''productname' full ;"
  132. $ write pd " software DEC ''arch' VMS ;"
  133. $ write pd " if (not <software DEC ''arch' VMS version minimum V8.3>) ;
  134. $ write pd " error NEED_VMS83 ;"
  135. $ write pd " end if ;"
  136. $ write pd " software HP ''arch' SSL version minimum V1.3;"
  137. $ write pd " if (not <software HP ''arch' SSL version minimum V1.3>) ;
  138. $ write pd " error NEED_SSL ;"
  139. $ write pd " end if ;"
  140. $ write pd " execute preconfigure (""set process/parse_type=extended"");"
  141. $ write pd " execute postinstall (""set process/parse_type=extended"","
  142. $ write pd " ""rename pcsi$destination:[gnv]usr.dir usr.DIR"","
  143. $ write pd " ""rename pcsi$destination:[gnv.usr]include.dir include.DIR"","
  144. $ write pd " ""rename pcsi$destination:[gnv.usr.include]libssh2.dir libssh2.DIR"","
  145. $ write pd " ""rename pcsi$destination:[gnv.usr.include.libssh2]libssh2.h libssh2.h"","
  146. $ write pd " ""rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_publickey.h libssh2_publickey.h"","
  147. $ write pd " ""rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_sftp.h libssh2_sftp.h"","
  148. $ write pd " ""rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_config.h libssh2_config.h"","
  149. $ write pd " ""rename pcsi$destination:[gnv.usr]lib.dir lib.DIR"","
  150. $ write pd " ""rename pcsi$destination:[gnv.usr.lib]gnv$libssh2_''versionname'.exe gnv$libssh2_''versionname'.exe"","
  151. $ write pd " ""rename pcsi$destination:[gnv.usr.share.doc.libssh2]libssh2.hlb libssh2.hlb"");"
  152. $ write pd " information RELEASE_NOTES phase after ;"
  153. $ write pd " option EXAMPLE default 0 ;"
  154. $ write pd " directory ""[gnv.usr.share.doc.libssh2.examples]"" ;"
  155. $ write pd " file ""[gnv.usr.share.doc.libssh2.examples]libssh2_examples-''versionname'''datename'.bck"";"
  156. $ write pd " end option ;"
  157. $ write pd " option SOURCE default 0 ;"
  158. $ write pd " directory ""[gnv.common_src]"" ;"
  159. $ write pd " file ""[gnv.common_src]libssh2-''versionname'''datename'_src.bck"";"
  160. $ write pd " end option ;"
  161. $ write pd " directory ""[gnv]"" ;"
  162. $ write pd " directory ""[gnv.usr]"" ;"
  163. $ write pd " directory ""[gnv.usr.lib]"" ;"
  164. $ write pd " directory ""[gnv.usr.include]"" ;"
  165. $ write pd " directory ""[gnv.usr.include.libssh2]"" ;"
  166. $ write pd " directory ""[gnv.usr.share]"" ;"
  167. $ write pd " directory ""[gnv.usr.share.doc]"" ;"
  168. $ write pd " directory ""[gnv.usr.share.doc.libssh2]"" ;"
  169. $ write pd " file ""[gnv.usr.include.libssh2]libssh2.h"" source ""[include]libssh2.h"";"
  170. $ write pd " file ""[gnv.usr.include.libssh2]libssh2_publickey.h"" source ""[include]libssh2_publickey.h"";"
  171. $ write pd " file ""[gnv.usr.include.libssh2]libssh2_sftp.h"" source ""[include]libssh2_sftp.h"";"
  172. $ write pd " file ""[gnv.usr.include.libssh2]libssh2_config.h"" source ""[vms]libssh2_config.h"";"
  173. $ write pd " file ""[gnv.usr.share.doc.libssh2]libssh2.hlb"" source ""[vms]libssh2.hlb"";"
  174. $ write pd " file ""[gnv.usr.share.doc.libssh2]libssh2-''versionname'.news"" source ""[000000]NEWS."";"
  175. $ write pd " file ""[gnv.usr.share.doc.libssh2]libssh2-''versionname'.release_notes"" source ""[vms]readme.vms"";"
  176. $ write pd " file ""[gnv.usr.lib]gnv$libssh2_''versionname'.exe"" source ""[vms]libssh2_''versionname'.exe"";"
  177. $ write pd "end product ;"
  178. $ close pd
  179. $exit
  180. $endsubroutine
  181. $!
  182. $!--------------------------------------------------------------------------------
  183. $!
  184. $WriteProductTextFile: subroutine
  185. $!
  186. $ open/write pt 'productfilename'.PCSI$TEXT
  187. $ write pt "=PRODUCT ''productname' Full"
  188. $ write pt "1 'PRODUCER"
  189. $ write pt "=prompt libssh2 is an open source product ported to VMS by Jose Baars"
  190. $ write pt "This software product is provided with no warranty."
  191. $ write pt "For license information see the LIBSSH2 help library."
  192. $ write pt "1 'PRODUCT"
  193. $ write pt "=prompt JCB LIBSSH2 for OpenVMS"
  194. $ write pt ""
  195. $ write pt "libssh2 is an open source client side library that aims to implement"
  196. $ write pt "the SSH protocol. This is the OpenVMS port of that library."
  197. $ write pt "Further information at https://www.libssh2.org."
  198. $ write pt ""
  199. $ write pt "1 NEED_VMS83"
  200. $ write pt "=prompt OpenVMS 8.3 or later is not installed on your system."
  201. $ write pt "This product requires OpenVMS 8.3 or later to function."
  202. $ write pt ""
  203. $ write pt "1 NEED_SSL"
  204. $ write pt "=prompt HP SSL 1.3 or later is not installed on your system."
  205. $ write pt "This product requires HP SSL 1.3 or later to function."
  206. $ write pt ""
  207. $ write pt "1 RELEASE_NOTES"
  208. $ write pt "=prompt Release notes and the libssh2 help library are available in [gnv.usr.share.doc.libssh2] directory."
  209. $ write pt ""
  210. $ write pt "1 EXAMPLE"
  211. $ write pt "=prompt Do you want the libssh2 C programming examples ? "
  212. $ write pt "The libssh2 coding examples will be available in backup saveset "
  213. $ write pt "[gnv.usr.share.doc.libssh2.examples]libssh2_examples_''versionname'.bck"
  214. $ write pt ""
  215. $ write pt "1 SOURCE"
  216. $ write pt "=prompt Do you want the complete libssh2 source tree ? "
  217. $ write pt "The libssh2 source tree will be available in backup saveset "
  218. $ write pt "[gnv.common_src]libssh2_''versionname'''datename'_src.bck"
  219. $close pt
  220. $exit
  221. $ endsubroutine