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