Merge remote-tracking branch 'origin/master'
[moonshot.git] / mac-client-installer / build-installer.sh
1 #!/bin/sh
2
3 #  build-installer.sh
4 #  
5 #
6 #  Created by pete on 02/01/2012.
7 #  Copyright (c) 2011, JANET(UK)
8
9 cp ./.jhbuildrc-custom ~/
10
11 # build moonshot in jhbuild shell
12 cd ../moonshot && jhbuild run ./configure --enable-acceptor=no --with-krb5=$HOME/gtk/inst && make && make install DESTDIR=$HOME/moonshot/mac-client-installer/moonshot
13
14 # build cyrus-sasl using jhbuild
15 jhbuild build cyrus-sasl
16
17 # build moonshot-ui using jhbuild
18 jhbuild build moonshot-ui
19
20 # make moonshot-ui app bundle in jhbuild shell
21 cd ~/gtk/source/moonshot-ui/ &&  jhbuild run make app-bundle 
22 pwd
23
24 cd ~/moonshot/mac-client-installer
25 pwd
26 # fix up the cyrus-sasl links
27 mkdir -p sasl/usr/lib
28 cd sasl/usr/lib && ln -fs   ../local/lib/sasl2 
29 cd ~/moonshot/mac-client-installer
30 pwd
31
32 # Ensure the permissions are correct for the files to be installed
33 sudo chown -R root:admin sasl krb moonshot moonshot-ui
34 sudo chmod -R g+w sasl krb moonshot moonshot-ui
35
36 # create the installer package
37 /Developer/usr/bin/packagemaker --doc Moonshot\ Client\ Software.pmdoc \
38 --version 0.1 --filter "/.DS_Store"  --root-volume-only \
39 --domain system --verbose --no-relocate -l "/" --target 10.5 \
40 --id ja.net.moonshotClientSoftware  --out Moonshot\ Client\ Software.pkg
41
42 # create and mount a disk image
43 hdiutil create -size 20m -fs HFS+ -volname "Moonshot Client Software" temp.dmg 
44 hdiutil attach temp.dmg 
45
46 # Copy the package and the READMEs
47 cp -R Moonshot\ Client\ Software.pkg /Volumes/Moonshot\ Client\ Software/ 
48 # TODO we need some readmes for the Mac instalatiom
49 #cp -R resources/*  /Volumes/Moonshot\ Client\ Software/ 
50
51 # Get rid of hidden files and folders that we don't need
52 sudo rm -rf /Volumes/Moonshot\ Client\ Software/.fseventsd/ 
53 sudo rm -rf /Volumes/Moonshot\ Client\ Software/.Trashes/ 
54 sudo find /Volumes/Moonshot\ Client\ Software -name '.*' -type f -delete
55
56 # Unmount the image
57 hdiutil detach /Volumes/Moonshot\ Client\ Software 
58
59 # Convert the disk image to read-only
60 hdiutil convert temp.dmg -format UDZO -o moonshotclientsoftware.dmg 
61 rm temp.dmg
62