OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 # Makes O3D disk image file. |
| 3 # Syntax: make_disk_image version_string |
| 4 # |
| 5 # Copyright 2009, Google Inc. |
| 6 # All rights reserved. |
| 7 # |
| 8 # Redistribution and use in source and binary forms, with or without |
| 9 # modification, are permitted provided that the following conditions are |
| 10 # met: |
| 11 # |
| 12 # * Redistributions of source code must retain the above copyright |
| 13 # notice, this list of conditions and the following disclaimer. |
| 14 # * Redistributions in binary form must reproduce the above |
| 15 # copyright notice, this list of conditions and the following disclaimer |
| 16 # in the documentation and/or other materials provided with the |
| 17 # distribution. |
| 18 # * Neither the name of Google Inc. nor the names of its |
| 19 # contributors may be used to endorse or promote products derived from |
| 20 # this software without specific prior written permission. |
| 21 # |
| 22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 23 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 24 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 25 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 26 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 27 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 28 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 29 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 30 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 31 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 32 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 33 |
| 34 # Make disk image by copying all the bits we need to a new directory and then |
| 35 # calling hdiutil to make a dmg of it. |
| 36 # Obviously, this should run after the script that makes the installer. |
| 37 |
| 38 O3D_INTERNAL_DIR="${PROJECT_DIR}/../../../o3d-internal" |
| 39 # If the o3d-internal depot is present, make disk image. |
| 40 if [ -d "${O3D_INTERNAL_DIR}" ] |
| 41 then |
| 42 MAC_INSTALLER_DIR="${O3D_INTERNAL_DIR}/mac_installer" |
| 43 if [ -d "${MAC_INSTALLER_DIR}" ] |
| 44 then |
| 45 # Make disk image dir |
| 46 IMG_DIR="${BUILT_PRODUCTS_DIR}/DMG_SRC" |
| 47 # Delete any existing directory so we can start from scratch. |
| 48 rm -rf "${IMG_DIR}" |
| 49 mkdir "${IMG_DIR}" |
| 50 |
| 51 if [ -d "${IMG_DIR}" ] |
| 52 then |
| 53 # Delete existing dmg if present. |
| 54 rm -f "${BUILT_PRODUCTS_DIR}/o3d.dmg" |
| 55 |
| 56 # Get keystone auto update script. |
| 57 cp "${MAC_INSTALLER_DIR}/.keystone_install" "${IMG_DIR}" |
| 58 |
| 59 # Get O3D install package. |
| 60 cp -R "${BUILT_PRODUCTS_DIR}/O3D.mpkg" "${IMG_DIR}" |
| 61 |
| 62 # Make disk image from the folder we just created. |
| 63 hdiutil create -srcfolder "${IMG_DIR}" \ |
| 64 -size 30mb -ov -fs HFS+ -imagekey zlib-level=9 \ |
| 65 -volname "O3D ${1}" \ |
| 66 "${BUILT_PRODUCTS_DIR}/o3d.dmg" |
| 67 |
| 68 # Delete source folder now we are done. |
| 69 rm -rf "${IMG_DIR}" |
| 70 |
| 71 echo "Mac disk image built" |
| 72 else |
| 73 echo Could not create dir "${IMG_DIR}". |
| 74 fi |
| 75 else |
| 76 echo Mac installer directory not found. |
| 77 fi |
| 78 else |
| 79 echo External build - not making disk image. |
| 80 fi |
| 81 |
OLD | NEW |