home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / nethack-3.1 / sys / vms / install.com < prev    next >
Encoding:
Text File  |  1993-01-12  |  6.4 KB  |  174 lines

  1. $ ! vms/install.com -- set up nethack 'playground'
  2. $ !
  3. $ ! Use vmsbuild.com to create nethack.exe, makedefs, and lev_comp *first*.
  4. $ !
  5. $ ! Edit this file to define gamedir & gameuic, or else invoke it with two
  6. $ ! command line parameters, as in:
  7. $ !    @[.sys.vms]install "disk$users:[games.nethack]" "games"
  8. $ ! or    @[.sys.vms]install "[-.play]" "[40,1]"
  9. $ !
  10. $    ! default location is old playground, default owner is installer
  11. $    gamedir = f$trnlnm("HACKDIR")    !location of playground
  12. $    gameuic = f$user()        !owner of playground
  13. $    ! --- nothing below this line should need to be changed ---
  14. $    if p1.nes."" then  gamedir := 'p1'
  15. $    if p2.nes."" then  gameuic := 'p2'
  16. $
  17. $    ! note: all filespecs contain some punctuation,
  18. $    !    to avoid inadvertent logical name interaction
  19. $    play_files = "PERM.,RECORD.,LOGFILE."
  20. $    help_files = "HELP.,HH.,CMDHELP.,WIZHELP.,OPTHELP.,HISTORY.,LICENSE."
  21. $    data_files = "DATA.,RUMORS.,ORACLES.,OPTIONS.,QUEST.DAT"
  22. $    guidebook  = "[.doc]Guidebook.txt"
  23. $    invoc_proc = "[.sys.vms]nethack.com"
  24. $    trmcp_file = "[.sys.share]termcap"
  25. $    spec_files = "AIR.LEV,ASMODEUS.LEV,ASTRAL.LEV,BAALZ.LEV,BIGROOM.LEV," -
  26.            + "CASTLE.LEV,EARTH.LEV,FAKEWIZ%.LEV,FIRE.LEV," -
  27.            + "JUIBLEX.LEV,KNOX.LEV,MEDUSA-%.LEV,MINEFILL.LEV," -
  28.            + "MINETOWN.LEV,MINE_END.LEV,ORACLE.LEV,ORCUS.LEV," -
  29.            + "SANCTUM.LEV,TOWER%.LEV,VALLEY.LEV,WATER.LEV,WIZARD%.LEV"
  30. $    spec_input = "bigroom.des castle.des endgame.des " -
  31.            + "gehennom.des knox.des medusa.des mines.des " -
  32.            + "oracle.des tower.des yendor.des"
  33. $    qstl_files = "%-GOAL.LEV,%-FILL%.LEV,%-LOCATE.LEV,%-START.LEV"
  34. $    qstl_input = "Arch.des Barb.des Caveman.des Elf.des " -
  35.            + "Healer.des Knight.des Priest.des Rogue.des " -
  36.            + "Samurai.des Tourist.des Wizard.des Valkyrie.des"
  37. $    dngn_files = "DUNGEON."
  38. $    dngn_input = "dungeon.pdf"
  39. $ makedefs := $sys$disk:[-.util]makedefs
  40. $ lev_comp := $sys$disk:[-.util]lev_comp
  41. $ dgn_comp := $sys$disk:[-.util]dgn_comp
  42. $ milestone = "write sys$output f$fao("" !5%T "",0),"
  43. $ if p3.nes."" then  milestone = "!"
  44. $!
  45. $! make sure we've got a playground location
  46. $ gamedir := 'gamedir'
  47. $ if gamedir.eqs."" then  gamedir = "[.play]"    !last ditch default
  48. $ gamedir = f$parse(gamedir,,,,"SYNTAX_ONLY") - ".;"
  49. $ if gamedir.eqs."" then  write sys$error "% must specify playground directory"
  50. $ if gamedir.eqs."" then  exit %x1000002C    !ss$_abort
  51. $
  52. $!
  53. $!    ['p3' is used in Makefile.top]
  54. $ if p3.nes."" then  goto make_'p3'
  55. $
  56. $    milestone "<installation...>"
  57. $!
  58. $make_data:
  59. $    ! start from a known location -- [.sys.vms]
  60. $    set default 'f$parse(f$environment("PROCEDURE"),,,"DIRECTORY")'
  61. $! generate miscellaneous data files
  62. $    set default [-.-.dat]    !move to data directory
  63. $    milestone "(data)"
  64. $ makedefs -d    !data.base -> data
  65. $    milestone "(rumors)"
  66. $ makedefs -r    !rumors.tru + rumors.fal -> rumors
  67. $    milestone "(oracles)"
  68. $ makedefs -h    !oracles.txt -> oracles
  69. $    milestone "(dungeon preprocess)"
  70. $ makedefs -e    !dungeon.def -> dungeon.pdf
  71. $    milestone "(quest text)"
  72. $ makedefs -q    !quest.txt -> quest.dat
  73. $    milestone "(special levels)"
  74. $ lev_comp 'spec_input' !special levels
  75. $    milestone "(quest levels)"
  76. $ lev_comp 'qstl_input' !quest levels
  77. $    milestone "(dungeon compile)"
  78. $ dgn_comp 'dngn_input' !dungeon database
  79. $    set default [-]        !move up
  80. $ if p3.nes."" then  exit
  81. $
  82. $!
  83. $! set up the playground and save directories
  84. $    milestone "(directories)"
  85. $make_directories:
  86. $    srctree = f$environment("DEFAULT")
  87. $    set default 'gamedir'
  88. $ if f$parse("[-]").eqs."" then  create/dir/log [-] !default owner & protection
  89. $ if f$parse("[]" ).eqs."" then - !needs to be world writable
  90.    create/directory/owner='gameuic'/prot=(s:rwe,o:rwe,g:rwe,w:rwe)/log []
  91. $ if f$search("SAVE.DIR;1").eqs."" then -
  92.    create/directory/owner='gameuic'/prot=(s:rwe,o:rwe,g:rwe,w:rwe)/log -
  93.     [.SAVE]/version_limit=2
  94. $    set default 'srctree'
  95. $ if p3.nes."" then  exit
  96. $!
  97. $! create empty writeable files -- logfile, scoreboard, multi-user access lock
  98. $    milestone "(writeable files)"
  99. $make_writeable_files:
  100. !-!$ create/owner='gameuic'/prot=(s:rwed,o:rwed,g:rwed,w:rwed) -
  101. !-!    'gamedir''play_files'
  102. $    i = 0
  103. $ploop: f = f$element(i,",",play_files)
  104. $    if f.eqs."," then  goto pdone
  105. $    i = i + 1
  106. $    f = gamedir + f
  107. $    if f$search(f).nes.""    !file already exists
  108. $    then    if f$file_attrib(f,"RFM").eqs."STMLF" then  goto ploop
  109. $        rename/new_vers 'f' *.old    !needs to be stream_lf
  110. $    endif
  111. $    create/fdl=sys$input:/owner='gameuic' 'f'/log
  112. file
  113.  organization sequential
  114.  protection (system:rwd,owner:rwd,group:rw,world:rw)
  115. record
  116.  format stream_lf
  117. $    goto ploop
  118. $pdone:
  119. $ if p3.nes."" then  exit
  120. $!
  121. $! copy over the remaining game files, then make them readonly
  122. $    milestone "(readonly files)"
  123. $make_readonly_files:
  124. $ copy/prot=(s:rwed,o:rwed,g:re,w:re) -
  125.     [.dat]'help_files','data_files','spec_files','qstl_files','dngn_files' -
  126.     'gamedir'*.*
  127. $ set file/owner='gameuic'/prot=(s:re,o:re) -
  128.     'gamedir''help_files','data_files','spec_files','qstl_files','dngn_files'
  129. $ if p3.nes."" then  exit
  130. $!
  131. $    milestone "(nethack.exe)"
  132. $make_executable:
  133. $ copy/prot=(s:rwed,o:rwed,g:re,w:re) [.src]nethack.exe 'gamedir'*.*
  134. $ set file/owner='gameuic'/prot=(s:re,o:re) 'gamedir'nethack.exe
  135. $ if p3.nes."" then  exit
  136. $!
  137. $! provide invocation procedure (if available)
  138. $make_procedure:
  139. $ if f$search(invoc_proc).eqs."" then  goto skip_dcl
  140. $ if f$search("''gamedir'nethack.com").nes."" then -
  141.     if f$cvtime(f$file_attr("''gamedir'nethack.com","RDT")) -
  142.       .ges. f$cvtime(f$file_attr(invoc_proc,"RDT")) then  goto skip_dcl
  143. $    milestone "(nethack.com)"
  144. $  copy/prot=(s:rwed,o:rwed,g:re,w:re) 'invoc_proc' 'gamedir'nethack.com
  145. $  set file/owner='gameuic'/prot=(s:re,o:re) 'gamedir'nethack.com
  146. $skip_dcl:
  147. $ if p3.nes."" then  exit
  148. $!
  149. $! provide plain-text Guidebook doc file (if available)
  150. $make_documentation:
  151. $ if f$search(guidebook).eqs."" then  goto skip_doc
  152. $    milestone "(Guidebook)"
  153. $  copy/prot=(s:rwed,o:rwed,g:re,w:re) 'guidebook' 'gamedir'Guidebook.doc
  154. $  set file/owner='gameuic'/prot=(s:re,o:re) 'gamedir'Guidebook.doc
  155. $skip_doc:
  156. $ if p3.nes."" then  exit
  157. $!
  158. $! provide last-resort termcap file (if available)
  159. $make_termcap:
  160. $ if f$search(trmcp_file).eqs."" then  goto skip_termcap
  161. $ if f$search("''gamedir'termcap").nes."" then  goto skip_termcap
  162. $    milestone "(termcap)"
  163. $  copy/prot=(s:rwed,o:rwed,g:re,w:re) 'trmcp_file' 'gamedir'termcap
  164. $  set file/owner='gameuic'/prot=(s:re,o:re) 'gamedir'termcap
  165. $skip_termcap:
  166. $ if p3.nes."" then  exit
  167. $!
  168. $! done
  169. $    milestone "<done>"
  170. $ define/nolog hackdir 'gamedir'
  171. $ write sys$output -
  172.     f$fao("!/ Nethack installation complete. !/ Playground is !AS !/",gamedir)
  173. $ exit
  174.