/* */
total = 5
disk  = 1

CALL Setup
total = total + Makedir('l'                      disk)
total = total + Makedir('bin'                    disk)
total = total + Makedir('config'                 disk)
total = total + Makedir('rexx'                   disk)
total = total + Makedir('s'                      disk)
total = total + Makedir('libs'                   disk)
say ''
total = total + Copy('Install-DICE'                           '.'   disk)
total = total + Copy('Install-DICE.info'                      '.'   disk)
total = total + Copy('Install-Floppy'                         '.'   disk)
total = total + Copy('Install-Floppy.info'                    '.'   disk)
total = total + Copy('Install-Freeware'                       '.'   disk)
total = total + Copy('Install-Freeware.info'                  '.'   disk)
total = total + Copy('Installer'                              '.'   disk)
say ''
total = total + Copy('dcc.master:bin/lhex'                    'bin' disk)
total = total + Copy('dcc.master:bin/more'                    'bin' disk)
total = total + Copy('dcc.master:l/fsovl-handler'             'l'   disk)
total = total + Copy('dcc.master:About_Dice'                  '.'   disk)
total = total + Copy('dcc.master:About_Dice.info'             '.'   disk)
total = total + Copy('dcc.master:Copyright_Information'       '.'   disk)
total = total + Copy('dcc.master:Copyright_Information.info'  '.'   disk)
total = total + Copy('dcc.master:Release_Notes'               '.'   disk)
total = total + Copy('dcc.master:Release_Notes.info'          '.'   disk)
total = total + Copy('dcc.master:Known_Buglist'               '.'   disk)
total = total + Copy('dcc.master:Known_Buglist.info'          '.'   disk)
say ''

total = total + Handle('ar:include_13.lha'       disk)
total = total + Handle('ar:include_20.lha'       disk)
total = total + Handle('ar:extended_tools.lha'   disk)
CALL NextDisk

total = total + Handle('ar:include_common.lha'   disk)
total = total + Handle('ar:dice_linklibs.lha'    disk)
total = total + Handle('ar:include_30.lha'       disk)
CALL NextDisk

total = total + Handle('ar:online_help2.lha'     disk)
total = total + Handle('ar:library_source.lha'   disk)
total = total + Handle('ar:source_control.lha'   disk)
total = total + Handle('ar:rom_tools.lha'        disk)
total = total + Handle('ar:amiga12_linklibs.lha' disk)
CALL NextDisk

total = total + Handle('ar:miscellaneous.lha'    disk)
total = total + Handle('ar:debugger.lha'         disk)
total = total + Handle('ar:mmu_tools.lha'        disk)
total = total + Handle('ar:example_source.lha'   disk)
total = total + Handle('ar:amiga30_linklibs.lha' disk)
CALL NextDisk

total = total + Handle('ar:online_help1.lha'     disk)
total = total + Handle('ar:basic_tools.lha'      disk)
total = total + Handle('ar:freeware.lha'         disk)
total = total + Handle('ar:dice_startup.lha'     disk)
total = total + Handle('ar:ttx_config.lha'       disk)
total = total + Handle('ar:dme_config.lha'       disk)
total = total + Handle('ar:ced_config.lha'       disk)
total = total + Handle('ar:ame_config.lha'       disk)
CALL NextDisk
CALL Cleanup

EXIT

Makedir: Procedure
   PARSE ARG dir disk
   disk = strip(disk)
   SAY 'makedir                         rd'disk':'dir
   RETURN 1

Copy: Procedure
   PARSE ARG name dir disk
   IF dir = '.' THEN dir = ''
   disk = strip(disk)
   st     = STATEF(name)
   size   = WORD(st, 2)
   blocks = WORD(st, 3)
   res    = CalcBlocks(size)
   SAY 'copy   ' left(name,38) 'rd'disk':'left(dir,4)'com ;'LEFT(blocks,4) '==' LEFT(res,4)
   RETURN res

Handle: PROCEDURE
   PARSE ARG name disk
   st     = STATEF(name)
   size   = WORD(st, 2)
   blocks = WORD(st, 3)
   res    = CalcBlocks(size)
   CALL Report(name disk blocks res)
   RETURN res

CalcBlocks: PROCEDURE
   ARG SIZE
   blocks = trunc((size + 487)/488)
   res =  blocks+trunc((blocks+71)/72)
   RETURN res

Report: PROCEDURE
   PARSE ARG NAME DISK BLK RES
   SAY 'copy   ' LEFT(name,30) 'rd'disk':    ;'LEFT(blk,4) '==' LEFT(res,4)
   RETURN

NextDisk: PROCEDURE EXPOSE total disk
   room = TRUNC((total + 5)*100/1758)
   SAY ';;;TOTAL SIZE=.........................................'total '--' room'%'
   SAY 'INFO RD'disk':'
   SAY ''
   IF total > 1757 THEN
      DO
         SAY '"***Disk' disk 'will not fit'
      END
   disk = disk + 1
   total = 5
   IF disk <= 5 THEN
      DO
         SAY ';'
         SAY ';       Disk' disk
         SAY ';'
      END
   RETURN

Cleanup: PROCEDURE
   SAY ';'
   SAY ';       Cleanup.  Fix protections, etc.'
   SAY ';'
   SAY 'protect rd1:#? r all quiet'
   SAY 'setdate rd1:#? 01-jan-94 12:00 all'
   SAY ''
   SAY 'protect rd2:#? r all quiet'
   SAY 'setdate rd2:#? 01-jan-94 12:00 all'
   SAY ''
   SAY 'protect rd3:#? r all quiet'
   SAY 'setdate rd3:#? 01-jan-94 12:00 all'
   SAY ''
   SAY 'protect rd4:#? r all quiet'
   SAY 'setdate rd4:#? 01-jan-94 12:00 all'
   SAY ''
   SAY 'protect rd5:#? r all quiet'
   SAY 'setdate rd5:#? 01-jan-94 12:00 all'
   SAY ''
   SAY 'protect rd1:bin/#? re all quiet'
   SAY 'protect rd1:l/#?   re all quiet'
   SAY 'protect rd1:Install-DICE r'
   SAY 'protect rd1:Installer re'
   SAY ''
   SAY 'set echo off'
   SAY ''
   RETURN

Setup: PROCEDURE
   dt = '('translate(date(e),'.','/')')' time()

   SAY ';;;'
   SAY ';;; $ver: Make-DISKS 1.6' dt
   SAY ';;;'
   SAY ';       Distribute prepared archives among virtual disks'
   SAY ';'
   SAY ';       Intermediate:   ar:m'
   SAY ';       Dest:           RD0:, RD1:, RD2:, RD3:, RD4:'
   SAY ';'
   SAY ''
   SAY ''
   SAY ';'
   SAY ';       Prepare RAM floppy images, using the floppy emulator.'
   SAY ';'
   SAY 'set echo on'
   SAY 'failat  21'
   SAY 'mount   rd1: >nil:'
   SAY 'mount   rd2: >nil:'
   SAY 'mount   rd3: >nil:'
   SAY 'mount   rd4: >nil:'
   SAY 'mount   rd5: >nil:'
   SAY ''
   SAY 'format drive rd1: name "Disk1_V3.0" NOICONS <nil:'
   SAY 'copy    Disk1.info              rd1:Disk.info    com'
   SAY 'format drive rd2: name "Disk2_V3.0" NOICONS <nil:'
   SAY 'copy    Disk2.info              rd2:Disk.info    com'
   SAY 'format drive rd3: name "Disk3_V3.0" NOICONS <nil:'
   SAY 'copy    Disk3.info              rd3:Disk.info    com'
   SAY 'format drive rd4: name "Disk4_V3.0" NOICONS <nil:'
   SAY 'copy    Disk4.info              rd4:Disk.info    com'
   SAY 'format drive rd5: name "Disk5_V3.0" NOICONS <nil:'
   SAY 'copy    Disk5.info              rd5:Disk.info    com'
   SAY ''
   SAY 'failat 1'
   SAY 'relabel rd1: name "Disk1_V3.0"'
   SAY 'diskchange RD1:'
   SAY 'relabel rd2: name "Disk2_V3.0"'
   SAY 'diskchange RD2:'
   SAY 'relabel rd3: name "Disk3_V3.0"'
   SAY 'diskchange RD3:'
   SAY 'relabel rd4: name "Disk4_V3.0"'
   SAY 'diskchange RD4:'
   SAY 'relabel rd5: name "Disk5_V3.0"'
   SAY 'diskchange RD5:'
   SAY ''
   SAY 'assign ar: Oi:Archives'
   SAY ';'
   SAY ';       Disk 1'
   SAY ';'
   SAY ''
   RETURN
