% !TEX TS-program = htlatex
\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-MacTeX-2013-DVD}
\author{Richard Koch}
\date{\today}                                           % Activate to display a given date or no date

\begin{document}
\maketitle
\section{MacTeX-DVD}
This is the portion of the TUG documentation which deals with making the MacTeX-2013-DVD package.

{\bf Warning:} It is important that the folders in which packages are built live on the hard disk rather than an external
disk. Building constructs folders named ``root'' which are copies of material to be installed. This root folder and its
contents are often owned by root. But material on an external drive is owned by the user instead.

This is the final product of the build directory, built for DVD distribution.

A clean package file will contain
\begin{itemize}
\item Files ``buildPackage.sh'' and ``signPackage.sh''
\item Files ``background.jpg'', ``License.rtf'', ``ReadMe.rtf'', and ``Welcome.rtf''
\item scripts\_convert folder, containing files ``postinstall'', ``setloginpath'', and ``settexpath''
\item scripts\_ghostscript folder, containing files ``postinstall'' and ``setloginpath''
\item scripts\_gui folder, containing file ``postinstall''
\item scripts\_teliveDVD folder, containing files ``Description.rtf'', ``postinstall'', ``setloginpath'', ``setmanpath'', ``texdist'', ``TeXDist-description.rtf'', ``TeXDistVersion'',
``TeXManPath'', and ``TeXPath'' and PrefPane folder containing the file ``Info.plist'' and the ``TeX Distribution'' preference pane
\item The MacTeXDVDMaker project file for PackageMaker
\item ``TUG'' folder with this document
\item ``xzDVD'' folder, used to make an xz file with the package to submit to TUG; this file contains the xz Universal Binary
and an xzscript
\item Folder ``OldStyle'' used to make an old style legacy package of MacTeX-2013-DVD.mpkg. This legacy version is the version which will
appear on the DVD.
\end{itemize}

This package is easy to maintain. To update the package for a new year, edit the three rtf files, changing the package name
to reflect the new date and release date. 



\section{Making the Old Style Legacy MacTeX-2013-DVD.mpkg}
There are two ways to proceed: with PackageMaker in legacy mode, and with Iceberg.

To construct the package with PackageMaker, fill the empty subfolder ``subpackages'' with legacy versions of Ghostscript-9.07, GUI-Applications,
ImageMagick-Convert-6.8.3-3, Latin-Modern-Fonts, TeX-Gyre-Fonts, and TeXLive-2013-DVD. Then issue the command
\begin{verbatim}
     buildOldPackage.sh
\end{verbatim}

Unfortunately, experiments show that this technique does not work! The procedure asks PackageMaker to construct a legacy style mpkg using
the command line. The
man pages for PackageMaker claim this is possible, but the command does not work.

Luckily, there is an out. Stephene Sudre has written an open source version of the old PackageMaker called {\em Iceberg}.
See
\begin{verbatim}
     http://s.sudre.free.fr/Software/Iceberg.html
\end{verbatim}

This software can combine the individual legacy packages and produce an mpkg output which looks to the user
exactly like our previous install Package. 

So instead, put the six old style packages in OldStyle/MacTeX-2013-DVD/build. Then double click MacTeX-2013-DVD in OldStyle/MacTeX-2013-DVD
to start IceBerg. Ask IceBerg to build the old style package. 


\section{Configuring MacTeX-2013-DVD in Iceberg}

Click on the MacTeX-2013-DVD item in the left column to check that the item has name MacTeX-2013-DVD.

The  Settings in the right column should be as follows:

{\em Description}
\begin{itemize}
\item Title: MacTeX-2013-DVD
\item	Version: 1.0
\end{itemize}

\newpage

{\em Display Information}
\begin{itemize}
\item Display Name: MacTeX-2013-DVD
\item	Identifier: org.tug.pkg.macTeX-2013-DVD
\item Get-Info string: MacTeX-2013-DVD 1.0 Copyright @ 2013 TeX User Group
\item Short version: 1.0
\end{itemize}

{\em Version}
\begin{itemize}
\item Major: 1
\item Minor: 0
\end{itemize}

The  Documents in the right column should be as follows:

{\em Background Image}
\begin{itemize}
\item Path: /Users/koch/Desktop/MacTeX-2013/MacTeX-2013-DVD/OldStyle/ \newline
	resources/background.jpg
\item Scaling: To Fit
\item Alignment: Left
\end{itemize}

{\em Welcome}
\begin{itemize}
\item Path: /Users/koch/Desktop/MacTeX-2013/MacTeX-2013-DVD/OldStyle/ \newline
	resources/English.lproj/Welcome.rtf
\end{itemize}

{\em ReadMe}
\begin{itemize}
\item Path: /Users/koch/Desktop/MacTeX-2013/MacTeX-2013-DVD/OldStyle/ \newline
	resources/English.lproj/ReadMe.rtf
\end{itemize}

{\em License}
\begin{itemize}
\item Path: /Users/koch/Desktop/MacTeX-2013/MacTeX-2013-DVD/OldStyle/ \newline
	resources/English.lproj/License.rtf
\end{itemize}

The  Scripts in the right column should be as follows:

{\em Requirements} \newline
Empty

{\em Installation Scripts} \newline
Empty

{\em Additional Resources} \newline
Empty

\newpage

The  Plugins in the right column should be as follows:

\begin{itemize}
\item Introduction
\item ReadMe
\item License
\item Select Destination
\item Installation Type
\item Install
\item Finish Up
\end{itemize}

The Components in the right column should be as follows

\begin{itemize}
\item: Location: Contents/Resources Custom
\item: Pages \& Metapackages with Attribute, all checked
\begin{itemize}
\item Ghostscript-9.97 Selected
\item GUI-Applications Selected
\item ImageMagick-Convert-6.8.3-3 Selected
\item Latin-Modern-Fonts Unselected
\item TeX-Gyre-Fonts Unselected
\item TeXLive-2013-DVD selected
\end{itemize}
\end{itemize}

\newpage

\section{Making the xz File}

This is an optional step, only needed if Karl asks for an xz file with MacTeX-2013-DVD.

Put MacTeX-2013-DVD.mpkg in the xzDVD folder. Then create the xz file using the command
\begin{verbatim}
     sh xzscript
\end{verbatim}



\section{Building TeXLive--2013-DVD  with Packagemaker}

The remaining steps are optional and will not be used by TUG.

Edit MacTeXDVDMaker, the Packagemaker project file, using the GUI interface, as follows.

\begin{enumerate}
\item Click the top item on the left. The right side will change to a view with three tabs. First select
the Configuration tab. Edit so
\begin{enumerate}
\item Title: MacTeX-2013-DVD
\item User Sees: Easy and Custom Intall
\item Install Destination: System volume
\item Certificate: Leave this blank. You might think that putting a certificate name here would correctly sign
the package, but experiments show that it does not. The package needs to be signed after it is constructed.
\item Description: Empty
\end{enumerate}
\item The Actions tab entries for the top item can be left blank
\item Select the Requirements tab for the top item. Using the plus tab, add an item of the form ``File Exists on System''.
Set the file path to ``/Volumes/TEXCOL2013/texlive''. In the Failure Message, set Title to ``Install DVD Missing''
and set Message to ``The TUG TeX Collection DVD must be mounted to install TeX.''
\item Continuing with the Requirements tab, use the plus tab to add a second item of the
form ``Memory Available (Bytes)''. Fill in the next line to read ``if: $>$  4294967295''. Set Title to ``Disk Space
Inadequate'' and Message to ``Not enough free disk space; MacTeX requires at least 4 gigabytes of
free disk space.''
\end{enumerate}

\newpage
Click the entry TeXLive-2013 in the Contents section on the left. The right side will change to a view with two tabs.
\begin{enumerate}
\item  Select the Configuration tab. Edit so
\begin{enumerate}
\item Choice Name: TeXLive-2013
\item Identifier: choice1
\item Initial State: Selected and Enabled
\item Destiination: /
\item Tooltip: Leave Blank
\item Description: Leave Blank
\end{enumerate}
\item The Requirements tab entries for this contents item can be left blank
\item Open the TeXLive-2013  entry in the bottom left column. This item should show an ``texlive'' directory,
obtained by dragging ../TeXLive-2013/rootDVD/usr/local to the left column. The right side will change to a view with four tabs.
 It is not necessary to edit the
items under the Contents or Components tabs. The items under the
Configuration tab should be edited as follows:
\begin{enumerate}
\item Install: ../TeXLive-2013/rootDVD/usr/local (The item on the right should have selected ``Relative To Project'')
\item Destination: /usr/local (The item on the right should have selected ``Relative To Project'')
\item Do not check ``Allow custom location''
\item Patch: No patch root selected
\item Package Identifier: org.tug.mactex.texlive2013-dvd
\item Package Version: 1.0
\item Restart Action: None
\item Check ``Require admin authentication''
\item PackageLocation: Self-Contained
\end{enumerate}
The items under the Scripts tab should be edited to read
\begin{enumerate}
\item Scripts directory: scripts\_texliveDVD (The item on the right should have selected ``Relative To Project'')
\item Preinstall: Leave Blank
\item Postinstall: scripts\_texliveDVD/postinstall (The item on the right should have selected ``Relative To Project'')
\end{enumerate}

\end{enumerate}


\newpage
Click the entry GUI-Applications in the Contents section on the left. The right side will change to a view with two tabs.
\begin{enumerate}
\item  Select the Configuration tab. Edit so
\begin{enumerate}
\item Choice Name: GUI-Applications
\item Identifier: choice2
\item Initial State: Selected and Enabled
\item Destiination: /
\item Tooltip: Leave Blank
\item Description: Leave Blank
\end{enumerate}
\item The Requirements tab entries for this contents item can be left blank
\item Open the GUI-Applications  entry in the bottom left column. This item should show an ``Applications'' directory,
obtained by dragging ../GUI-Applications/root/Applications to the left column. The right side will change to a view with four tabs.
 It is not necessary to edit the
items under the Contents tab. But it is {\em very important} to edit the  items under the Components tab, turning off all boxes labeled ``Allow Relocation.''   The items under the
Configuration tab should be edited as follows:
\begin{enumerate}
\item Install: ../GUI-Applications/root/Applications (The item on the right should have selected ``Relative To Project'')
\item Destination: /Applications (The item on the right should have selected ``Relative To Project'')
\item Do not check ``Allow custom location''
\item Patch: No patch root selected
\item Package Identifier: org.tug.mactex.gui
\item Package Version: 1.0
\item Restart Action: None
\item Check ``Require admin authentication''
\item PackageLocation: Self-Contained
\end{enumerate}
\newpage
The items under the Scripts tab should be edited to read
\begin{enumerate}
\item Scripts directory: scripts\_gui (The item on the right should have selected ``Relative To Project'')
\item Preinstall: Leave Blank
\item Postinstall: scripts\_gui/postinstall (The item on the right should have selected ``Relative To Project'')
\end{enumerate}

\end{enumerate}

\newpage
Click the entry Ghostscript-9.05 in the Contents section on the left. The right side will change to a view with two tabs.
\begin{enumerate}
\item  Select the Configuration tab. Edit so
\begin{enumerate}
\item Choice Name: Ghostscript-9.05
\item Identifier: choice3
\item Initial State: Selected and Enabled
\item Destiination: /
\item Tooltip: Leave Blank
\item Description: Leave Blank
\end{enumerate}
\item The Requirements tab entries for this contents item can be left blank
\item Open the Ghostscript-9.05  entry in the bottom left column. This item should show a ``local'' directory,
obtained by dragging ../Ghostscript-9.05/root/usr/local to the left column. The right side will change to a view with four tabs.
 It is not necessary to edit the
items under the Contents or Components tabs. The items under the
Configuration tab should be edited as follows:
\begin{enumerate}
\item Install: ../Ghostscript-9.05/root/usr/local (The item on the right should have selected ``Relative To Project'')
\item Destination: /usr/local (The item on the right should have selected ``Relative To Project'')
\item Do not check ``Allow custom location''
\item Patch: No patch root selected
\item Package Identifier: org.tug.mactex.ghostscript9.05
\item Package Version: 1.0
\item Restart Action: None
\item Check ``Require admin authentication''
\item PackageLocation: Self-Contained
\end{enumerate}
The items under the Scripts tab should be edited to read
\begin{enumerate}
\item Scripts directory: scripts\_ghostscript (The item on the right should have selected ``Relative To Project'')
\item Preinstall: Leave Blank
\item Postinstall: scripts\_ghostscript/postinstall (The item on the right should have selected ``Relative To Project'')
\end{enumerate}

\end{enumerate}

\newpage
Click the entry Convert-IM-6.7.6 in the Contents section on the left. The right side will change to a view with two tabs.
\begin{enumerate}
\item  Select the Configuration tab. Edit so
\begin{enumerate}
\item Choice Name: Convert-IM-6.7.6
\item Identifier: choice4
\item Initial State: Selected and Enabled
\item Destiination: /
\item Tooltip: Leave Blank
\item Description: Leave Blank
\end{enumerate}
\item The Requirements tab entries for this contents item can be left blank
\item Open the Convert-IM-6.7.6  entry in the bottom left column. This item should show an ``local'' directory,
obtained by dragging ../Convert-IM/rot/usr/local to the left column. The right side will change to a view with four tabs.
 It is not necessary to edit the
items under the Contents or Components tabs. The items under the
Configuration tab should be edited as follows:
\begin{enumerate}
\item Install: ../Convert-IM/root/usr/local (The item on the right should have selected ``Relative To Project'')
\item Destination: /usr/local (The item on the right should have selected ``Relative To Project'')
\item Do not check ``Allow custom location''
\item Patch: No patch root selected
\item Package Identifier: org.tug.mactex.imagemagick-convert-6.7.6-9
\item Package Version: 1.0
\item Restart Action: None
\item Check ``Require admin authentication''
\item PackageLocation: Self-Contained
\end{enumerate}
The items under the Scripts tab should be edited to read
\begin{enumerate}
\item Scripts directory: scripts\_convert (The item on the right should have selected ``Relative To Project'')
\item Preinstall: Leave Blank
\item Postinstall: scripts\_convert/postinstall (The item on the right should have selected ``Relative To Project'')
\end{enumerate}

\end{enumerate}


\newpage
Click the entry Latin-Modern-Fonts in the Contents section on the left. The right side will change to a view with two tabs.
\begin{enumerate}
\item  Select the Configuration tab. Edit so
\begin{enumerate}
\item Choice Name: Latin-Modern-Fonts
\item Identifier: choice5
\item Initial State: Enabled
\item Destiination: /
\item Tooltip: Leave Blank
\item Description: Leave Blank
\end{enumerate}
\item The Requirements tab entries for this contents item can be left blank
\item Open the Latin-Modern-Fonts  entry in the bottom left column. This item should show a ``Fonts'' directory,
obtained by dragging ../Latin-Modern-Fonts/root/Library/Fonts to the left column. The right side will change to a view with four tabs.
 It is not necessary to edit the
items under the Contents or Components tabs. The items under the
Configuration tab should be edited as follows:
\begin{enumerate}
\item Install: ../Latin-Modern-Fonts/root/Library/Fonts (The item on the right should have selected ``Relative To Project'')
\item Destination: /Library/Fonts (The item on the right should have selected ``Relative To Project'')
\item Do not check ``Allow custom location''
\item Patch: No patch root selected
\item Package Identifier: org.tug.mactex.latin-modern
\item Package Version: 1.0
\item Restart Action: None
\item Check ``Require admin authentication''
\item PackageLocation: Self-Contained
\end{enumerate}
The items under the Scripts tab should be left blank

\end{enumerate}


\newpage
Click the entry TeX-Gyre-Fonts in the Contents section on the left. The right side will change to a view with two tabs.
\begin{enumerate}
\item  Select the Configuration tab. Edit so
\begin{enumerate}
\item Choice Name:TeX-Gyre-Fonts
\item Identifier: choice6
\item Initial State: Enabled
\item Destiination: /
\item Tooltip: Leave Blank
\item Description: Leave Blank
\end{enumerate}
\item The Requirements tab entries for this contents item can be left blank
\item Open the TeX-Gyre-Fonts  entry in the bottom left column. This item should show a ``Fonts'' directory,
obtained by dragging ../TeX-Gyre-Fonts/root/Library/Fonts to the left column. The right side will change to a view with four tabs.
 It is not necessary to edit the
items under the Contents or Components tabs. The items under the
Configuration tab should be edited as follows:
\begin{enumerate}
\item Install: ../TeX-Gyre-Fonts/root/Library/Fonts (The item on the right should have selected ``Relative To Project'')
\item Destination: /Library/Fonts (The item on the right should have selected ``Relative To Project'')
\item Do not check ``Allow custom location''
\item Patch: No patch root selected
\item Package Identifier: org.tug.mactex.tex-gyre
\item Package Version: 1.0
\item Restart Action: None
\item Check ``Require admin authentication''
\item PackageLocation: Self-Contained
\end{enumerate}
The items under the Scripts tab should be left blank

\end{enumerate}

\newpage
\section{Building}
After verifying all these items, build the install package by clicking the ``Build'' icon. When asked to select
a name, choose ``MacTeX-2013-DVD-Temp''. 

Packagemaker will report a large number of warnings in the Ghostscript package, but all are incorrect permissions for links. I believe
these permissions are actually correct; they agree with link permissions set by the TeX Live installer.

Packagemaker will also report warnings in the GUI-Applications package. Almost all of these say ``Group ID 80 does not match 20 of root volume.''
Experimentation involving changing the groups of these applications changes this to ``Group ID 20 does not match 80 of root volume.''
I do not believe this warning is important, but it would be nice to know more about it.


\section{Signing}

After the package has been made, sign it by executing the following line in Terminal:
\begin{verbatim}
     sh signPackage.sh
\end{verbatim}
This script simply calls
\begin{verbatim}
     productsign --sign "Developer ID Installer: Richard Koch" old-name new-name
\end{verbatim}
where ``old-name'' is MacTeX-2013-DVD-Temp.pkg and ``new-name'' is MacTeX-2013-DVD.pkg.









\end{document}  