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