build-deb.sh revision 5821806d5e7f356e8fa4b058a389a808ea183019
1#!/bin/bash -e
2
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
5# found in the LICENSE file.
6
7if [[ -z "$version_full" ]]; then
8  src_root=./../../../..
9  remoting_version_path=$src_root/remoting/VERSION
10  chrome_version_path=$src_root/chrome/VERSION
11  version_helper=$src_root/chrome/tools/build/version.py
12
13  # TODO(lambroslambrou): Refactor to share the logic with remoting.gyp.
14  version_major=$($version_helper -f $chrome_version_path \
15                  -f $remoting_version_path -t "@MAJOR@")
16  version_minor=$($version_helper -f $remoting_version_path \
17                  -t "@REMOTING_PATCH@")
18  version_build=$($version_helper -f $chrome_version_path \
19                  -f $remoting_version_path -t "@BUILD@")
20  version_patch=$($version_helper -f $chrome_version_path \
21                  -f $remoting_version_path -t "@PATCH@")
22  version_full="$version_major.$version_minor.$version_build.$version_patch"
23fi
24
25if [[ ! "$version_full" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
26  echo "Error: Invalid \$version_full value: $version_full" >&2
27  exit 1
28fi
29
30echo "Building version $version_full"
31
32# Create a fresh debian/changelog.
33export DEBEMAIL="The Chromium Authors <chromium-dev@chromium.org>"
34rm -f debian/changelog
35debchange --create \
36  --package chrome-remote-desktop \
37  --distribution lucid \
38  --newversion "$version_full" \
39  "New Debian package"
40
41dpkg-buildpackage -b -us -uc
42