| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This script signs the Chromoting binaries, builds the Chrome Remote Desktop | 7 # This script signs the Chromoting binaries, builds the Chrome Remote Desktop |
| 8 # installer and then packages it into a .dmg. It requires that Packages be | 8 # installer and then packages it into a .dmg. It requires that Packages be |
| 9 # installed (for 'packagesbuild'). | 9 # installed (for 'packagesbuild'). |
| 10 # Packages: http://s.sudre.free.fr/Software/Packages/about.html | 10 # Packages: http://s.sudre.free.fr/Software/Packages/about.html |
| 11 # | 11 # |
| 12 # usage: sign_and_build.sh output_dir input_dir codesign_keychain codesign_id | 12 # usage: sign_and_build.sh output_dir input_dir codesign_keychain codesign_id |
| 13 # | 13 # |
| 14 # The final disk image (dmg) is placed in |output_dir|. | 14 # The final disk image (dmg) is placed in |output_dir|. |
| 15 | 15 |
| 16 set -e -u | 16 set -e -u |
| 17 | 17 |
| 18 ME="$(basename "${0}")" | 18 ME="$(basename "${0}")" |
| 19 readonly ME | 19 readonly ME |
| 20 | 20 |
| 21 # Choose which installer package to use: | |
| 22 # 'true' to use Iceberg, 'false' to use Packages. | |
| 23 # TODO(garykac) Switch completely to Packages so we can sign for 10.8. | |
| 24 # (crbug.com/127267) | |
| 25 USE_ICEBERG=false | |
| 26 | |
| 27 declare -a g_cleanup_dirs | 21 declare -a g_cleanup_dirs |
| 28 | 22 |
| 29 setup() { | 23 setup() { |
| 30 local input_dir="${1}" | 24 local input_dir="${1}" |
| 31 | 25 |
| 32 # The file that contains the properties for this signing build. | 26 # The file that contains the properties for this signing build. |
| 33 # The file should contain only key=value pairs, one per line. | 27 # The file should contain only key=value pairs, one per line. |
| 34 PROPS_FILENAME="${input_dir}/do_signing.props" | 28 PROPS_FILENAME="${input_dir}/do_signing.props" |
| 35 | 29 |
| 36 # Individually load the properties for this build. Don't 'source' the file | 30 # Individually load the properties for this build. Don't 'source' the file |
| 37 # to guard against code accidentally being added to the props file. | 31 # to guard against code accidentally being added to the props file. |
| 38 HOST_UNINSTALLER_NAME=$(read_property "HOST_UNINSTALLER_NAME") | 32 HOST_UNINSTALLER_NAME=$(read_property "HOST_UNINSTALLER_NAME") |
| 39 HOST_PKG=$(read_property "HOST_PKG") | 33 HOST_PKG=$(read_property "HOST_PKG") |
| 40 DMG_VOLUME_NAME=$(read_property "DMG_VOLUME_NAME") | 34 DMG_VOLUME_NAME=$(read_property "DMG_VOLUME_NAME") |
| 41 DMG_FILE_NAME=$(read_property "DMG_FILE_NAME") | 35 DMG_FILE_NAME=$(read_property "DMG_FILE_NAME") |
| 42 | 36 |
| 43 # Binaries to sign. | 37 # Binaries to sign. |
| 44 ME2ME_HOST='PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app' | 38 ME2ME_HOST='PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app' |
| 45 UNINSTALLER="Applications/${HOST_UNINSTALLER_NAME}.app" | 39 UNINSTALLER="Applications/${HOST_UNINSTALLER_NAME}.app" |
| 46 PREFPANE='PreferencePanes/org.chromium.chromoting.prefPane' | 40 PREFPANE='PreferencePanes/org.chromium.chromoting.prefPane' |
| 47 | 41 |
| 48 # The Chromoting Host installer is a meta-package that consists of 3 | 42 # The Chromoting Host installer is a meta-package that consists of 3 |
| 49 # components: | 43 # components: |
| 50 # * Chromoting Host Service package | 44 # * Chromoting Host Service package |
| 51 # * Chromoting Host Uninstaller package | 45 # * Chromoting Host Uninstaller package |
| 52 # * Keystone package (GoogleSoftwareUpdate - for Official builds only) | 46 # * Keystone package (GoogleSoftwareUpdate - for Official builds only) |
| 53 if $USE_ICEBERG ; then | 47 PKGPROJ_HOST='ChromotingHost.pkgproj' |
| 54 PKGPROJ_HOST='ChromotingHost.packproj' | 48 PKGPROJ_HOST_SERVICE='ChromotingHostService.pkgproj' |
| 55 PKGPROJ_HOST_SERVICE='ChromotingHostService.packproj' | 49 PKGPROJ_HOST_UNINSTALLER='ChromotingHostUninstaller.pkgproj' |
| 56 PKGPROJ_HOST_UNINSTALLER='ChromotingHostUninstaller.packproj' | |
| 57 | 50 |
| 58 # Final (user-visible) mpkg name. | 51 # Final (user-visible) pkg name. |
| 59 PKG_FINAL="${HOST_PKG}.mpkg" | 52 PKG_FINAL="${HOST_PKG}.pkg" |
| 60 else | |
| 61 PKGPROJ_HOST='ChromotingHost.pkgproj' | |
| 62 PKGPROJ_HOST_SERVICE='ChromotingHostService.pkgproj' | |
| 63 PKGPROJ_HOST_UNINSTALLER='ChromotingHostUninstaller.pkgproj' | |
| 64 | |
| 65 # Final (user-visible) pkg name. | |
| 66 PKG_FINAL="${HOST_PKG}.pkg" | |
| 67 fi | |
| 68 | 53 |
| 69 DMG_FILE_NAME="${DMG_FILE_NAME}.dmg" | 54 DMG_FILE_NAME="${DMG_FILE_NAME}.dmg" |
| 70 | 55 |
| 71 # Temp directory for Packages output. | 56 # Temp directory for Packages output. |
| 72 PKG_DIR=build | 57 PKG_DIR=build |
| 73 g_cleanup_dirs+=("${PKG_DIR}") | 58 g_cleanup_dirs+=("${PKG_DIR}") |
| 74 | 59 |
| 75 # Temp directories for building the dmg. | 60 # Temp directories for building the dmg. |
| 76 DMG_TEMP_DIR="$(mktemp -d -t "${ME}"-dmg)" | 61 DMG_TEMP_DIR="$(mktemp -d -t "${ME}"-dmg)" |
| 77 g_cleanup_dirs+=("${DMG_TEMP_DIR}") | 62 g_cleanup_dirs+=("${DMG_TEMP_DIR}") |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 136 |
| 152 local package="${input_dir}/${PKG_DIR}/${PKG_FINAL}" | 137 local package="${input_dir}/${PKG_DIR}/${PKG_FINAL}" |
| 153 productsign --sign "${id}" --keychain "${keychain}" \ | 138 productsign --sign "${id}" --keychain "${keychain}" \ |
| 154 "${package}" "${package}.signed" | 139 "${package}" "${package}.signed" |
| 155 mv -f "${package}.signed" "${package}" | 140 mv -f "${package}.signed" "${package}" |
| 156 } | 141 } |
| 157 | 142 |
| 158 build_package() { | 143 build_package() { |
| 159 local pkg="${1}" | 144 local pkg="${1}" |
| 160 echo "Building .pkg from ${pkg}" | 145 echo "Building .pkg from ${pkg}" |
| 161 if $USE_ICEBERG ; then | 146 packagesbuild -v "${pkg}" |
| 162 freeze "${pkg}" | |
| 163 else | |
| 164 packagesbuild -v "${pkg}" | |
| 165 fi | |
| 166 } | 147 } |
| 167 | 148 |
| 168 build_packages() { | 149 build_packages() { |
| 169 local input_dir="${1}" | 150 local input_dir="${1}" |
| 170 build_package "${input_dir}/${PKGPROJ_HOST_SERVICE}" | 151 build_package "${input_dir}/${PKGPROJ_HOST_SERVICE}" |
| 171 build_package "${input_dir}/${PKGPROJ_HOST_UNINSTALLER}" | 152 build_package "${input_dir}/${PKGPROJ_HOST_UNINSTALLER}" |
| 172 build_package "${input_dir}/${PKGPROJ_HOST}" | 153 build_package "${input_dir}/${PKGPROJ_HOST}" |
| 173 } | 154 } |
| 174 | 155 |
| 175 build_dmg() { | 156 build_dmg() { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 cleanup | 208 cleanup |
| 228 } | 209 } |
| 229 | 210 |
| 230 if [[ ${#} < 4 ]]; then | 211 if [[ ${#} < 4 ]]; then |
| 231 usage | 212 usage |
| 232 exit 1 | 213 exit 1 |
| 233 fi | 214 fi |
| 234 | 215 |
| 235 main "${@}" | 216 main "${@}" |
| 236 exit ${?} | 217 exit ${?} |
| OLD | NEW |