(no commit message)
[devwiki.git] / design / librarymacinstallerplan.mdwn
1 ##Plan Mac Installer for GSS EAP and SASL GS2 libraries
2 ###Introduction:
3 This document describes Codethink's plan for producing an installer for the Moonshot GSS EAP and SASL GS2 libraries for Mac OS X 10.6 (“Snow Leopard”) and 10.7 (“Lion”). 
4 It describes the goals, activities, deliverables and milestones for the development.
5 It also gives some background on the intended locations of the files to be installed, system configuration modifications and any other pertinent information. It explains how the installer conforms to Apple’s relevant guidelines to developers.
6 ###Goals
7 The primary goal is to allow users to install these initiator libraries on a computer running Mac OS X without needing to build them from source. 
8
9 Secondary goals are
10
11 1. To allow users who are familiar with the autotools tool chain to install, as well as build, the libraries using autotools on a computer running Mac OS X. (This is currently possible for the Cyrus SASL library, but not for the Moonshot GSS EAP library).
12
13 2. To automate (as far as possible) and document the process, allowing Moonshot project developers to easily produce installer packages for future versions of these libraries.
14
15 ###Deliverables:
16 1. Changes to files if required to allow the Moonshot GSS EAP library to be installed, as well as built, under Mac OS using autotools.
17 2. An installer package (or packages) that, when run, will install the necessary files to the required places in the files system. (See Outstanding questions/issues 1).
18 3. A compressed disk image file containing the installer package(s), which can be mounted to run the installer package. (See Outstanding questions/issues 2)
19 4. Instructions and scripts for creating the installers and disk images from source. PackageMaker, (the tool provided by Apple to build installer packages - see Ref. 2) does not have a command line interface, and there do not appear to be any freely available alternatives which do, so it will probably not be possibly to automate the production of the installer package(s). 
20
21 ###Activities and Milestones
22 1. Build and install the Cyrus SASL Library for Mac OS using autotools to prove this currently works and that it is a valid goal for the Moonshot GSS EAP library. Due Wednesday 16th November.
23 2. Create an installer package and compressed disk image for the Cyrus SASL Library, with notes on how to achieve the process. Due Friday 18th November.
24 3. Make the necessary changes to the Moonshot GSS EAP library source and configuration files to build and install it for Mac OS using autotools. Due Friday 25th November.
25 4. Create an installer package and compressed disk image for the Moonshot GSS EAP library. Due Tuesday 29th November.
26 5. Create the scripts and instructions. Due Wednesday 30th November.
27
28 ###Issues and questions
29 ####To be resolved ASAP
30 Q: Luke> What's the actual framework binary (that is, /Library/Frameworks/Moonshot.framework/Moonshot) going to link to -- libmoonshot-ui? That would make the most sense as mech_eap and the GS2 SASL plugin aren't directly linked against by applications. By convention, you'll need to have something there (otherwise it's not really a framework).           
31 > A: Pete> I was planning to link /Moonshot.framework/Moonshot to the mech_eap dynamic library. libmoonshot-ui (or whatever replaces it in the refactored Identity Selector software) will be created and installed when we port the Identity Selector to Mac OS, which is a separate task.  As I understand it, mech_eap *is* the Moonshot GSS EAP library. If it isn't directly linked against by applications, do we just install it in /usr/local/lib and forget about creating a framework?  I still need to get to the bottom of this issue, before I start making the installer for it.
32
33 Q: Pete> New issue - do we need to do the versioning as suggested in the plan, or can we just overwrite the existing installation?
34 ####To be resolved during implementation
35 Q: Sam> One of the big questions will be to what extent will you use system dependencies and to what extent will you package your own. You'll want to look over the build instructions Josh pointed you at. If you're packaging the acceptor, then all of the dependencies on the preparation page as well as everything built by the builder script apply.If you're packaging an initiator, you need Kerberos and not much else.
36 > A: Pete> My inclination for the Mac installer is as far as possible to use what ships with the OS - in this case Heimdal for Lion - but to include anything else in our installer - even if it *may* already be installed to support another program.
37
38 Q: Sam> One of the big questions will be whether you can use the system Kerberos.  My assumption is that you cannot for 10.6.  You may be able
39 to do so for 10.7. This will be one of the big open questions we're expecting the plan to answer.
40 > A: Pete> Googling for 'mac os X Lion Heimdal' gives a worrying number of forum posts about problems. I'm concerned that we could end up spending time debugging 'Lion's Heimdal' which is not what you are paying us for! My inclination for the Mac installer is as far as possible to use what ships with the OS - in this case Heimdal for Lion - but to include anything else in our installer - even if it *may* already be installed to support another program. So for Lion, we should start by using Heimdal, but if we hit problems then, rather than spending a long time tracking down the problem, our first step would be to try whatever we used for Snow Leopard.
41
42 > Josh> Sounds like a plan
43
44 > Pete> Further information in the mailing list at https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind1111&L=MOONSHOT-COMMUNITY&D=0&X=09511F3D9F0F762A88&Y=pete.fotheringham%40codethink.co.uk&P=12159 and https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind1111&L=MOONSHOT-COMMUNITY&D=0&X=09511F3D9F0F762A88&Y=pete.fotheringham%40codethink.co.uk&P=13011
45
46 Q: Pete> One package each for "Snow Leopard" and "Lion", or a single package that works for both? One disk image each for "Snow Leopard" and "Lion", or a single disk image containing both packages?
47
48 Q: Pete> Which files in which directories?
49
50 ####Resolved Issues (I think)
51 Q: Sam> What prevents moonshot gss eap from being built using autotools today? It's my understanding that Luke does this regularly.
52
53 Q: Luke> As Sam said, I'm not exactly sure what you meant about building with autotools. Were you talking about building with the autotools that ship with OS X? (That may not be possible.) Or a script that invokes autoconf with the appropriate arguments to install in the Mac filesystem hierarchy? Because I do all my development on OS X and I haven't had any problems with autotools and Moonshot (no more than one might usually have).
54 > A: Pete> No problems that I know with *building* but I didn't think it could be *installed* in Mac OS using 'configure && make install' as can be done with the Cyrus SASL. I think that would be a useful secondary goal for this piece of work. 
55
56 Q: Pete> Which libraries?
57 >A: Josh> the SASL library is self-contained within cyrus-sasl.
58     
59 > Sam> I think our changes have all been folded upstream at this point.
60     
61 > Sam> the moonshot directory contains the GSS-EAP library
62     
63 > Pete> so the SASL library is cyrus-sasl/libsasl2 and the GSS_EAP library is moonshot/mech_eap
64
65 Q: Sam> Does their SOW involve packaging all the dependencies for an acceptor build or  an initiator only build?
66 > A: Josh> It might be prudent to work towards an initiator-only build, at least initially, as this significantly reduces the size of the problem. The message for Pete is to obtain sufficiently new krb5, the moonshot project from the git repo, and build an initiator from those? I'm pretty sure we don't need a Mac acceptor.
67
68 Q: Luke> The framework directory should surely be Moonshot.framework, not Moonshot, if it indeed is a framework
69 > A: Pete> Agreed. Document changed
70
71 Q: Luke> org.janet should be net.ja (unless janet.org is registered to JANET?)
72 > A: Pete> Document changed
73
74 Q: Luke> Are you planning to install Cyrus SASL as a separate framework?
75 >A: Pete> Yes. Installing Cyrus SASL to /Library/Frameworks/SASL2.framework (as in the existing 'make install'). I have changed the plan to reflect this
76
77 ###Background information
78 ####Installer functionality:
79 There are two parts to the installation:
80
81 1: The installer will install library and header files in /usr/local/lib and /usr/local/include, as for the Linux 'make install'. 
82
83 2: Frameworks: in addition, the installer will install frameworks in sub-directories of /Library/Frameworks on the main drive of the machine. The Cyrus SASL framework will be installed in /Library/Frameworks/SASL2.framework (as in the existing Cyrus SASL 'make install'). The Moonshot GSS EAP framework will be installed in /Library/Frameworks/MoonshotGSS_EAP.framework. The installer will create the .framework directories if they are not already present. The frameworks are wrappers for symlinks to the respective dynamic libraries in /usr/local/lib (libsasl2.dylib and mech_eap.dylib).
84
85 If an installation with a lower version number is present, the new installation will be installed, and the /Versions/Current alias changed to refer to the new installation.
86
87 If an installation with a higher version number is present, the new installation will terminate with a message explaining why.
88
89 If an installation with the same version number as version being installed is present, a message is displayed to the User asking them to confirm whether the existing installation should be overwritten?
90
91 The User will not be able to configure the installation to install only some of the components.
92
93 The exact text to be used in messages displayed to the user will be specified as part of the implementation of the installer.
94
95 The appearance of the installer will not be customized to use special icons and window backgrounds.
96
97 Apple's Developer documentation (Ref. 1) states
98 > public frameworks should be installed at the local level in /Library/Frameworks.
99 Frameworks installed here are available to all users of the machine.
100
101 ####Structure of the Moonshot.framework directory tree.
102 The Moonshot.framework directory will have the following sub-directory structure, allowing future versions to be installed without breaking applications that rely on an earlier version:
103
104     /Headers -> (alias to Versions/Current/include)
105     /Home -> (alias to Versions/Current)
106     /Libraries -> (alias to Versions/Current/lib)
107     /Versions
108       /1.0.1
109       /1.0.2
110       ...
111       /3.1.2
112       /Current --> (alias to most recently installed version e.g /Versions/3.1.2)
113 Each numbered version sub-directory will have the necessary directories from the file system hierarchy e.g.
114
115     /etc
116     /include
117     /man
118     /etc
119     /lib
120     /sbin
121     /share
122       /doc
123       /xml
124     /var
125       /log
126
127 ###Package and Component Properties
128 The Package properties will be 
129
130     Provider Identifier (Organization): net.ja.moonshot
131     Target OS (Minimum Target): Mac OS 10.6 Snow Leopard
132
133 For each component in the package, properties will be
134
135     Destination (To): The appropriate subdirectory of the /Library/Frameworks/Moonshot directory tree
136     Custom destination consent (Allow custom location): False.
137     Package identifier: net.ja.moonshot.xxxx (where xxx identifies the individual library)
138     Package version number: 1 for first release, incremented in future releases
139     Finalization action (Post-install): None
140     Administrator-authentication requirement (Require admin authorization): True
141     Relocatable: False
142     Downgradeable: False
143     No pre- or post-installation scripts are planned (but this may change during implementation)
144     The owner will be root and the group admin. The owner, group, and access permissions of the component files will be determined during implementation.
145 (See Ref.2 for an explanation of these properties)
146 ####Delivered components and files
147 The installer will install the following libraries:
148 #####Moonshot GSS EAP Library
149 This library consists of the following files installed in the following locations:
150 To be completed (See Outstanding questions/issues 3)
151 <table border="1">
152 <tr>
153 <td>/bin</td> <td>list of files in /bin</td>
154 </tr>
155 <tr>
156 <td>/include</td> <td>list of files in /include</td>
157 </tr>
158 <tr>
159 <td>/lib</td><td>list of files in /lib</td>
160 </tr>
161 </table>
162 #####Cyrus SASL Library
163 This library consists of the following files installed in the following locations:
164 To be completed (See Outstanding questions/issues 3)
165
166 <table border="1">
167 <tr>
168 <td>/bin</td> <td>list of files in /bin</td>
169 </tr>
170 <tr>
171 <td>/include</td> <td>list of files in /include</td>
172 </tr>
173 <tr>
174 <td>/lib</td><td>list of files in /lib</td>
175 </tr>
176 </table>
177
178 #####Dependencies
179 The installer will not include any dependencies which are present by default in the installed version Mac OS X.
180
181 For any dependencies which are not present by default in the installed version Mac OS X, the installer will install the needed versions in the /Library/Frameworks/Moonshot directory tree. It will not attempt to locate or use existing installations of these dependencies. This means that if such existing implementations are uninstalled in the future, the Moonshot libraries will not be broken. This decision has a cost in terms of disk space, but is justified because it a: decreases the complexity of the installation and b: protects the installation from potential failure.
182
183 ###References:
184 1. [Mac OS X Developer Library, Framework Programming Guide, Installing Your Framework](https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFrameworks/Tasks/InstallingFrameworks.html#//apple_ref/doc/uid/20002261-BBCCFBJA)
185 2. [Mac OS X Developer Library, PackageMaker User Guide](https://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/PackageMakerUserGuide/)