
\documentclass[11pt, oneside]{amsart}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{url}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\title{TUG-TeXLive-2018}
\author{Richard Koch}
%\date{}                                           % Activate to display a given date or no date

\begin{document}
\maketitle
\section{TeXLive-2018}
This is the portion of the TUG documentation which deals with making the TeXLive-2018 and TeXLive-2018-DVD packages.
This is the key component of the build directory.

A clean package file will contain
\begin{itemize}
\item Files ``buildPackage.sh'' 
\item Folder named ``TLprofiles''. This directory will eventually contain two files, ``texlive.profile'' and ``texlivea4.profile''
\item ``TUG'' folder with this document
\end{itemize}


\section{Creating the  Package}

 
The compile system must contain X11. Get it at X11Quartz if it isn't there.

 On the compile system, issue the commands
 \begin{verbatim}
      cd /usr/local
      sudo mv texlive texlive-old
 \end{verbatim}
 
 Then make sure local configuration files for TeX Live are disabled, perhaps by writing
  \begin{verbatim}
     cd 
     cd Library
     mv texmf texmfold
     rm -R texlive
 \end{verbatim}
 
 
 Then create a folder containing the tlpretest, which will later be updated with the same command. To do that, make a directory named
 texlive2018pretest and then
 \begin{verbatim}
      cd
      cd texlive2018pretest
      rsync -a --delete --exclude="mactex*" ftp.math.utah.edu::tlpretest .
\end{verbatim}

The last line here obtains a copy from the utah mirror site for pretest releases. If time is of the essence, but not otherwise, download directly
from the tug home site:
 \begin{verbatim}
      cd
      cd texlive2018pretest
      rsync -a --delete --exclude="mactex*" ftp.tug.org::tlpretext .
\end{verbatim}

 
When first building binaries, it is necessary to submit them to Karl, wait for him to install them in the pretest and wait overnight
for the pretest to make its way to mirror sites.

 
 Then install TeX Live from the svn directory by
 \begin{verbatim}
      TEXLIVE_INSTALL_NO_CONTEXT_CACHE=1
      export TEXLIVE_INSTALL_NO_CONTEXT_CACHE
      cd
      cd texlive2018pretest
      sudo env  TEXLIVE_INSTALL_NO_CONTEXT_CACHE=$TEXLIVE_INSTALL_NO_CONTEXT_CACHE ./install-tl
 \end{verbatim}
 
 The install script will present a short menu of configuration options. Modify defaults as follows:
 \begin{itemize}
 \item Make sure the x86\_64-darwin binaries are selected.
 \item Use the ``D'' option to change some directories:
 \begin{itemize}
 \item Use the ``5'', TEXMFVAR, option to select 
 \begin{verbatim}
      ~/Library/texlive/2018/texmf-var
 \end{verbatim}
  \item Use the ``6'', TEXMFCONFIG, option to select 
 \begin{verbatim}
      ~/Library/texlive/2018/texmf-config
 \end{verbatim}
   \item Use the ``7'', TEXMFHOME, option to select 
 \begin{verbatim}
      ~/Library/texmf
 \end{verbatim}
 \end{itemize}
 \item Use the ``O'' option to select ``use letter size instead of A4 by default''
 \end{itemize} 
Then start installation.

When installation is complete, switch the default tlmgr repository to the final value using
the command 
\begin{verbatim}
     sudo /usr/local/texlive/2018/bin/x86_64-darwin/tlmgr option repository \
          http://mirror.ctan.org/systems/texlive/tlnet
\end{verbatim} 

When installation is complete, go to
\begin{verbatim}
     /usr/local/texlive/2018/tlpkg
\end{verbatim}
and copy the file texlive.profile to the TLprofiles  folder, replacing
the current copy of texlive.profile there. 

In addition, duplicate texlive.profile in the TLprofiles directory, calling the new copy texlivea4.profile. Then edit
this new file, changing ``option\_letter 1'' to ``option\_letter 0'' near the end of the file.  
These TLprofiles also go to the directory MacTeX-for-DVD and ultimately to the install folder
in DVD.

After these steps, the final TeXLive directory ``root''  can be built, using the command:
\begin{verbatim}
     sudo sh buildPackage.sh
\end{verbatim}


Finally repair /usr on systems older than El Capitan by
\begin{verbatim}
      cd
      cd /usr
      sudo rm -R local
      sudo mv local-temp local
\end{verbatim}

and repair /usr/local  by
\begin{verbatim}
      cd
      cd /usr/local
      sudo rm -R texlive
      sudo mv texlive-temp texlive
\end{verbatim}

This root file is  all  that is needed to make MacTeX. 

\end{document}