5 # Copyright (c) 2012, JANET(UK)
7 cd ~/moonshot/mac-client-installer
9 echo " * Put the jhbuild config file in the correct place"
10 cp ./.jhbuildrc-custom ~/
11 echo " * Remove old files and directories"
19 echo " * Bootstrap jhbuild"
20 jhbuild bootstrap --ignore-system
24 echo " * build moonshot in jhbuild shell"
27 jhbuild run ./autogen.sh
28 jhbuild run ./configure --enable-acceptor=no --with-krb5=$HOME//moonshot/mac-client-installer/krb/usr/local
29 jhbuild run make && make install DESTDIR=$HOME/moonshot/mac-client-installer/moonshot
30 cd ~/moonshot/mac-client-installer
34 echo " * The first time this script is run the following errors may be generated: "
35 echo " * ** Error during phase build of cyrus-sasl: ########## Error running make *** [39/41]"
36 echo " * choose [4] Start shell"
37 echo " $ ./configure --prefix=/usr/local --with-gss_impl=mit"
39 echo " * choose [1] Rerun phase build"
41 echo " * build cyrus-sasl using jhbuild"
42 jhbuild build cyrus-sasl
45 echo " * Fix up the cyrus-sasl links"
47 cd sasl/usr/lib && ln -fs ../local/lib/sasl2
48 cd ~/moonshot/mac-client-installer
52 echo " * The first time this script is run the following errors may be generated: "
53 echo " * *** Error during phase configure of gtk-mac-bundler: ########## Error running ./configure --prefix /Users/pete/gtk/inst --libdir '/Users/pete/gtk/inst/lib' *** "
54 echo " * choose [2] Ignore error and continue"
56 echo " * *** Error during phase build of perl-xml-parser: ########## Error running make LD_RUN_PATH= *** [6/37]"
57 echo " * choose [4] Start shell"
58 echo " * $ git apply ~/moonshot/mac-client-installer/0001-Remove-arch-ppc-flags.patch "
61 echo " * choose [2] Ignore error and continue"
63 echo " * *** Error during phase configure of gtk-mac-bundler: ########## Error running ./configure --prefix /Users/pete/gtk/inst --libdir '/Users/pete/gtk/inst/lib' *** [37/38]"
64 echo " * choose [2] Ignore error and continue"
66 echo " * Now we can build moonshot-ui"
67 jhbuild build moonshot-ui
71 echo " * Make moonshot-ui app bundle in jhbuild shell"
72 cd ~/gtk/source/moonshot-ui/ && jhbuild run make app-bundle
75 echo " * Make the libmoonshot files in the correct directory for the installer"
76 jhbuild run ./configure && make && make install DESTDIR=$HOME/moonshot/mac-client-installer/moonshot-ui
77 cd ~/moonshot/mac-client-installer
81 echo " * Ensure the permissions are correct for the files to be installed"
82 sudo chown -R root:admin sasl krb moonshot moonshot-ui
83 sudo chmod -R g+w sasl krb moonshot moonshot-ui
86 echo " * Put the DBus Property list in the moonshot-ui tree for the installer with the correct permissions"
87 cp org.freedesktop.dbus-session.plist moonshot-ui/
88 sudo chown -R root:admin moonshot-ui/org.freedesktop.dbus-session.plist
90 echo " * Create the installer package"
91 /Developer/usr/bin/packagemaker --doc Moonshot\ Client\ Software.pmdoc \
92 --version 0.1 --filter "/.DS_Store" --root-volume-only \
93 --domain system --verbose --no-relocate -l "/" --target 10.5 \
94 --id ja.net.moonshotClientSoftware --out Moonshot\ Client\ Software.pkg
96 echo " * Create and mount a disk image"
97 hdiutil create -size 20m -fs HFS+ -volname "Moonshot Client Software" temp.dmg
98 hdiutil attach temp.dmg
100 echo " * Copy the package and the READMEs"
101 cp -R Moonshot\ Client\ Software.pkg /Volumes/Moonshot\ Client\ Software/
102 # TODO we need some readmes for the Mac instalatiom
103 #cp -R resources/* /Volumes/Moonshot\ Client\ Software/
105 echo " * Get rid of hidden files and folders that we don't need"
106 sudo rm -rf /Volumes/Moonshot\ Client\ Software/.fseventsd/
107 sudo rm -rf /Volumes/Moonshot\ Client\ Software/.Trashes/
108 sudo find /Volumes/Moonshot\ Client\ Software -name '.*' -type f -delete
110 echo " * Unmount the image"
111 hdiutil detach /Volumes/Moonshot\ Client\ Software
113 echo " * Convert the disk image to read-only"
114 hdiutil convert temp.dmg -format UDZO -o moonshotclientsoftware.dmg