home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / os2tex_2.zip / disk4.zip / disk_4 / german.cmd < prev    next >
OS/2 REXX Batch file  |  1997-12-29  |  4KB  |  191 lines

  1. /**/
  2.  
  3. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. call SysLoadFuncs
  5.  
  6.  
  7. parse arg language texmf source options
  8.  
  9.  
  10.  
  11. if language = '049' then do
  12.  
  13.   msg.1 = 'msg:German: Lösche alte Verzeichnisse'
  14.   msg.2 = 'msg:German: Entpacke Dateien'
  15.   msg.3 = 'msg:German: german.ins'
  16.   msg.4 = 'msg:German: Erstelle Formatdatei Englisch/Deutsch'
  17.   msg.5 = 'msg:German: Erstelle Dokumentation Lauf'
  18.   msg.6 = 'von'
  19.  
  20.   errdir = 'err:Verzeichniswechsel nicht möglich'
  21.  
  22. end
  23. else do
  24.  
  25.   msg.1 = 'msg:German: Deleting directories'
  26.   msg.2 = 'msg:German: Installing files'
  27.   msg.3 = 'msg:German: german.ins'
  28.   msg.4 = 'msg:German: Creating format file English/German'
  29.   msg.5 = 'msg:German: Creating documentation run'
  30.   msg.6 = 'of'
  31.  
  32.   errdir = 'err:Unable to change directory'
  33.  
  34. end
  35.  
  36.  
  37.  
  38. bin         = texmf||'\os2tex\bin'
  39. tfm         = texmf||'\fonts\tfm'
  40. tex         = texmf||'\tex'
  41. doc         = texmf||'\doc'
  42. fmt         = bin
  43.  
  44. target   = texmf||'\tex\generic\german'
  45. install  = texmf||'\os2tex\install'
  46.  
  47. exec     = bin||'\tex.exe'
  48.  
  49.  
  50.  
  51.  
  52. if Pos("InstallFiles", options) > 0 then do
  53.  
  54.    say msg.1
  55.  
  56.  
  57.  
  58.    install||'\kdir '||target                     /* Altes VZ loeschen, falls vorhanden */
  59.  
  60.  
  61.    'md '||tex                              /* TDS Verzeichnisstruktur erzeugen   */
  62.    'md '||tex||'\generic'
  63.    'md '||tex||'\generic\german'
  64.  
  65.    install||'\kdir '||doc||'\generic\german'
  66.  
  67.    'md '||doc
  68.    'md '||doc||'\generic'
  69.    'md '||doc||'\generic\german'
  70.  
  71.  
  72.  
  73.    say msg.2
  74.  
  75.  
  76.    if directory(tex||'\generic') = '' then do
  77.       say errdir' - 'tex||'\generic'
  78.       exit 1
  79.    end
  80.  
  81.    install||'\unzip '||source||'\german.zip'
  82.  
  83.  
  84.    say msg.3
  85.  
  86.    exec||' -pf '||bin||' -po '||target||' -pi '||target||';'||tex||'\latex\base '||'german.ins'
  87.  
  88.  
  89. /* Formatdatei erstellen */
  90.  
  91.  
  92.  
  93.    say msg.4
  94.  
  95.  
  96.    'copy '||target||'\hyphxmpl.cfg '||target||'\hyphen.cfg'
  97.  
  98.    exec||' -i -r -po '||texmf||'\os2tex\bin -pi '||target';'||tex||'\latex\base;'||texmf||'\tex\generic\hyphen;'||bin||' -pt '||texmf||'\fonts\tfm latex.ltx \dump'
  99.  
  100.    'del '||target||'\hyphen.cfg'
  101.  
  102.  
  103.  
  104.  
  105.  
  106. /* Erstellen der Dokumentation im VZ "doc\latex\base" */
  107.  
  108.  
  109.  
  110.    'copy '||target||'\germdoc.tex '||texmf||'\doc\generic\german'
  111.    'del '||target||'\germdoc.tex'
  112.  
  113. end
  114.  
  115.  
  116.  
  117. if SysOS2Ver() = '2.30' then
  118.   top = '48'
  119. else
  120.   top = '45'
  121.  
  122.  
  123.  
  124. if Pos("CreateObjects", options) > 0 then do
  125.  
  126.  
  127.    classname = 'WPFolder'
  128.  
  129.    if language = '049' then
  130.       objtitle  = 'Zusatzpakete/Styles'
  131.    else
  132.       objtitle  = 'Packages/Styles'
  133.  
  134.    location  = '<OS2TEX_DOC_FOLDER>'
  135.    setup     = 'OBJECTID=<OS2TEX_MISC_FOLDER>;ICONVIEW=MINI,NONFLOWED;ALWAYSSORT=YES;ICONVIEWPOS=50,50,25,'||top
  136.    duplicate = 'update'
  137.  
  138.  
  139.    rc = SysCreateObject(classname,objtitle,location,setup,duplicate)
  140.  
  141.    if rc = 0 then do
  142.       exit 1
  143.    end
  144.  
  145. end
  146.  
  147.  
  148. if Pos("InstallFiles", options) > 0 then do
  149.  
  150.  
  151.    do i=1 to 2
  152.       say msg.5' 'i' 'msg.6' 2'
  153.       exec||' -r -ff latex.fmt -pf '||texmf||'\os2tex\bin -po '||texmf||'\doc\generic\german -pi '||texmf||'\doc\generic\german;'||target||';'||texmf||'\tex\latex -pt '||texmf||'\fonts\tfm germdoc.tex'
  154.    end
  155.  
  156. end
  157.  
  158.  
  159.  
  160. if Pos("CreateObjects", options) > 0 then do
  161.  
  162.    classname = 'WPProgram'
  163.    objtitle  = 'german [B. Raichle]'
  164.    location  = '<OS2TEX_MISC_FOLDER>'
  165.    setup     = 'EXENAME='texmf'\os2tex\bin\dvi.exe;PROGTYPE=PM;STARTUPDIR='texmf'\os2tex\bin;OBJECTID=<OS2TEX_germdoc.dvi>;PARAMETERS='texmf'\doc\generic\german\germdoc.dvi'
  166.    duplicate = 'replace'
  167.  
  168.  
  169.  
  170.    rc = SysCreateObject(classname,objtitle,location,setup,duplicate)
  171.  
  172.    if rc = 0 then do
  173.       exit 1
  174.    end
  175.  
  176. end
  177.  
  178.  
  179. if Pos("InstallFiles", options) > 0 then do
  180.  
  181.  
  182.    "del "target"\\*.dtx"
  183.    "del "target"\\*.ins"
  184.  
  185. end
  186.  
  187.  
  188.  
  189.  
  190.  
  191.