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

\begin{document}
\maketitle
\section{TeX Gyre Fonts}
This is the portion of the TUG documentation which deals with making the TeX Gyre Fonts 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.

A clean package file will contain
\begin{itemize}
\item  The files  ``buildPackage.sh'' and "signPackage.sh"
\item The files ``background.jpg'', ``License.rtf'', ``ReadMe.rtf'', ``Welcome.rtf''
\item ``root'' folder with a tree leading to the folder named ``TeX Gyre''
\item TeXGyreFontsBuild, the PackageMaker project file for the TeX-Gyre-Fonts install package
\item ``TUG'' folder with this document
\end{itemize}

This is one of the easiest packages to maintain. It is unique in that its name does not change from year to
year, since if there are new versions of the TeX Gyre Fonts, we want to replace the old versions with the
new versions. To update the package for a new year, it is not necessary to edit ``buildPackage.sh'',
 and the only file that should be edited is 
``Welcome.rtf'', because it shows the release date.

Unlike most packages, the root folder is not constructed by copying an actual installation on the Mac.
Instead, it is a permanent part of the build system, which buildPackage.sh assumes already exists. 

To construct the package, find the latest version of the TeX Gyre Fonts  in 
\url{/usr/local/texlive/2013/texmf-dist/fonts/opentype/public/tex-gyre}. Copy the contents to
the build system at root/Library/Fonts/TeX Gyre/. Then
\begin{verbatim}
     sudo sh buildPackage.sh
\end{verbatim}

This step will make sure permissions are correct in /root, but will not build an install package.
Building an install package is optional, since the install packages which contain TeX-Gyre-Fonts
use only the /root folder.

\section{Making an Install Package}
If an install package is desired, build it using TeXGyreFontsBuild. Mountain Lion requires that packages
be signed. Signing is achieved by selecting a certificate. My certificate for install packages is
``Developer ID Installer: Richard Koch'', but others will use another certificate. See the master TUG documentation
for the entire MacTeX-2012 Build System for an explanation of how to obtain a developer signature.

Edit this project file using the
GUI interface of PackageBuilder 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: ``TeX-Gyre-Fonts''
\item User Sees: Easy Install Only
\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
\item Click the entry in the Contents section on the left. The right side will change to a view with two tabs.
Select the Configuration tab. Edit so
\begin{enumerate}
\item Choice Name: TeX Gyre Fonts
\item Identifier: choice1
\item Initial State: Selected and Enabled
\item Destiination: Leave Blank
\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 left column. This item should show a ``Fonts'' directory,
obtained by dragging root/Library/Fonts to the left column. The right side will change to a view with four tabs.
Items under the Components and Scripts tabs can be left blank. It is not necessary to edit the
items under the Contents tab. The items under the
Configuration tab should be edited as follows:
\begin{enumerate}
\item Install: 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}

\end{enumerate}

After verifying all these items, build the install package by clicking the ``Build'' icon. When asked to select
a name, choose ``TeX-Gyre-Fonts-Temp.pkg''. 
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 TeX-Gyre-Fonts-Temp.pkg and ``new-name'' is TeX-Gyre-Fonts.pkg.








\end{document}  