
\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-for-DVD}
\author{Richard Koch}
\date{\today}                                           % Activate to display a given date or no date

\begin{document}
\maketitle
\section{MacTeX}
This is the portion of the TUG documentation which deals with making the MacTeX install package for the DVD. 
The ultimate product of this work will be a folder named MacTeX-Install to be placed in the DVD mactex folder.
This install folder will contain one document, ``MacTeX Install Part 1'' , an 
install package constructed below, ``MacTeX Install Part 2.pkg'', and a folder named TLprofiles. 

The RLprofiles folder should duplicate the TLprofiles folder inside TeXLive-2016, as constructed earlier.
 

\section{Contents} 
This is a final product of the build directory, built for DVD distribution.

A clean package file will contain
\begin{itemize}
\item Files ``MacTeXDVDMaker'' and ``signPackage.sh''
\item Files ``background.jpg'', ``License.rtf'', ``ReadMe.rtf'', and ``Welcome.rtf''
\item A folder MacTeX-Install, with two files named ``MacTeX Install Park 1'' and ``MacTeX Install Part 3''.
\item scripts\_ghostscript folder, containing files ``postinstall'' and ``setloginpath''
\item scripts\_gui folder, containing file ``postinstall''
\item scripts\_texdist folder, containing files ``Description.rtf'', ``postinstall'', ``setloginpath'', ``setmanpath'', ``texdist'', ``TeXDist-description.rtf'', ``TeXDistVersion'',
``TeXManPath'', and ``TeXPath'' 
\item ``TUG'' folder with this document
\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{Building MacTeX Install Part 2  with Packagemaker}

There are two copies of the Packagemaker Template to build part 2 of the MacTeX Install: MacTeXDVDMaker and
MacTeXDVDMaker copy. The second is a backup of the first and the most reliable information in case the first
becomes corrupted. Material below is really just a supplemental backup.

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 Install Part 2
\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 Requirements and Actions tab entries for the top item can be left blank
\end{enumerate}

Click the entry TeXDist 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: TeXDist
\item Identifier: choice1
\item Initial State: Selected and Enabled
\item Destination: /
\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 Library  entry in the bottom left column. This item should show a ``Library'' directory,
obtained by dragging ../TeXDist/root/Library 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: ../TeXDist/root/Library (The item on the right should have selected ``Relative To Project'')
\item Destination: /Library (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.texdist
\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\_texdist (The item on the right should have selected ``Relative To Project'')
\item Preinstall: Leave Blank
\item Postinstall: scripts\_texdist/postinstall (The item on the right should have selected ``Relative To Project'')
\end{enumerate}

\end{enumerate}


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. Add an  ``Applications'' directory to this item 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.gui2018
\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\_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}

Click the entry Ghostscript-9.23 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.23
\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.23  entry in the bottom left column. This item should show a ``local'' directory,
obtained by dragging ../Ghostscript-9.23/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.23/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.23
\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}



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



\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 Install Part 2-Temp.pkg and ``new-name'' is MacTeX Install Part 2.pkg.









\end{document}  



\end{document}  