summaryrefslogtreecommitdiffstats
path: root/build/mac/build_app_dmg
blob: 2108959d76f5c30e264ceae946a8dbb5063b5f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh

# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Normally you don't want to build a dmg out of a debug build.
if [ "${CONFIGURATION}" != "Release" ] ; then
  echo "warning: building dmg in non-release mode" >&2
fi

# Make sure we got the branding passed to us
if [ $# -ne 1 ]; then
  echo "error: missing branding as an argument" >&2
  exit 1
fi

# fail on anything from here out
set -e

TOP="${SRCROOT}/.."
PKG_DMG="${TOP}/build/mac/pkg-dmg"

BUILD_BRANDING=$1
if [ "${BUILD_BRANDING}" == "Chromium" ]; then
  APP_NAME="Chromium"
  DMG_NAME="Chromium.dmg"
elif [ "${BUILD_BRANDING}" == "Chrome" ]; then
  APP_NAME="Google Chrome"
  DMG_NAME="GoogleChrome.dmg"
else
  echo "error: unknown branding: ${BUILD_BRANDING}" >&2
  exit 1
fi

SRC_APP_PATH="${BUILT_PRODUCTS_DIR}/${APP_NAME}.app"
VOL_NAME="${APP_NAME}"
DST_DMG_PATH="${BUILT_PRODUCTS_DIR}/${DMG_NAME}"

# show things as we run them
set -x

# Call the real working
"${PKG_DMG}" --source /var/empty \
             --target "${DST_DMG_PATH}" \
             --format UDBZ \
             --volname "${VOL_NAME}" \
             --tempdir "${TEMP_DIR}" \
             --copy "${SRC_APP_PATH}/:/${APP_NAME}.app/"