%
% TeX (Live) on Debian
% Norbert Preining
% EuroBachoTeX 2007
%
\begin{filecontents}{texondebian.bib}
@Misc{thread,
  title =        {Discussion thread on the {\tt debian-devel} mailing list},
  howpublished = {\url{http://lists.debian.org/debian-devel/2005/11/msg01649.htm
l}}
}
@Misc{policy,
  title =        {Debian {\TeX}\ Policy},
  howpublished = {\url{http://people.debian.org/~frank/Debian-TeX-Policy/}}
}
@Misc{tod,
  title =        {{\TeX}\  on {D}ebian},
  howpublished = {\url{http://people.debian.org/~frank/XXXXXXCHECKKK!!!!/}}
}
@Misc{DFSG,
  title =        {{D}ebian {F}ree {S}oftware {G}uidelines contained in the {D}ebian {S}ocial {C}ontract},
  howpublished = {\\\url{http://www.debian.org/social_contract}}
}
@Misc{debian-policy,
  title =        {POLICY TO BE CHANGED},
  howpublished = {\\\url{http://www.debian.org/social_contract}}
}
@Misc{ml,
  title =        {Debian {\TeX}\ Task Force mailing list},
  howpublished = {\url{http://lists.debian.org/mailman/listinfo/debian-tex-maint}}
}
\end{filecontents}
\documentclass%[final]
              {ltugboat}
\def\mypage{TBpreining}
\InputIfFileExists{tugboat.dates}{}{}
\hfuzz=2pt
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[hyphens]{url}
\newcommand{\tl}{\TeX~Live}
\title{\TeX\ (Live) on Debian}
\author{Norbert Preining}
\address{Università di Siena\\
	Pian dei Mantellini, 44\\
	53100 Siena, Italy}
\netaddress{preining (at) logic.at}

\let\prog\path

\begin{document}
\maketitle

\begin{abstract}
  \tl\ is a widely used \TeX\ distribution incorporating 
  most of the free (in the Debian sense) packages from
  \acro{CTAN}, and binaries for many different architecture--operating
  system combinations. 

  Debian \acro{GNU}/Linux is a popular operating system distribution
  based on the Linux kernel, containing only free~\cite{DFSG} programs. 
  Like most distributions of the Linux flavor, Debian has a strong package
  managing facility. Debian Etch has been release in April 2007 with
  te\TeX\ (version 3.0) and \tl\ (version 2005) packages. Future releases 
  of Debian will only contain \tl\ packages due to the end of further
  development of te\TeX.
 
  This article describes the usage of \TeX~on Debian, both from a 
  system adiminstrator's and user's point of view.
\end{abstract}

\section*{Thanks to Thomas Esser}

I want to use this place to thank Thomas Esser for his incredible work
on all \TeX\ related things. His work has been incorporated into \tl\ and
he himself continues to help and develop within the \tl\ distribution.

We all are very grateful to Thomas and wish him all the best for his
further plans!

\section{Rational of Debian specific changes}

As a big distribution Debian obliges packages maintainers to prepare their
packages in such a way that (besides other things)
\begin{itemize}
\item configuration files must be placed into the \path{/etc/texmf} hierarchy,
\item and changes to configuration files are preserved during upgrade, but
	also preserved during a remove and reinstallation process.
\end{itemize}
(see \cite{debian-policy} for details)
Most of the changes introduces in the Debian packages of \tl\ are due to the
above two requirements. Other changes are due to the fact that many things
(e.g., fonts, \LaTeX-packages, programs) are already packaged for Debian
and should be reused as far as possible.

The Debian \TeX\ Task force \cite{ml} has prepared a detailed document
\emph{Debian \TeX\ policy} \cite{policy} and the more user oriented document
\emph{\TeX on Debian} \cite{tod}.

\section{Changing the configuration and file placement}

\subsection{Available \texttt{TEXMF} trees for users and system administrators}

The following \path{TEXMF} trees are available.  They
are displayed below in the order they are searched, where
earlier ones override later ones.

\begin{description}

\item[\path{TEXMFCONFIG}]~\\
Default location: \path{$HOME/.texmf-config/}\\
Contains user-specific configuration

\item[\path{TEXMFVAR}]~\\
Default location: \path{$HOME/.texmf-var/}\\
Contains user-specific generated files

\item[\path{TEXMFHOME}]~\\
Default location: \path{$HOME/texmf/}\\
Contains user-specific static input files, e.g. new
\LaTeX{} packages.

\item[\path{TEXMFSYSCONFIG}]~\\
Default location: \path{/etc/texmf}\\
Contains system-wide configuration

\item[\path{TEXMFSYSVAR}]~\\
Default location: \path{/var/lib/texmf/}\\
Contains system-wide generated files

\item[\path{TEXMFLOCAL}]~\\
Default location: \path{/usr/local/share/texmf/}\\
Contains system-wide input files

\item[\path{TEXMFMAIN}]~\\
Default location: \path{/usr/share/texmf/}\\
Contains system-wide, \texttt{dpkg}-managed input files
(\TeX{} add-on packages)

\item[\path{TEXMFDIST}]~\\
Default location: \path{/usr/share/texmf-texlive}\\
Contains system-wide, \texttt{dpkg}-managed input files
(basic \TeX{} packages)

\end{description}

\subsection{Configuration files}

In Debian Etch some configuration files are \emph{not} shared between 
te\TeX\ and \tl\ packages. The latter can be found in 
\path{/etc/texmf/texlive}, while the former directly under \path{/etc/texmf}.

In the next release, with \tl~2007 in Debian and te\TeX\ gone, all 
configuration files are placed in \path{/etc/texmf}.

In any case note that the \path{/etc/texmf} tree is by default the
\path{TEXMFSYSCONFIG} tree, so any file placed in the proper location
will override the respective file in \path{TEXMFMAIN}. This allows full
control over the installation, but should be used with care only, as upgrades
of the \TeX\ system will \emph{not} care for merging changes in the shipped
files into the replacement file you put into \path{TEXMFSYSCONFIG}.

In addition to these files the packages ship some configuration files
in \path{TEXMFSYSCONFIG}, and changes to these files will be preserved,
and at upgrade time the system administrator informed about changes.

We will not list all the configuration files for te\TeX, and \tl~2005 and
\tl~2007, but instead pick the three most common situations occurring at
normal usage: adaption of the search pathes and other texmf.cnf settings,
upgrade or installation of a macro package (e.g., \LaTeX\ 
style file), and installation and activation of a new font (family). We will
only slightly touch the installation of new hyphenation patterns and formats.

\section{Changing \texttt{texmf.cnf}}

The central configuration file \path{/etc/texmf/texmf.cnf} is special as 
it defines all search pathes for (nearly) all programs in the \TeX\ world.
All the pathes mentioned above are defined in it, but also other behaviour 
(like various size and security settings) is controlled via this file.

Since many different packages can contribute to the final \path{texmf.cnf}
the usual method of shipping parts of the configuration file into a
special directory \path{/etc/texmf/texmf.d} and generation of the final
file from these snippets has been adopted. If a system administrator wants
to change some setting, he should change the respective file in 
\path{/etc/texmf/texmf.d} and call \prog{update-texmf}.

Example: \path{/etc/texmf/texmf.d/05TeXMF.cnf} contains the setting for
\path{TEXMFHOME} = \path{$HOME/texmf}. On our system we had
the input files always in \path{$HOME/texlib}, what I want to
keep. I change the respective line in \path{/etc/texmf/texmf.d/05TeXMF.cnf}
and call as root \prog{update-texmf}.

The problem with this approach is that upgrades of the file \path{05TeXMF.cnf}
are either not taken, or I have to change the settings after every change
of \path{05TeXMF.cnf} in the Debian package. Here a bit of \path{KPSE} magic
helps: As earlier settings in \path{texmf.cnf} override later ones, I can 
add a file \path{03local.cnf} to \path{/etc/texmf/texmf.d} and put the
changed \path{TEXMFHOME} variable there.

Similar changes can be made for all the other settings in \path{texmf.cnf}.

If you really really want to change \emph{as a user} some setting in
\path{texmf.cnf}, you can put it into \path{$HOME/.texmf-config} 
CHECK THIS CHECK THIS CHECK THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

\section{Update/Installation of a macro package, style file, etc}

This is a quite common task, as many packages are evolving very fast
and sometimes newer versions are necessary. Let us go through the 
necessary steps for the \path{natbib} package. (Note that the procedure is
the same for the \TeX\ systems on Debian and any other `default' \tl\
installation.)

\subsection{System administrator}

First you have to get all the files from your local \acro{CTAN} node:\\
\acro{CTAN}\path{/macros/latex/contrib/natbib}\\
and put them into a temporary directory. After this you run latex over all
the \path{.ins} files to generate the input files, and over all the
\path{.dtx} files to generate the documentation. You will end up with 
quote some files, put the 
\path{.sty} files into \path{$TEXMFLOCAL/tex/latex/natbib},
\path{.bst} files into \path{$TEXMFLOCAL/bibtex/bst/natbib},
and if you wish the various \path{.dvi} files (and other documentation
files) into \path{$TEXMFLOCAL/doc/latex/natbib}.

After this call \prog{mktexlsr} and the next time any user of your
system uses \path{natbib} the updated version will be used.

\subsection{User}

If you don't have the permissions to write to \path{TEXMFLOCAL} just
replace \path{TEXMFLOCAL} with \path{TEXMFHOME} and you are done.
As a user calling \prog{mktexlsr} is not necessary.

\section{Installation and activation of a font package}

Installation and activation of a font package is a bit more involved then
just updating/installing a macro package. We will go through this using the
MathTimePro2 font set (available from \acro{XXXXXXXXXXXXX}).

\subsection{System administrator}

You should have received a zip file \path{mtp2fonts.zip}, which you should
unzip into a temporary directory. This packages is already shipped as a
\path{TEXMF}-tree, so just copy all the files under \path{texmf} to the
same location in \path{TEXMFLOCAL}, e.g.,\\
	\texttt{cp -a texmf/* /usr/local/share/texmf}.\\
If the package is not shipped as a \path{TEXMF}-tree you have to 
install all the files you have obtained as into the right places in
\path{TEXMFLOCAL}, i.e.,
\begin{description}
\item[\path{.sty,.tex,.fd}] into \path{$TEXMFLOCAL/tex/latex/foo}
\item[\path{.map}] into \path{$TEXMFLOCAL/fonts/map/dvips/foo}
\item[\path{.tfm}] into \path{$TEXMFLOCAL/fonts/tfm/company/foo}
\item[\path{.pfb}] into \path{$TEXMFLOCAL/fonts/type1/company/foo}
\item[\path{.vf}] into \path{$TEXMFLOCAL/fonts/vf/company/foo}
\end{description}
(not all of these files have to be present). After running \prog{mktexlsr}
again these fonts are now available, but neither \prog{dvips}, nor
\prog{pdftex}, nor \prog{xdvi} will recognize these fonts and will not
display the fonts correctly.

For this you have to activate the respective \path{map} file which was
(hopefully) shipped with the package. In our case there is the file
\path{mtpro2.map} which we want to activate by default.

Here the Debian specific parts begin (but see below): The best way for
doing this is adding a file \path{90local-mtpro2.cfg} into the
directory \path{/etc/texmf/updmap.d}, calling as root \prog{update-updmap}
which generates the final \path{updmap.cfg} file from the snippets in
\path{/etc/texmf/updmap.d}, and finally (as usual) call \prog{updmap-sys}
to update the various configuration files for \prog{dvips}, \prog{xdvi}, etc.

You can also put \emph{all} your local adaptions into a file 
\path{90local.cfg} if you prefer to keep only one.

The above paragraphs describe the intended way to activate maps. Due to the
wide spread information on the web and user groups on how to acivate a map
file using a call\\
\prog{updmap-sys --enable Map mtpro2.map}\\
the Debian version of \prog{updmap(-sys)} has been adapted to \emph{not}
change the file \path{updmap.cfg} directly, but enable and disable maps in 
\path{/etc/texmf/updmap.d/99local.cfg}. After this \prog{update-updmap} is 
called and again \prog{updmap-sys} for final operation. 

This way a following \prog{update-updmap} call does not overwrite the
changes made by \prog{updmap-sys --enable}.

\subsection{User}

If a normal user without administrator rights wants to install and
activate a new font set, he first has to install the fonts as decribed
above, but instead into \path{TEXMFLOCAL} he should put the files
under \path{TEXMFHOME}.

After this he should create \path{$HOME/.texmf-config} and 
\path{$HOME/.texmf-var}, put the config file 
\path{90mtpro2.cfg} into \path{$HOME/.texmf-config/updmap.d},
and call \prog{update-updmap}. This call will generate his own copy
of \path{updmap.cfg} in \path{$HOME/.texmf-var/web2c}. After this
he can call \prog{updmap} to generate the necessary configuration files
for \prog{dvips}, \prog{xdvi}, etc in \path{$HOME/.texmf-var}.

Note that changes in \path{/etc/texmf} are \emph{not} automatically carried 
over to the user files. So in case something is going wrong the user
should call again \prog{update-updmap} and \prog{updmap}.

\section{Hyphenation patterns and formats}

To install new hyphenation patterns and new formats  you can follow the
above example concerning fonts, with \prog{update-language} and
\prog{update-fmtutil} taking the place of \prog{update-updmap}, the
path component \path{language.d} and \path{fmt.d} the place of
\path{updmap.d}, \prog{fmtutil(-sys)} the place of 
\prog{updmap(-sys)}.

\section{Further developments}

Things are evolving very fast at the moment. While Debian Etch ships with
\tl~2005, the 2007 release of \tl\ is already present in Debian Sid and will
find its way into testing (lenny) (hopefully) soon, bringing Xe\TeX\ to the
Debian world.

At the same time
we provide independent packaging of Con\TeX{}t and lua\TeX\ to make Debian
the ideal play ground for further developments.

For the stable release Etch of Debian we will provide backports at
\url{www.backports.org/foo/bar/baz/bla}.

\SetBibJustification{\raggedright}
\bibliographystyle{plain}
\bibliography{texondebian}
\makesignature
\end{document}

