summaryrefslogtreecommitdiffstats
path: root/chrome/tools/build/mac/make_sign_sh
blob: 115882c13612b0522e3ac23a7fb5b92e15518155 (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
#!/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.

# This script creates sign.sh, the script that will be used to sign the
# application bundle and inner bundles.  sign.sh is placed in the Packaging
# directory next to the .app bundle.  The packaging system is expected to run
# sign.sh to sign everything.

set -e

if [ $# -ne 2 ] ; then
  echo "usage: ${0} PACKAGING_DIR MAC_PRODUCT_NAME" >& 2
  exit 1
fi

PACKAGING_DIR="${1}"
MAC_PRODUCT_NAME="${2}"
SIGN_SH_IN_FILE="$(dirname "${0}")/sign.sh.in"
SIGN_SH_FILE="${PACKAGING_DIR}/sign.sh"

mkdir -p "${PACKAGING_DIR}"
sed -e "s/@MAC_PRODUCT_NAME@/${MAC_PRODUCT_NAME}/g" \
    < "${SIGN_SH_IN_FILE}" \
    > "${SIGN_SH_FILE}"
chmod a+rx "${SIGN_SH_FILE}"