(no commit message)
[devwiki.git] / building_client_software_for_mac_os.mdwn
1 ###Introduction
2
3 This page contains notes on how to build and install the software necessary to run Moonshot clients on a computer running Max OS X 10.6 Snow Leopard and 10.7 Lion.
4
5 It also contains instructions for creating an installer package allowing the Moonshot software to be installed on other machines running Mac OS X.
6
7 These notes are also in the file mac-client-installer/README.MacOsBuildInstructions
8
9 There are three components that need to be built and installed:
10 1: the Cyrus SASL2 library, along with the SASL GS2 Library which implements the GS2 GSS-API->SASL bridge mechanism.
11 2: the Moonshot GSS EAP library, implements the EAP mechanism for use by the GSS API. This library depends on having a recent version of Kerberos. Mac OS X ships with Kerberos 5 release 1.7-prerelease which is not recent enough. So. for the installer at least, we will get and build the latest stable release (1.9.2) from [MIT](from http://web.mit.edu/kerberos/dist/index.html).
12 3: the Moonshot Identity Selector/Manager software which... 
13 ToDo: Complete this section
14
15
16 ###Getting the Moonshot source code 
17
18 Follow the instructions at http://www.project-moonshot.org/developers/repository, cloning  the repo in $HOME
19
20 Working in $HOME/moonshot/mac-client-installer
21
22 ###Building the Cyrus SASL2 library
23
24     $ cd $HOME/moonshot/cyrus_sasl
25     $ ./autogen.sh 
26
27 You will see the following message
28
29     configure.in:14 error: possibly undefined macro: AC_DEFINE
30     If this token and others are legitimate, please use m4_pattern_allow.
31     See the Autoconf documentation
32
33     $ ./configure
34     $ make
35
36 To install to /usr/local in your build machine
37
38     $ sudo make install
39
40 Create the link from /usr/lib/sasl2 (where the library looks for the plugins)->/usr/local/lib/sasl2 (where the plugins will be installed)
41
42     $ cd sasl/usr/lib
43     $ ln -fs   ../local/lib/sasl2 
44
45 Or, if you are making the installer
46
47     $ make install DESTDIR=$HOME/moonshot/mac-client-installer/sasl
48
49 Create the link from /usr/lib/sasl2 (where the library looks for the plugins)->/usr/local/lib/sasl2 (where the plugins will be installed)
50
51     $ mkdir sasl/usr/lib
52     $ cd sasl/usr/lib
53     $ ln -fs   ../local/lib/sasl2 
54     $ cd ../../..
55     $ cd ~/installerbuild
56
57 The files and directories that are installed are as listed in README.saslInstalledFiles
58
59 ###Building the downloaded Kerberos
60
61 Unpack the file to $HOME/krbbuild
62
63     $ cd $HOME/krbbuild/krb5-1.9.2-signed/krb5-1.9.2/src
64     $ ./configure
65     $ make
66
67 To install to /usr/local in your build machine
68
69     $ sudo make install
70
71 Or, if you are making the installer
72     $ make install DESTDIR=$HOME/moonshot/mac-client-installer/krb
73
74 ###Building the Moonshot GSS EAP library
75
76     $ cd $HOME/moonshot/moonshot
77     $ ./autogen.sh
78     $ ./configure --enable-acceptor=no 
79
80 You will see the following warnings
81
82     configure: WARNING:
83     ----------------------------------------------------------------------
84     Cannot find OpenSAML libraries, building without OpenSAML support.
85     Please install OpenSAML or specify installation directory with
86     --with-opensaml=(dir).
87     ----------------------------------------------------------------------
88
89     configure: WARNING:
90     ----------------------------------------------------------------------
91     Cannot find Shibboleth resolver libraries, building without
92     Shibboleth support.
93     Please install Shibboleth or specify installation directory with
94       --with-shibresolver=(dir).
95     ----------------------------------------------------------------------
96
97     $ make
98     $ cd mech_eap
99     $ sudo make install
100     $ libtool --finish /usr/local/lib/gss
101
102 Or, if you are making the installer
103
104     $ ./configure --enable-acceptor=no --with-krb5=$HOME/moonshot/mac-client-installer/krb/usr/local
105     $ make
106
107 We only need to install the mech_eap library
108
109     $ cd mech_eap
110     $ make install DESTDIR=$HOME/moonshot/mac-client-installer/krb
111
112 The files and directories that are installed are as listed in README.KrbInstalledFiles
113
114 ###Building the Moonshot Identity Selector/Manager software
115 ToDo: Complete this section
116
117 ###Make the install package
118 Ideally we would divide the installer into sub-packages (sasl and krb) within a single meta package. However this seems to be possible only from the packagemaker GUI: there are a number of problems with doing this from the packagemaker command line. We are therefore building a single package, with sasl and krb as choice items within the package.
119
120 Ensure the permissions are correct for the files to be installed
121
122     $ sudo chown -R root:admin krb sasl
123     $ sudo chmod -R g+w krb sasl
124
125 Build the package
126
127     $ /Developer/usr/bin/packagemaker --doc Moonshot\ Client\ Software.pmdoc \
128       --version 0.1 --filter "/.DS_Store" --resources ./resources/ --root-volume-only\
129       --domain system --verbose --no-relocate -l "/" --target 10.5 \
130       --id ja.net.moonshotClientSoftware  --out Moonshot\ Client\ Software.pkg
131
132 Instructions in DevWiki at http://www.project-moonshot.org/devwiki//building_client_software_for_mac_os
133
134 ###Making the Disk Image
135 Create and mount the image - 2MB will be enough for now
136
137     $ hdiutil create -size 2m -fs HFS+ -volname "Moonshot Client Software" temp.dmg
138     $ hdiutil attach temp.dmg
139
140 Copy the package and the READMEs
141     $ cp Moonshot\ Client\ Software.pkg /Volumes/Moonshot\ Client\ Software/
142     $ cp resources/*  /Volumes/Moonshot\ Client\ Software/
143
144 Get rid of hidden files and folders that we don't need
145
146     $ sudo rm -rf /Volumes/Moonshot\ Client\ Software/.fseventsd/
147     $ sudo rm -rf /Volumes/Moonshot\ Client\ Software/.Trashes/
148     $ sudo find /Volumes/Moonshot\ Client\ Software -name '.*' -type f -delete
149
150 Unmount the image
151
152     $ hdiutil detach /Volumes/Moonshot\ Client\ Software
153
154 Convert the disk image to read-only
155
156     $ hdiutil convert temp.dmg -format UDZO -o moonshotclientsoftware.dmg
157     $ rm temp.dmg
158
159 The compressed disk image containing the installer package and the READMEs is now in file moonshotclientsoftware.dmg
160