% !TEX TS-program = htlatex
\documentclass[11pt]{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-Binary}
\author{Richard Koch}
\date{\today}                                           % Activate to display a given date or no date

\begin{document}
\maketitle
\section{TeX Live Binaries}
This is the portion of the TUG documentation which deals with making the TeX Live binaries.
Building is a two stage process. First TeX Live and asymptote are compiled on Intel Leopard,
PowerPC Leopard, and Intel Snow Leopard. Then the resulting binaries  are processed in this directory,
forming the universal binaries sent to TUG for inclusion in TeX Live. 

A clean package file will contain
\begin{itemize}
\item The folder AsymptoteBuild containing information for building asymptote.

\item The folder BuildingBinaries, containing documentation for building the rest of TeX Live. In particular,
the key document  {\em BuildStatus-2013} is here.
\item An empty folder named ``RawCodeFromCompile''
\item Two scripts, liposcript-universal and liposcript-x86\_64, which combine the raw binaries into final form
\item  ``liposcript-universal'' and  ``liposcript-x86\_64''
\item ``TUG'' folder with this document
\item xindy-2010 folder with several xindy.mem and xindy.run files
\end{itemize}

In addition, the main MacTeX folder containing Binary must  contain ``xz'', the binary which compresses packages.

\section{Compiling the Binaries}

The ``BuildingBinaries'' folder contains a crucial document named
\begin{verbatim}
     BuildStatus-2013
\end{verbatim}
This document contains the precise shell commands needed to build TeX Live binaries on Intel Leopard, PowerPC Leopard, and Intel Snow Leopard.
The document is a text file rather than a TeX file so it can be easily edited. Any change in compile commands should immediately be added to the document.
I find it convenient to put a copy of the document on the desktop of each machine, merging editing changes back into the master document from time to time.

Building xindy requires obtaining and compiling CLISP. The document explains exactly how that is done. It only needs to be done
once on each platform.

Building asymptote requires obtaining, compiling, and installing three libraries. Complete instructions are included in the AsymptoteBuild
folder, in the document
\begin{verbatim}
     AsymptoteBuildStatus-2013
\end{verbatim}

The end result of this process on Intel Leopard will be a folder of binaries and an isolated binary
\begin{itemize}
\item    i386-apple-darwin9.8.0
\item     asy-Intel
\end{itemize}

The end result on Intel Snow Leopard will be
\begin{itemize}
\item	x86\_64-apple-darwin10.8.0
\item asy-x86\_64
\end{itemize}

The end result on PowerPC Leopard will be 
\begin{itemize}
\item     powerpc-apple-darwin9.8.0
\item     asy-PPC
\end{itemize}

Move these folders and files to the Binary/RawCodeFromCompile directory of the MacTeX build system on the machine used to
make final packages.

\section{Making Universal Binaries}

To build the universal-darwin binary directory, go to the Binary directory and execute the command
\begin{verbatim}
     sudo sh liposcript-universal
\end{verbatim}
This will create a folder named universal-darwin and  a file named
universal-darwin.tar.xz. Send the xz file to Karl Berry. 

To build the x86\_64-darwin binary directory, go to the Binary directory and execute the command
\begin{verbatim}
     sudo sh liposcript-x86_64
\end{verbatim}
This will create a folder named x86\_64-darwin and  a file named
x86\_64-darwin.tar.xz. Send the xz file to Karl Berry.

\section{Xindy}
In 2011, due to a strange interaction between Xindy and CLisp, the xindy.run and xindy.mem files are corrupt. But
the 2010 versions of these files work, and the files have not been changed. So the two liposcripts replace 2011 
versions of the files with the 2010 versions. In universal-darwin life is a little more complicated because
xindy.mem is not processor independent, but the liposcripts still do the right thing.







\end{document}  