| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 #!/bin/bash | 
|  | 2 | 
|  | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 
|  | 4 # Use of this source code is governed by a BSD-style license that can be | 
|  | 5 # found in the LICENSE file. | 
|  | 6 | 
|  | 7 # Builds the .deb package. | 
|  | 8 | 
|  | 9 # Load common constants.  This should be the first executable line. | 
|  | 10 # The path to common.sh should be relative to your script's location. | 
|  | 11 COMMON_SH="$(dirname "$0")/../../scripts/common.sh" | 
|  | 12 . "$COMMON_SH" | 
|  | 13 | 
|  | 14 # Command line options | 
|  | 15 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" "Root of build output" | 
|  | 16 | 
|  | 17 # Parse command line and update positional args | 
|  | 18 FLAGS "$@" || exit 1 | 
|  | 19 eval set -- "${FLAGS_ARGV}" | 
|  | 20 | 
|  | 21 # Die on any errors | 
|  | 22 set -e | 
|  | 23 | 
|  | 24 # Remove previous package from output dir | 
|  | 25 PKG_BASE="ibus-anthy" | 
|  | 26 # TODO(yusukes): support ARM. | 
|  | 27 OUT_DIR="$FLAGS_build_root/x86/local_packages" | 
|  | 28 rm -f "${OUT_DIR}/${PKG_BASE}_"*.deb | 
|  | 29 | 
|  | 30 # Set up the debian build directory. | 
|  | 31 PKG_BUILD_DIR="${FLAGS_build_root}/${PKG_BASE}" | 
|  | 32 mkdir -p "$PKG_BUILD_DIR" | 
|  | 33 rm -rf "${PKG_BUILD_DIR}/build" | 
|  | 34 cp -rp "${TOP_SCRIPT_DIR}/files" "${PKG_BUILD_DIR}/build" | 
|  | 35 pushd "${PKG_BUILD_DIR}/build" | 
|  | 36 # Apply patches | 
|  | 37 gunzip -c "${TOP_SCRIPT_DIR}/ibus-anthy_1.2.0.20090813-2.diff.gz" | patch -p1 | 
|  | 38 chmod u+x ./debian/rules | 
|  | 39 | 
|  | 40 # Build the package | 
|  | 41 ./autogen.sh | 
|  | 42 dpkg-buildpackage -b -tc -us -uc | 
|  | 43 mv ../"${PKG_BASE}"_*.deb "${OUT_DIR}" | 
|  | 44 rm -f ../"${PKG_BASE}"_*.changes | 
|  | 45 popd | 
| OLD | NEW | 
|---|