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