; $Ver. 1.0 Tex-Setup by Ruediger Leibrandt 9. September 2002

requestchoice Tex-Setup "Remember: *n Change INTO the directories *n of the sources. *n Else this script will fail. *n *n © R.Leibrandt 9 Sep. 2002" YES >NIL:
;requesting Sources & Destination 
Assign SOURCE_TEXMF: `requestfile TITLE "Select source ''texmf'' directory" drawersonly`
Assign SOURCE_AMIWEB2C: `requestfile TITLE "Select source ''AmiWeb2c'' directory (FROM)" drawersonly`
Assign AmiWeb2c: `requestfile TITLE "Select target ''AmiWeb2c'' directory (TO)" drawersonly`

; Preparing Abort / OK - requester
assign SOURCE_TEXMF: EXISTS >RAM:REQOK
ECHo >>RAM:REQOK *n
assign SOURCE_AMIWEB2C: EXISTS >>RAM:REQOK
ECHo >>RAM:REQOK *n
assign AmiWeb2c: EXISTS >>RAM:REQOK
ECHo >>RAM:REQOK *n
ECHo >>RAM:REQOK © R.Leibrandt 9.Sep.2002

; Ask OK to either proceed or cancel 
SET ASK `requestchoice Tex-Setup "Are these Settings OK?*n *`type ram:reqok*` " YES NO`
IF VAL $ASK EQ 0
requestchoice Tex-Setup "Installation cancelled*nRestart Installation and*nchoose new pathes." OK >NIL: 
QUIT
ENDIF

; Copy sources to destination. This may take a while
Makedir AmiWeb2c:texmf 

CD SOURCE_TEXMF:
echo "fonts"
copy fonts/#? TO AmiWeb2c:texmf/fonts all noreq NOPRO; >RAM:SOURCE_TEXMF.COPYLOG 
echo "doc"
copy doc/#? TO AmiWeb2c:texmf/doc all noreq NOPRO; >RAM:SOURCE_TEXMF.COPYLOG 
echo "dvips"
copy dvips/#?  TO AmiWeb2c:texmf/dvips all  noreq NOPRO; >>RAM:SOURCE_TEXMF.COPYLOG
echo "tex"
copy tex/#?  TO AmiWeb2c:texmf/tex all noreq NOPRO ;>>RAM:SOURCE_TEXMF.COPYLOG
echo "web2c"
copy web2c/#? TO AmiWeb2c:texmf/web2c all  noreq NOPRO; >>RAM:SOURCE_TEXMF.COPYLOG
echo "latex"
copy latex/#?  TO AmiWeb2c:texmf/latex all  noreq NOPRO ;>>RAM:SOURCE_TEXMF.COPYLOG
echo "source"
copy source/#? TO AmiWeb2c:texmf/source all noreq NOPRO ;>>RAM:SOURCE_TEXMF.COPYLOG

cd RAM:

copy SOURCE_AMIWEB2C:#? AmiWeb2c: all noreq  >RAM:SOURCE_AMIWEB2C.COPYLOG 

; Setup-file from the original AmiWeb2c package
echo "Setup-file from the original AmiWeb2c package"

;
; This file is supposed to be `execute'd in your standard
; User-StartUp file in the S: directory.  It sets up the
; default configuration for the AmiWeb2c system with the
; PasTeX drivers.  Feel free to change things according to
; your personal needs.
;
; At several places the device name "Please_change_me:" is
; used.  Please to so by replacing it with the name of the
; device where you installed AmiWeb2c.  No specific name is
; required nor used by any program of AmiWeb2c.  However,
; the explicit "assign"ment for "TeX:" is necessary for
; "PasTeX" to work correctly.
;
; AmiWeb2c 2.1 (c) 1995,1997 Andreas Scherer
; PasTeX 1.4 (c) 1990-1995 Georg Heßmann
;
;BEGIN TeX
;
path AmiWeb2c:bin/m68000-amigaos2.1 add
path AmiWeb2c:bin/m68000-amigaos2.1/local add
path AmiWeb2c:bin/m68000-amigaos2.1/pastex add
;
alias latex="tex --progname=latex"
alias elatex="etex --progname=elatex"
alias pdflatex="pdftex --progname=pdflatex"
alias lambda="omega --progname=lambda"
;
; Settings for CallMF 2:
;
rxset VIRTEX=tex
rxset VIRMF=mf
rxset GFTOPK=gftopk
;
; Use either of these settings, depending on your preferences to
;
; either create a batch file for missing fonts:
;setenv CALLMF    MakeBatch.rexx
; or generate missing fonts on the fly:
setenv CALLMF    MakeTeXFont.rexx
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Settings for non-AmiWeb2c packages and programs, e.g., settings for
; PasTeX, HWGPost, ...  This section will most certainly have to be
; adapted to local conditions.  Since I can't foresee what users might
; want to put here, I comment everything, but keep the entries used
; in my installation.
;
; PasTeX requires a root directory `TeX:'.  Also the directory structure
; is different, so here `TeX:' only points to the top-level directory of
; `config' and `ps' (and `rexx').
;
assign TeX:    AmiWeb2c:texmf/pastex
;
; GhostScript requires a root directory `GhostScript:'.  Comment this
; line if you do not use GhostScript.
;
;assign GhostScript:    Please_change_me:AmiWeb2c-2.1/ghostscript
;
; Define the general TeX environment:
;
; TeX call for editor in case of error:
setenv TEXEDIT    "rx TeX:rexx/TeXedit.rexx %s %d"
setenv TEXREXXEDIT    "TeX:rexx/TeXedit.rexx %s %d"
; start EDIT=CED in case of error (else only E):
;setenv TEXREXX    EDIT
setenv TEXREXX    E
;
; Sometimes I use really BIG fonts (like Old German or GnuPlot output):
;
setenv DVIPRINT    "FONTMEM 300000"
setenv SHOWDVI    "FONTMEM 300000"
;
; HWGPost settings: Comment these lines if you do not use MetaPost
; or install PostScript fonts.
;
assign POST:    TeX:ps
assign POST:    AmiWeb2c:texmf/dvips add
assign POST:    AmiWeb2c:texmf/dvips/base add
assign POST:    AmiWeb2c:texmf/dvips/misc add
;
assign PSFONTS:    AmiWeb2c:texmf/fonts/type1/bakoma/cm add
assign PSFONTS:    AmiWeb2c:texmf/fonts/type1/bakoma/ams add
assign PSFONTS:    AmiWeb2c:texmf/fonts/psfonts add
;
;END TeX

; End of the original AmiWeb2c setup-file
echo "End of the original AmiWeb2c setup-file"

; Setting up the assigns for the AmiWeb2c-Setup
echo "Setting up the assigns for the AmiWeb2c-Setup"

assign LATEXINPUTS: AmiWeb2c:texmf/tex/latex/base
assign LATEXFORMAT: AmiWeb2c:texmf/web2c
assign LATEXDIST: AmiWeb2c:texmf/source/latex/base

; Solving problems by separately copying files to their designated targetdirectory
echo "Solving problems by separately copying files to their designated targetdirectory"

cd LATEXDIST:
;copy FROM latexbug.tex testpage.tex lablst.tex idx.tex ltxcheck.tex  nfssfont.tex small2e.tex sample2e.tex docstrip.tex  #?.cls #?.clo #?.sty #?.fd #?.def #?.ltx  TO LATEXINPUTS:
copy   #?.cls #?.clo #?.sty #?.fd #?.def #?.ltx  TO LATEXINPUTS:

copy AMIWEB2c:texmf/tex/latex/base/#?.def LATEXFORMAT:
copy AMIWEB2c:texmf/tex/latex/base/#?.cls LATEXFORMAT:
copy AMIWEB2c:texmf/tex/latex/base/#?.clo LATEXFORMAT:
copy AMIWEB2c:texmf/tex/latex/base/#?.fd LATEXFORMAT:
copy AMIWEB2c:texmf/tex/latex/base/#?.ltx LATEXFORMAT:
copy AMIWEB2c:texmf/tex/latex/base/#?.tex LATEXFORMAT:
copy AMIWEB2c:texmf/tex/latex/base/#?.sty LATEXFORMAT:

; Correcting problems by generating a german hyphenation file for the older Amiga-binaries 

copy AMIWEB2c:texmf/tex/generic/hyphen/dehyphn.tex ram:
rename ram:dehyphn.tex ram:ghyph31.tex 
copy ram:ghyph31.tex LATEXFORMAT:

copy #?.ist AmiWeb2c:texmf/makeindex/

; Setting up TeX-Environment

cd LATEXFORMAT:
echo "tex --ini --progname=latex latex.ltx"
tex --ini --progname=latex latex.ltx
echo "etex --ini --efmt=elatex *latex.ltx"
etex --ini --efmt=elatex *latex.ltx
;echo "etex --ini --progname=elatex latex.ltx"
;etex --ini --progname=elatex latex.ltx 
;echo "pdftex --ini --progname=pdflatex latex.ltx"
;pdftex --ini --progname=pdflatex latex.ltx

; Checking Installation

cd LATEXFORMAT:
latex ltxcheck