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