| 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 Iceberg be | 8 # installer and then packages it into a .dmg. It requires that Iceberg be |
| 9 # installed (for 'freeze'). | 9 # installed (for 'freeze'). |
| 10 # | 10 # |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 # 'true' to use Iceberg, 'false' to use Packages. | 21 # 'true' to use Iceberg, 'false' to use Packages. |
| 22 # TODO(garykac) Switch completely to Packages so we can sign for 10.8. | 22 # TODO(garykac) Switch completely to Packages so we can sign for 10.8. |
| 23 # (crbug.com/127267) | 23 # (crbug.com/127267) |
| 24 USE_ICEBERG=false | 24 USE_ICEBERG=false |
| 25 | 25 |
| 26 declare -a g_cleanup_dirs | 26 declare -a g_cleanup_dirs |
| 27 | 27 |
| 28 # Binaries to sign. | 28 # Binaries to sign. |
| 29 ME2ME_HOST='PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app' | 29 ME2ME_HOST='PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app' |
| 30 UNINSTALLER='Applications/@@HOST_UNINSTALLER_NAME@@.app' | 30 UNINSTALLER='Applications/@@HOST_UNINSTALLER_NAME@@.app' |
| 31 PREFPANE='PreferencePanes/org.chromium.chromoting.prefPane' |
| 31 | 32 |
| 32 # The Chromoting Host installer is a meta-package that consists of 3 | 33 # The Chromoting Host installer is a meta-package that consists of 3 |
| 33 # components: | 34 # components: |
| 34 # * Chromoting Host Service package | 35 # * Chromoting Host Service package |
| 35 # * Chromoting Host Uninstaller package | 36 # * Chromoting Host Uninstaller package |
| 36 # * Keystone package (GoogleSoftwareUpdate - for Official builds only) | 37 # * Keystone package (GoogleSoftwareUpdate - for Official builds only) |
| 37 if $USE_ICEBERG ; then | 38 if $USE_ICEBERG ; then |
| 38 PKGPROJ_HOST='ChromotingHost.packproj' | 39 PKGPROJ_HOST='ChromotingHost.packproj' |
| 39 PKGPROJ_HOST_SERVICE='ChromotingHostService.packproj' | 40 PKGPROJ_HOST_SERVICE='ChromotingHostService.packproj' |
| 40 PKGPROJ_HOST_UNINSTALLER='ChromotingHostUninstaller.packproj' | 41 PKGPROJ_HOST_UNINSTALLER='ChromotingHostUninstaller.packproj' |
| 42 |
| 43 # Final (user-visible) mpkg name. |
| 44 PKG_FINAL='@@HOST_PKG@@.mpkg' |
| 41 else | 45 else |
| 42 PKGPROJ_HOST='ChromotingHost.pkgproj' | 46 PKGPROJ_HOST='ChromotingHost.pkgproj' |
| 43 PKGPROJ_HOST_SERVICE='ChromotingHostService.pkgproj' | 47 PKGPROJ_HOST_SERVICE='ChromotingHostService.pkgproj' |
| 44 PKGPROJ_HOST_UNINSTALLER='ChromotingHostUninstaller.pkgproj' | 48 PKGPROJ_HOST_UNINSTALLER='ChromotingHostUninstaller.pkgproj' |
| 49 |
| 50 # Final (user-visible) pkg name. |
| 51 PKG_FINAL='@@HOST_PKG@@.pkg' |
| 45 fi | 52 fi |
| 46 | 53 |
| 47 # Final (user-visible) mpkg name. | |
| 48 PKG_FINAL='@@HOST_PKG@@.mpkg' | |
| 49 | |
| 50 DMG_VOLUME_NAME='@@DMG_VOLUME_NAME@@' | 54 DMG_VOLUME_NAME='@@DMG_VOLUME_NAME@@' |
| 51 DMG_FILE_NAME='@@DMG_FILE_NAME@@.dmg' | 55 DMG_FILE_NAME='@@DMG_FILE_NAME@@.dmg' |
| 52 | 56 |
| 53 # Temp directory for Iceberg output. | 57 # Temp directory for Iceberg output. |
| 54 PKG_DIR=build | 58 PKG_DIR=build |
| 55 g_cleanup_dirs+=("${PKG_DIR}") | 59 g_cleanup_dirs+=("${PKG_DIR}") |
| 56 | 60 |
| 57 # Temp directories for building the dmg. | 61 # Temp directories for building the dmg. |
| 58 DMG_TEMP_DIR="$(mktemp -d -t "${ME}"-dmg)" | 62 DMG_TEMP_DIR="$(mktemp -d -t "${ME}"-dmg)" |
| 59 g_cleanup_dirs+=("${DMG_TEMP_DIR}") | 63 g_cleanup_dirs+=("${DMG_TEMP_DIR}") |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 codesign -v "${name}" | 112 codesign -v "${name}" |
| 109 } | 113 } |
| 110 | 114 |
| 111 sign_binaries() { | 115 sign_binaries() { |
| 112 local input_dir="${1}" | 116 local input_dir="${1}" |
| 113 local keychain="${2}" | 117 local keychain="${2}" |
| 114 local id="${3}" | 118 local id="${3}" |
| 115 | 119 |
| 116 sign "${input_dir}/${ME2ME_HOST}" "${keychain}" "${id}" | 120 sign "${input_dir}/${ME2ME_HOST}" "${keychain}" "${id}" |
| 117 sign "${input_dir}/${UNINSTALLER}" "${keychain}" "${id}" | 121 sign "${input_dir}/${UNINSTALLER}" "${keychain}" "${id}" |
| 122 sign "${input_dir}/${PREFPANE}" "${keychain}" "${id}" |
| 123 } |
| 124 |
| 125 sign_installer() { |
| 126 local input_dir="${1}" |
| 127 local keychain="${2}" |
| 128 local id="${3}" |
| 129 |
| 130 sign "${input_dir}/${PKG_DIR}/${PKG_FINAL}" "${keychain}" "${id}" |
| 118 } | 131 } |
| 119 | 132 |
| 120 build_package() { | 133 build_package() { |
| 121 local pkg="${1}" | 134 local pkg="${1}" |
| 122 echo "Building .pkg from ${pkg}" | 135 echo "Building .pkg from ${pkg}" |
| 123 if $USE_ICEBERG ; then | 136 if $USE_ICEBERG ; then |
| 124 freeze "${pkg}" | 137 freeze "${pkg}" |
| 125 else | 138 else |
| 126 packagesbuild -v "${pkg}" | 139 packagesbuild -v "${pkg}" |
| 127 fi | 140 fi |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 main() { | 180 main() { |
| 168 local output_dir="$(shell_safe_path "${1}")" | 181 local output_dir="$(shell_safe_path "${1}")" |
| 169 local input_dir="$(shell_safe_path "${2}")" | 182 local input_dir="$(shell_safe_path "${2}")" |
| 170 local codesign_keychain="$(shell_safe_path "${3}")" | 183 local codesign_keychain="$(shell_safe_path "${3}")" |
| 171 local codesign_id="${4}" | 184 local codesign_id="${4}" |
| 172 | 185 |
| 173 verify_clean_dir "${output_dir}" | 186 verify_clean_dir "${output_dir}" |
| 174 | 187 |
| 175 sign_binaries "${input_dir}" "${codesign_keychain}" "${codesign_id}" | 188 sign_binaries "${input_dir}" "${codesign_keychain}" "${codesign_id}" |
| 176 build_packages "${input_dir}" | 189 build_packages "${input_dir}" |
| 177 # TODO(garykac): Sign final .mpkg once we've switched to Packages. | 190 sign_installer "${input_dir}" "${codesign_keychain}" "${codesign_id}" |
| 178 # (crbug.com/127267) | |
| 179 build_dmg "${input_dir}" "${output_dir}" | 191 build_dmg "${input_dir}" "${output_dir}" |
| 180 | 192 |
| 181 cleanup | 193 cleanup |
| 182 } | 194 } |
| 183 | 195 |
| 184 if [[ ${#} -ne 4 ]]; then | 196 if [[ ${#} -ne 4 ]]; then |
| 185 usage | 197 usage |
| 186 exit 1 | 198 exit 1 |
| 187 fi | 199 fi |
| 188 | 200 |
| 189 main "${@}" | 201 main "${@}" |
| 190 exit ${?} | 202 exit ${?} |
| OLD | NEW |