
Build Instructions
==================

Linefeed conventions
---------------------
Note that all the PGP source code files are distributed using
Unix linefeed conventions (LF), in order for the SHA hashes to
check out good. You may want to convert the files to Macintosh
style linefeeds (CR) before compiling.

Tools
-----
The commercial PGP was compiled with Metrowerks CodeWarrior Pro
1, with the "IDE 2.0.1 Patch" applied, and the installer was
built with Installer VISE 4.6.1 from MindVision Software, Inc.
This book, along with Pretty Good Privacy(tm) 5.5 - Platform-
Independent Source Code, contains everything used internally by
PGP Inc. to build the binaries that PGP ships, except:

  * The manuals have been omitted.

  * "SOMobjects(tm) for Mac OS" from Apple's OpenDoc 1.2
    distribution is needed to build and use PGP-contextmenu.

  * "CFM-68K Runtime Enabler", "NuDragLib.slb", and
    "ObjectSupportLib", available from Apple.

Preparing the source tree
-------------------------
First convert all the Macbinary-format files (those ending with
.bin) to native Mac files of the same name except with the
".bin" stripped off. An easy way to do this is to drag the
entire folder into StuffIt Expander. If you wish to have a clean
source tree, optionally delete all the original ".bin" files. If
you'll be building an installer, you must at least delete the
".bin" files from clients:pgp:mac:install:PGP55Install:

Create the following empty folders:

  * libs:pfl:mac:obj:

  * clients:pgp:mac:PGPEudoraPlugIn:obj:

  * clients:pgp:mac:PGPmenu:pieces:

  * clients:pgp:mac:install:PGP55Install:ContextualMenu Items:

  * clients:pgp:mac:install:PGP55Install:PGP 5.5:Signatures:

  * clients:pgp:mac:install:PGP55Install:system:

  * clients:pgp:mac:obj:

For each folder named "prj", copy the enclosed CodeWarrior
projects (ending with .prj) to the parent folder.

In order to build an installer which includes all the needed
system software, you'll need to put the following files into
clients:pgp:mac:install:PGP55Install:system:

  * "CFM-6SK Runtime Enabler"

  * "NuDragLib.slb"

  * "ObjectSupportLib"

  * "SOMobjects(tm) for Mac OS"

In order to build PGPcontextmenu, "SOMobjects(tm) for Mac
OS" also needs to be put into clients:pgp:mac:PGPcontextmenu:

Configuring CodeWarrior
-----------------------
The file "Metrowerks CodeWarrior:MacOS Support:MacHeaders:
MacHeaders.c" (easily found using Command-D) needs to contain:

  #define SystemSevenOrLater 1

and you need to ensure that OLDROUTINENAMES and OLDROUTINE-
LOCATIONS in that file have not been changed from their default
values of 0. There is a "Recompile MacHeaders" script supplied
with CodeWarrior to recompile this file after changing it.

Source code flags
-----------------
Client flags are set in clients:pgp:shared:pgpBuildFlags.h.

  * The first set of flags are for beta and demo versions, set
    to 0 for production releases.

  * The second set are for freeware, business, and personal.
    One of these three should be checked.

  * The Admin flag should be 0 unless it's a Business Admin
    build.

  * The No License Number flag should be set to 1 for freeware
    or OEM builds.

  * The NO_RSA flags need to be set to 0 to enable RSA. While
    you can have NO_RSA_KEYGEN set to 1 (keygen disabled) and
    NO_RSA_OPERATIONS set to 0 (operations enabled), the opposite
    is illogical and illegal.

Library flags are set in libs:pgpcdk:priv:include:pgpSDKBuildFlags.h.
There are fewer, as they just indicate library support for various
algorithms.

The RSA flags are like the last two in pgpBuildFlags.h, but use
positive logic; they indicate RSA support, not lack of it as in
pgpBuildFlags.h.

There are some other flags for conventional encryption, but it's
unlikely that you'll want to change them.

Building the software
---------------------
Open clients:pgp:mac:MasterBuild.prj. Set the desired target using
the pop-up menu in the project window. For instance, "All non-debug"
builds PowerPC and 68K release versions. Then do a "Make".

Rename "PGPpluginEudora" to "PGPplugin/Eudora" in clients:pgp:mac:
obj:

Manual installation
-------------------
Copy libs:pgpcdk:mac:pub:PGPsdk*, and PGPUILib*, PGPemailer*, and
PGPmenu* from clients:pgp:mac:obj: to your extensions folder.

Install the rest of clients:pgp:mac:obj: wherever you'd like.

Building an installer using Installer VISE
------------------------------------------
Copy PGPsdk, PGPsdk68K, PGPsdkKeyServerLib, and PGPsdkKeyServerLib68K
from libs:pgpcdk:mac:pub: toclients:pgp:mac:install:PGP55Install:
system:

Copy PGPemailer, PGPemailer68K, PGPmenu, PGPmenu68K, PGPplugin/
Eudora, PGPpluginEudora68K.Lib, PGPUILib, and PGPUILib68K from
clients:pgp:mac:obj: to clients:pgp:mac:install:PGP55Install:
system:

Copy PGPkeys, PGPkeys68K, PGPtools, and PGPtools68K from clients:
pgp:mac:obj: to clients:pgp:mac:install:PGP55Install:PGP 5.5:

Copy clients:pgp:mac:obj:PGPcontextmenu to clients:pgp:mac:
install:PGP55Install:Contextual Menu Items:

Use ResEdit to "Get File/Folder Info" for PGPmenu and PGPmenu68K
within clients:pgp:mac:install:PGP55Install:system: For each,
clear the "Inited" flag and set the "Has BNDL" flag.

At this point you can optionally create digital signatures for
the individual components. The installer will look for the
following files: PGPemailer.sig, PGPemailer68K.sig, PGPkeys.sig,
PGPkeys68K.sig, PGP-plugin/Eudora.sig, PGPpluginEudora68K.Lib.sig,
PGPmenu.sig, PGPmenu68K.sig, PGPsdk.sig, PGPsdk68K.sig, PGPsdk-
KeyServerLib.sig, PGPsdkKeyServerLib68K.sig, PGPtools.sig, PGP-
tools68K.sig, PGPUILib.sig, PGPUILib68K.sig, PGPcontextmenu.sig

You might also want to rearrange the icon positions within the
PGP55Install:PGP 5.5: and PGP55Install:PGP 5.5:Signatures:
folders, since they will be reproduced in the install process.

Open clients:pgp:mac:install:PGP55Install:PGP55.vct.

Choose "Archive Settings" from the "Archive" menu. In the
"Interface" tab, click the "Edit Easy Install Text" and "Edit
Remove Text" buttons and modify the text as appropriate. In the
"Extras" tab, select the ReadMe and License Agreement files. The
ReadMe file is in PGP55Install:PGP 5.5:PGP 5.5 README, and the
License Agreement is in PGP55Install:PGPlicense. Close the archive
settings.

Choose "Update Archive" from the "Archive" menu, and help it find
all the files it needs. They should all be somewhere within the
clients:pgp:mac:install:PGP55Install: folder. When the update
window comes up, enable all the check boxes on the left edge to
force all the files to be updated (except for "Eudora Stuff",
which is an action, not a file).

Open up all the directories, and verify the status (rightmost
column) of each file. Watch out for "<missing>" files. The only
ones which should be missing are PGPadmin and PGPadmin68K, and
any signature files you left out.

Click the "Update" button at the top of the window. It will ask
for confirmation to delete the missing files from the archive.

Finally, choose "Build Installer" from the "File" menu.
