Builds OK - instructions complete
[moonshot.git] / mac-client-installer / README.MacOsBuildInstructions
1 ### Building Mac OS Installer using jhbuild
2
3 ## Preparation
4
5 # install jhbuild
6 Install jhbuild, which Creates working folder ~/gtk
7
8 # bootstrap jhbuild
9 copy file moonshot/mac-client-installer/.jhbuildrc-custom to $HOME
10 then
11 $ jhbuild bootstrap --ignore-system
12
13 # Kerberos 
14 Need MIT Kerberos 1.9.2 installed 
15 - in ~/gtk/inst - in the Krb5 src directory 
16 $ export CFLAGS="-arch i386"
17 $ ./configure --prefix=/Users/pete/gtk/inst/
18 $ make
19 $ make install
20
21 # Building the moonshot SW
22 $ jhbuild build  meta-moonshot-mac-client
23 Will cause the following errors
24
25 *** Error during phase build of perl-xml-parser: ########## Error running make LD_RUN_PATH= *** [6/37]
26 choose  [4] Start shell
27 $ git apply ~/moonshot/mac-client-installer/0001-Remove-arch-ppc-flags.patch 
28 $ make
29 $ exit 
30 choose [2] Ignore error and continue
31
32 make: *** No targets specified and no makefile found.  Stop.
33 *** Error during phase build of cyrus-sasl: ########## Error running make   *** [39/41]
34 choose  [4] Start shell
35 4
36 $ ./configure --prefix /Users/pete/gtk/inst --libdir '/Users/pete/gtk/inst/lib' --with-gss_impl=mit 
37 $ exit 
38 choose [1] Rerun phase build
39
40 *** Error during phase configure of moonshot: ########## Error running ./autogen.sh --prefix /Users/pete/gtk/inst --libdir '/Users/pete/gtk/inst/lib' --enable-acceptor=no --with-krb5=$PREFIX/usr/local --enable-acceptor=no  *** [40/41]
41 choose [4] Start shell
42 $ git apply ~/moonshot/mac-client-installer/0001-Move-moonshot-files-up.patch 
43 $ cp -R moonshot/libeap .
44 $ ./autogen.sh --prefix /Users/pete/gtk/inst --libdir '/Users/pete/gtk/inst/lib' --enable-acceptor=no 
45 $ 4
46
47 $ exit
48 choose  [1] Rerun phase build
49
50
51 ### Old instructions
52
53
54 ###Introduction
55
56 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.
57
58 It also contains instructions for creating an installer package allowing the Moonshot software to be installed on other machines running Mac OS X.
59
60 These notes are also in the file mac-client-installer/README.MacOsBuildInstructions
61
62 There are three components that need to be built and installed:
63
64 1: the Cyrus SASL2 library, along with the SASL GS2 Library which implements the GS2 GSS-API->SASL bridge mechanism.
65
66 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).
67
68 3: the Moonshot Identity Selector/Manager software which... 
69 ToDo: Complete this section when the client software is ported to Mac OS
70
71
72 ###Getting the Moonshot source code 
73
74 Follow the instructions at http://www.project-moonshot.org/developers/repository, cloning  the repo in $HOME
75
76 Working in $HOME/moonshot/mac-client-installer
77
78 ###Building the Cyrus SASL2 library
79
80     $ cd $HOME/moonshot/cyrus_sasl
81     $ ./autogen.sh 
82
83 You will see the following message
84
85     configure.in:14 error: possibly undefined macro: AC_DEFINE
86     If this token and others are legitimate, please use m4_pattern_allow.
87     See the Autoconf documentation
88
89     $ ./configure --with-gss_impl=mit
90     $ make
91
92 To install to /usr/local in your build machine
93
94     $ sudo make install
95
96 Create the link from /usr/lib/sasl2 (where the library looks for the plugins)->/usr/local/lib/sasl2 (where the plugins will be installed)
97
98     $ cd sasl/usr/lib
99     $ ln -fs   ../local/lib/sasl2 
100
101 Or, if you are making the installer
102
103     $ make install DESTDIR=$HOME/moonshot/mac-client-installer/sasl
104
105 Create the link from /usr/lib/sasl2 (where the library looks for the plugins)->/usr/local/lib/sasl2 (where the plugins will be installed)
106
107     $ mkdir sasl/usr/lib
108     $ cd sasl/usr/lib
109     $ ln -fs   ../local/lib/sasl2 
110     $ cd ../../..
111     $ cd ~/installerbuild
112
113 The files and directories that are installed are as listed in README.saslInstalledFiles
114
115 ###Building the downloaded Kerberos
116
117 Unpack the file to $HOME/krbbuild
118
119     $ cd $HOME/krbbuild/krb5-1.9.2-signed/krb5-1.9.2/src
120     $ ./configure
121     $ make
122
123 To install to /usr/local in your build machine
124
125     $ sudo make install
126
127 Or, if you are making the installer
128     $ make install DESTDIR=$HOME/moonshot/mac-client-installer/krb
129
130 ###Building the Moonshot GSS EAP library
131
132     $ cd $HOME/moonshot/moonshot
133     $ ./autogen.sh
134     $ ./configure --enable-acceptor=no 
135
136 You will see the following warnings
137
138     configure: WARNING:
139     ----------------------------------------------------------------------
140     Cannot find OpenSAML libraries, building without OpenSAML support.
141     Please install OpenSAML or specify installation directory with
142     --with-opensaml=(dir).
143     ----------------------------------------------------------------------
144
145     configure: WARNING:
146     ----------------------------------------------------------------------
147     Cannot find Shibboleth resolver libraries, building without
148     Shibboleth support.
149     Please install Shibboleth or specify installation directory with
150       --with-shibresolver=(dir).
151     ----------------------------------------------------------------------
152
153     $ make
154     $ cd mech_eap
155     $ sudo make install
156     $ libtool --finish /usr/local/lib/gss
157
158 Or, if you are making the installer
159
160     $ ./configure --enable-acceptor=no --with-krb5=$HOME/moonshot/mac-client-installer/krb/usr/local
161     $ make
162
163 We only need to install the mech_eap library
164
165     $ cd mech_eap
166     $ make install DESTDIR=$HOME/moonshot/mac-client-installer/krb
167
168 The files and directories that are installed are as listed in README.KrbInstalledFiles
169
170 ###Building the Moonshot Identity Selector/Manager software
171 ToDo: Complete this section when the client software is ported to Mac OS
172
173 ###Make the install package
174 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.
175
176 Ensure the permissions are correct for the files to be installed
177
178     $ sudo chown -R root:admin krb sasl
179     $ sudo chmod -R g+w krb sasl
180
181 Build the package
182
183     $ /Developer/usr/bin/packagemaker --doc Moonshot\ Client\ Software.pmdoc \
184       --version 0.1 --filter "/.DS_Store" --resources ./resources/ --root-volume-only\
185       --domain system --verbose --no-relocate -l "/" --target 10.5 \
186       --id ja.net.moonshotClientSoftware  --out Moonshot\ Client\ Software.pkg
187
188 Instructions in DevWiki at http://www.project-moonshot.org/devwiki//building_client_software_for_mac_os
189
190 ###Making the Disk Image
191 Create and mount the image - 2MB will be enough for now
192
193     $ hdiutil create -size 2m -fs HFS+ -volname "Moonshot Client Software" temp.dmg
194     $ hdiutil attach temp.dmg
195
196 Copy the package and the READMEs
197     $ cp Moonshot\ Client\ Software.pkg /Volumes/Moonshot\ Client\ Software/
198     $ cp resources/*  /Volumes/Moonshot\ Client\ Software/
199
200 Get rid of hidden files and folders that we don't need
201
202     $ sudo rm -rf /Volumes/Moonshot\ Client\ Software/.fseventsd/
203     $ sudo rm -rf /Volumes/Moonshot\ Client\ Software/.Trashes/
204     $ sudo find /Volumes/Moonshot\ Client\ Software -name '.*' -type f -delete
205
206 Unmount the image
207
208     $ hdiutil detach /Volumes/Moonshot\ Client\ Software
209
210 Convert the disk image to read-only
211
212     $ hdiutil convert temp.dmg -format UDZO -o moonshotclientsoftware.dmg
213     $ rm temp.dmg
214
215 The compressed disk image containing the installer package and the READMEs is now in file *moonshotclientsoftware.dmg*
216