%%
%% This file will generate fast loadable files and documentation
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
%% 
%% This file is part of the NFSS2 (New Font Selection Scheme) package.
%% -------------------------------------------------------------------
%% 
%%  This package is distributed in the hope that it will be useful,
%%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% 
%% IMPORTANT NOTICE:
%% 
%% Copyright (C) 1993 Frank Mittelbach and Rainer Schoepf.
%% All rights reserved.
%% 
%% Permission is granted to distributed verbatim copies of this file
%% together with all other files of the NFSS2 package.
%% 
%% No other permissions to copy or distribute this file in any form
%% are granted and in particular no permission to modify its contents.
%%
%% --------------- start of docstrip commands ------------------
%%
\def\batchfile{fdprefix.ins}
{\immediate\openin15 docstrip.tex
\ifeof 15
\newlinechar `@
\message{@@**************************************************@}
\message{* I can't find the file `docstrip.tex'.@}
\message{* @}
\message{* It is not in the search path for \noexpand\openin.@}
\message{* @}
\message{* This means that you either don't have the@}
\message{* DOC package MZ0 installed, or that your@}
\message{* installation doesn't have the same search path@}
\message{* for \noexpand\openin and \noexpand\input.@}
\message{* @}
\message{* In the latter case you need to copy `docstrip.tex'@}
\message{* to the current directory. Otherwise you have to@}
\message{* get the DOC package (MZ0) first.@}
\message{* @}
\message{* I'm giving up now.@}
\message{***************************************************@@}
\expandafter\aftergroup\csname @@end\expandafter\endcsname
\expandafter\aftergroup\csname end\expandafter\endcsname \fi
\ifx\firsttime\undefined\global\let\firsttime\relax\else
\ifx\currbatchFile\undefined
 \newlinechar `@
 \message{*** WHOA!!! I'm dying ...@}
 \message{*** Upgrade to a 
          new docstrip release v2.1a or higher !!!!!!@@}
 \message{*** This installation routine works only with the new@}
 \message{*** docstrip.tex program which is part of the doc@}
 \message{*** package (MZ0).@@}
 \message{Please install this package first.@@}
 \message{I'm giving up now.@}
 \endinput \csname @@end\endcsname \csname end\endcsname \fi \fi}
\input docstrip.tex
\preamble

Copyright (C) 1989--1993 by Frank Mittelbach, Rainer Schoepf.
All rights reserved.

This file is part of the NFSS2 (New Font Selection Scheme) package.

 This package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


IMPORTANT NOTICE:

For error reports in case of UNCHANGED versions see readme files.

Please do not request updates from us directly.  Distribution is
done through Mail-Servers and TeX organizations.

You are not allowed to change this file.  You may however copy
this file to a file with a different name and then change the copy
if you obey the restrictions on file changes described in
readme.mz.

You are allowed to distribute this file under the condition that
it is distributed together with all files mentioned in readme.mz8.
If you receive only some of these files from someone, complain!

You are NOT ALLOWED to distribute this file alone.  You are NOT
ALLOWED to take money for the distribution or use of either this
file or a changed version, except for a nominal charge for copying
etc.
\endpreamble
\def\batchfile{fdprefix.dst}      % ignored in distribution
\input docstrip.tex             % ignored in distribution

\def\y{y}
\def\n{n}

% For some reason I don't understand, |docstrip.tex| plays havoc with 
% |\if| statements, so I'll define an |\IF| macro to expand 
% out to an |\if|.

\long\def\IF#1#2#3#4{\csname if#1\endcsname#2#3\else#4\fi}

\def\fourspaces{\space\space\space\space}
\def\eightspaces{\fourspaces\fourspaces}

\def\finished{\Msg{Please try again}\batchmode\input.\relax}

\Msg{************************************************************
   ^^J* 
   ^^J* This installation will try to find out if we can use the
   ^^J* \string\openin\space command on your system to find out
        whether a file 
   ^^J*  can be \string\input.  Since \string\openin\space behaves 
        differently on different
   ^^J* systems, we may have to ask you some questions about your
   ^^J*  system.
   ^^J* 
   ^^J* For more details, complete this installation, then run LaTeX
   ^^J* on the file fdprefix.drv and read the resulting document.
   ^^J* 
   ^^J*************************************************************}

\Ask\continue{^^JType <RETURN> to continue^^J}


% the next question is phrased in a way that "yes" is the answer to go
% on. This is done to allow typing "yes" for every question in the
% installation. (eg   yes | latex main.ins  under unix)

\Ask\answer{************************************************************
   ^^J* 
   ^^J* You should *not* start processing this installation in the
   ^^J* TeX inputs directory, ie where article.sty etc. lives.
   ^^J* 
   ^^J* Are you in a suitable directory?
   ^^J* 
   ^^J*   Please answer y or n.
   ^^J* 
   ^^J*************************************************************}

\IF{x}{\answer\y}{ % IF answer=y
}{

\Msg{************************************************************
   ^^J* 
   ^^J* Please process this installation in another directory.
   ^^J* 
   ^^J*************************************************************}

\finished
}

% First assume that article.sty is somewhere on on the system.

\def\filename{article.sty}
\immediate\openin15=\filename
\IF{eof}{15}{ % IF file exists

\immediate\closein15

\Msg{*************************************************************
  ^^J* 
  ^^J* Oh dear.  Your TeX seems to have problems with 
        \string\openin\space and
  ^^J* and \string\input.
  ^^J* 
  ^^J* NFSS2 is programmed to find its internal .fd files 
  ^^J* (font definition files) by using the \noexpand\openin function. 
  ^^J* Since this function has a special search path on your system 
  ^^J* you have to put all such .fd files into one directory.
  ^^J*
  ^^J* Please specify now the full path prefix of this directory in a
  ^^J* way understandable to TeX. For example, on most systems TeX
  ^^J* understands something like `/tex/texinput/fonts/fd/'. 
  ^^J* 
  ^^J*************************************************************}

\Ask\continue{^^JType <RETURN> to continue^^J}

\Msg{*************************************************************
  ^^J* 
  ^^J* - This syntax is usually also used under DOS, 
  ^^J*   but you may have to add a disk drive, eg `c:/...'
  ^^J* 
  ^^J* - Under VMS you may have to use a logical.
  ^^J* 
  ^^J* - On the Mac it may look like\fourspaces
         Hard-Disk:TeX:TeX-inputs:
  ^^J* 
  ^^J* - On some systems (like MVS) it may be even more complicated.
  ^^J*   If there is a way to specify an absolute directory but 
  ^^J*   not by supplying a path prefix, just carry on and afterwards
  ^^J*   look at the documentation in "fdprefix.drv". It will tell you
  ^^J*   how to manage this on your system.
  ^^J* 
  ^^J**************************************************************}

\Ask\continue{^^JType <RETURN> to continue^^J}

\Ask\answer{******************************************************
  ^^J*
  ^^J* It is not necessary that this directory already exists.
  ^^J* You can create it after this installation routine has 
  ^^J* finished.
  ^^J*
  ^^J* Now type in the directory name for the .fd files.
  ^^J* Please don't forget the final separator that goes
  ^^J* between the directory name and a file name.
  ^^J*
  ^^J***********************************************************}

\global\let\pathanswer\answer

\Ask\answer{******************************************************
  ^^J*
  ^^J* Is the directory for the .fd files correct?
  ^^J* 
  ^^J*    `\pathanswer'
  ^^J*
  ^^J* Type y or n 
  ^^J*
  ^^J***********************************************************}
  

\IF{x}{\answer\y}{

% We now look to see if we can open the file |\pathname\filename|.  We 
% first select |\nullfont|, so if \TeX{} fails to parse
% |\pathname\filename| as a file name we won't generate a dvi file.  We 
% define |\everypar| to set the flag |\parsefile| as |\n|.  For example,
% if the user sets |\pathanswer| to |Macintosh HD:TeX:TeX-inputs:| then 
% \TeX{} will try to set the paragraph |HD:TeX:TeX-inputs:article.sty|
% so |\everypar| will be called and set |\parsefile| to |\n|.  Gosh,
% that was easy :-)

{

   \nullfont
   \everypar{\global\let\parsefile=\n}
   \global\let\parsefile=\y
   \immediate\openin15=\pathanswer\filename\relax
}

\IF{x}{\parsefile\y}{ % IF path+file parsed

}{ % ELSE path+file parsed

\Msg{************************************************************
   ^^J* 
   ^^J* I checked your directory prefix but it seems that it will not
   ^^J* work on your installation.  The most common reason for this is
   ^^J* that it contains a space, and TeX does not allow spaces in
   ^^J* file names.  For example, paths such as
   ^^J*
   ^^J*    Macintosh HD:TeX:TeX-inputs:
   ^^J*
   ^^J* are not allowed.  Unfortunately, the only cure for this is
   ^^J* to rename your files so there are no spaces in your TeX inputs
   ^^J* directory.  In the above example, this means renaming 
   ^^J* Macintosh HD to something like Macintosh-HD.  Sorry about this.
   ^^J*
   ^^J*************************************************************}

\Ask\continue{^^JType <RETURN> to continue^^J}

\Ask\answer{************************************************************
   ^^J*
   ^^J* You can either continue with the installation, and edit
   ^^J* fdprefix.tex yourself, or you can stop the installation and 
   ^^J* try again.
   ^^J* 
   ^^J* Do you want to carry on with the installation? 
   ^^J* Please answer y or n.
   ^^J*
   ^^J*************************************************************}

\IF{x}{\answer\y}{ % IF answer=y

\Msg{************************************************************
   ^^J* 
   ^^J* OK, but remember to fix fdprefix.tex!
   ^^J*
   ^^J*************************************************************}

}{ % ELSE answer=y

\IF{x}{\answer\n}{ % IF answer=n

\Msg{************************************************************
   ^^J* 
   ^^J* Please try installing again.
   ^^J*
   ^^J*************************************************************}

\finished

}{ % ELSE answer=n

\Msg{************************************************************
   ^^J* 
   ^^J* I don't understand that answer.  Please try installing again.
   ^^J*
   ^^J*************************************************************}

\finished

} % FI answer=n

} % FI answer=y

} % FI path+file exists

}{ 

\finished

}

\Ask\continue{^^JType <RETURN> to continue^^J}


\Msg{**************************************************************
  ^^J* 
  ^^J* Please note that during format generation some .fd files are
  ^^J* loaded. Since you specified a path IniTeX will only look into
  ^^J* that directory for finding them. You therefore have to move
  ^^J* such .fd files to this directory prior to making the format.
  ^^J* 
  ^^J**************************************************************}

\Ask\continue{^^JType <RETURN> to continue^^J}

}{
   \gdef\pathanswer{}
}


\preamble

This file is part of the NFSS2 package.
---------------------------------------

Copyright (C) 1993 Frank Mittelbach and Rainer Schoepf. 
All rights reserved.

If your system doesn't use the same search path for \string\openin\space
and \string\input, or if you intend to store the .fd files in a
directory which is not searched by TeX you can change the
\string\fd@prefix\space macro below to point to the directory which
contains the .fd files.

This macro should contain the absolute path name to this directory
(including the system-dependent separator between directory name and
file name) in a syntax understandable by TeX.

Examples are:

  c:/emtex/texinput/\eightspaces\fourspaces on emtex under DOS
  /usr/local/lib/tex/macros/\fourspaces on UNIX
  Hard-Disk:TeX:TeX-inputs: \fourspaces on a Macintosh 

^^J^^J\def\string\fd@prefix\space{\pathanswer}^^J

\endpreamble

\generateFile{fdprefix.tex}{t}{
   \from{fdprefix.dtx}{}}


\preamble

Copyright (C) 1993 Frank Mittelbach.
All rights reserved.

This file is part of the NFSS2 package.
---------------------------------------

Permission is granted to modify this file for producing a different
layout. However, no permission is granted to distribute a modified
version of this file under its original name.

\endpreamble

\generateFile{fdprefix.drv}{t}{
   \from{fdprefix.dtx}{driver}}


\ifToplevel{
\Msg{}
\Msg{***********************************************************}
\Msg{*}
\Msg{* Happy typesetting}
\Msg{*}
\Msg{***********************************************************}
\Msg{}
}


\endinput
