/**/

call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs


parse arg language texmf source options


if language = '049' then do

  msg.1 = 'msg:PICTeX'
  msg.2 = 'msg:PICTeX: Entpacke Dateien'
  msg.3 = 'msg:PICTeX: komascr.ins'
  msg.4 = 'msg:PICTeX: amsclass.ins'
  msg.5 = 'msg:PICTeX: amsldoc.tex sortiere Index amsldoc.idx'
  msg.6 = 'msg:PICTeX: amsldoc.tex Lauf'
  msg.7 = 'von'

end
else do

  msg.1 = 'msg:PICTeX'
  msg.2 = 'msg:PICTeX: installing files'
  msg.3 = 'msg:PICTeX: komascr.ins'
  msg.4 = 'msg:PICTeX: amsclass.ins'
  msg.5 = 'msg:PICTeX: amsldoc.tex sorting index amsldoc.idx'
  msg.6 = 'msg:PICTeX: amsldoc.tex run'
  msg.7 = 'of'

end

install = texmf||'\os2tex\install'


target = texmf||'\tex\latex\pictex'


if ""=directory(texmf||'\tex\latex') then do
  say "err:Verzeichniswechsel nicht m”glich!"
  exit 1
end


if Pos("InstallFiles", options) > 0 then do

   say msg.1

   install||'\kdir '||texmf||'\tex\latex\pictex'
   install||'\kdir '||texmf||'\doc\latex\pictex'


   'md '||texmf||'\doc'
   'md '||texmf||'\doc\latex'
   'md '||texmf||'\doc\latex\pictex'



   say msg.2

   install||'\unzip '||source||'\pictex.zip'



   tex = texmf||'\os2tex\bin\tex.exe'



   "copy "target"\*.txt "texmf"\doc\latex\pictex"
   "del "target"\*.txt"

/*
say msg.3

tex||' -r -ff latex.fmt -pf '||texmf||'\os2tex\bin -pi '||texmf||'\tex; -po '||target||' komascr.ins'
*/



end




if SysOS2Ver() = '2.30' then
  top = 48
else
  top = 45



/*
do i=1 to 3

  if i=3 then do
    say msg.5
    texmf||'\os2tex\bin\makeindex '||texmf||'\doc\ams\amslatex\amsldoc.idx'
  end

  say msg.6' 'i' 'msg.7' 3'
  tex||' -r -ff latex.fmt -pf '||texmf||'\os2tex\bin -pi '||texmf||'\tex;'||texmf||'\doc\ams -po '||texmf||'\doc\ams\amslatex -pt '||texmf||'\fonts\tfm amsldoc.tex'

end
*/


