summaryrefslogtreecommitdiffstats
path: root/o3d/installer
diff options
context:
space:
mode:
authortschmelcher@google.com <tschmelcher@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-18 02:13:29 +0000
committertschmelcher@google.com <tschmelcher@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-18 02:13:29 +0000
commitd0693f5bb06999807e2b02b8646788f6f65c7ef7 (patch)
tree21917e9fdc3bbad009c83ee45d4cddc79337f0f5 /o3d/installer
parentea5ac0e47d18753dbe971a35cce7f657ba64bae8 (diff)
downloadchromium_src-d0693f5bb06999807e2b02b8646788f6f65c7ef7.zip
chromium_src-d0693f5bb06999807e2b02b8646788f6f65c7ef7.tar.gz
chromium_src-d0693f5bb06999807e2b02b8646788f6f65c7ef7.tar.bz2
Build -dbgsym Debian packages. These contain the stripped-out debugging symbols and can be installed on a system to automatically enable symbolic debugging.
Review URL: http://codereview.chromium.org/210018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/installer')
-rw-r--r--o3d/installer/linux/build.scons85
-rw-r--r--o3d/installer/linux/debian_amd64/control9
-rwxr-xr-xo3d/installer/linux/debian_amd64/rules2
-rw-r--r--o3d/installer/linux/debian_i386/control9
-rwxr-xr-xo3d/installer/linux/debian_i386/rules2
5 files changed, 74 insertions, 33 deletions
diff --git a/o3d/installer/linux/build.scons b/o3d/installer/linux/build.scons
index ab7ecb0..85e08c2 100644
--- a/o3d/installer/linux/build.scons
+++ b/o3d/installer/linux/build.scons
@@ -29,6 +29,8 @@
import os
import subprocess
+import SCons
+
Import('env')
# Check if Debian packaging tools are installed. If so, make a .deb package.
@@ -43,11 +45,15 @@ if subprocess.Popen(["which", "dpkg-buildpackage"],
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
return process.communicate()[0].strip()
- def BuildDebianPackage(debian_files, package_files, output_dir=None,
- force_version=None):
+ def _InternalBuildDebianPackage(env, src_dir, obj_dir, debian_files,
+ package_files, output_dir=None, force_version=None):
"""Creates build rules to build a Debian package from the specified sources.
Args:
+ env: SCons Environment.
+ src_dir: Current source path, to which the debian_files are
+ relative.
+ obj_dir: Directory to place object files in.
debian_files: Array of the Debian control file sources that should be
copied into the package source tree, e.g., changelog, control, rules,
etc. Must be relative to current source dir.
@@ -66,7 +72,7 @@ if subprocess.Popen(["which", "dpkg-buildpackage"],
final version will compare as greater).
Return:
- A list of the (two) targets.
+ A list of the targets (at least two).
"""
# Read the control file and changelog file to determine the package name,
# version, and arch that the Debian build tools will use to name the
@@ -75,19 +81,21 @@ if subprocess.Popen(["which", "dpkg-buildpackage"],
changelog_file = None
for file in debian_files:
if os.path.basename(file) == "control":
- control_file = os.path.join(current_source_dir, file)
+ control_file = os.path.join(src_dir, file)
elif os.path.basename(file) == "changelog":
- changelog_file = os.path.join(current_source_dir, file)
+ changelog_file = os.path.join(src_dir, file)
if control_file == None:
raise Exception("Need to have a control file")
if changelog_file == None:
raise Exception("Need to have a changelog file")
- package = OutputFromShellCommand("awk '/^Package:/ { print $2; }' "
- + control_file)
- version = OutputFromShellCommand("sed -nr '1 { s/.*\\((.*)\\).*/\\1/; p }' "
- + changelog_file)
- arch = OutputFromShellCommand("awk '/^Architecture:/ { print $2; }' "
- + control_file)
+ source = OutputFromShellCommand(
+ "awk '/^Source:/ { print $2; }' " + control_file)
+ packages = OutputFromShellCommand(
+ "awk '/^Package:/ { print $2; }' " + control_file).split("\n")
+ version = OutputFromShellCommand(
+ "sed -nr '1 { s/.*\\((.*)\\).*/\\1/; p }' " + changelog_file)
+ arch = OutputFromShellCommand(
+ "awk '/^Architecture:/ { print $2; }' %s | head -n 1" % control_file)
add_dummy_changelog_entry = False
if force_version != None and not version.startswith(force_version):
print('Warning: no entry in ' + changelog_file + ' for version ' +
@@ -96,20 +104,22 @@ if subprocess.Popen(["which", "dpkg-buildpackage"],
'releasing.');
version = force_version + '~prerelease'
add_dummy_changelog_entry = True
- package_file_name = package + "_" + version + "_" + arch
- # Path to the outputs, minus extension.
+ source_dir_name = source + "_" + version + "_" + arch
+ target_file_names = [ source_dir_name + ".changes" ]
+ for package in packages:
+ package_file_name = package + "_" + version + "_" + arch + ".deb"
+ target_file_names.append(package_file_name)
+ # The targets
if output_dir != None:
- dest_files = os.path.join(output_dir, package_file_name)
+ targets = [os.path.join(output_dir, s) for s in target_file_names]
else:
- dest_files = package_file_name
+ targets = target_file_names
# Path to where we will construct the debian build tree.
- deb_build_tree = os.path.join(package_file_name, "deb_build_tree")
- # The targets
- targets = [dest_files + ".deb", dest_files + ".changes"]
+ deb_build_tree = os.path.join(obj_dir, source_dir_name, "deb_build_tree")
# First copy the files.
for file in package_files:
env.Command(os.path.join(deb_build_tree, file[0]), file[1],
- Copy('$TARGET', '$SOURCE'))
+ SCons.Defaults.Copy('$TARGET', '$SOURCE'))
env.Depends(targets, os.path.join(deb_build_tree, file[0]))
# Now copy the Debian metadata sources. We have to do this all at once so
# that we can remove the target directory before copying, because there
@@ -121,15 +131,17 @@ if subprocess.Popen(["which", "dpkg-buildpackage"],
os.path.basename(file)))
copy_commands = [
"""dir=$$(dirname $TARGET) && \
- rm -Rf $$dir && \
- mkdir -p $$dir && \
- cp $SOURCES $$dir"""
+ rm -Rf $$dir && \
+ mkdir -p $$dir && \
+ cp $SOURCES $$dir && \
+ chmod -R u+w $$dir"""
]
if add_dummy_changelog_entry:
copy_commands += [
- """debchange -c $$(dirname $TARGET)/changelog --newversion """ +
- version + """ --distribution UNRELEASED """ +
- """'Developer preview build.'"""
+ """debchange -c $$(dirname $TARGET)/changelog --newversion %s \
+ --distribution UNRELEASED \
+ 'Developer preview build. (This entry was auto-generated.)'""" %
+ version
]
env.Command(copied_debian_files_paths, debian_files, copy_commands)
env.Depends(targets, copied_debian_files_paths)
@@ -139,16 +151,23 @@ if subprocess.Popen(["which", "dpkg-buildpackage"],
# Must explicitly specify -D because -a disables it.
# Must explicitly specify fakeroot because old dpkg tools don't assume that.
env.Command(targets, None,
- """dir=$OBJ_ROOT/installer/linux/""" + deb_build_tree + """ && \
- cd $$dir && \
- dpkg-buildpackage -b -uc -a""" + arch + """ -D -rfakeroot && \
- cd $$OLDPWD && \
- mv $$dir/../""" + package_file_name + """.deb \
- $$(dirname $TARGET) && \
- mv $$dir/../""" + package_file_name + """.changes \
- $$(dirname $TARGET)""")
+ """dir=%(dir)s && \
+ cd $$dir && \
+ dpkg-buildpackage -b -uc -a%(arch)s -D -rfakeroot && \
+ cd $$OLDPWD && \
+ for file in %(targets)s; do \
+ mv $$dir/../$$file $$(dirname $TARGET); \
+ done""" %
+ {'dir':env.Dir(deb_build_tree).path,
+ 'arch':arch,
+ 'targets':" ".join(target_file_names)})
return targets
+ def BuildDebianPackage(debian_files, package_files, output_dir=None,
+ force_version=None):
+ return _InternalBuildDebianPackage(env, current_source_dir, ".",
+ debian_files, package_files, output_dir, force_version)
+
# Build amd64 package.
BuildDebianPackage(["debian_common/changelog",
"debian_amd64/control",
diff --git a/o3d/installer/linux/debian_amd64/control b/o3d/installer/linux/debian_amd64/control
index 8a3b6f8..08979cb 100644
--- a/o3d/installer/linux/debian_amd64/control
+++ b/o3d/installer/linux/debian_amd64/control
@@ -15,3 +15,12 @@ Description: Google O3D Plugin
the browser.
.
This package provides the NPAPI browser plugin for running O3D-based web apps.
+
+Package: google-o3d-dbgsym
+Architecture: amd64
+Depends: google-o3d (= ${Source-Version})
+Description: Google O3D Plugin Debug Symbols
+ O3D is an open-source web API for creating rich, interactive 3D applications in
+ the browser.
+ .
+ This package contains symbol files for debugging.
diff --git a/o3d/installer/linux/debian_amd64/rules b/o3d/installer/linux/debian_amd64/rules
index 0789635..508aab6 100755
--- a/o3d/installer/linux/debian_amd64/rules
+++ b/o3d/installer/linux/debian_amd64/rules
@@ -6,5 +6,7 @@ export LD_LIBRARY_PATH=$(shell echo $$LD_LIBRARY_PATH:$$PWD)
include /usr/share/cdbs/1/rules/debhelper.mk
+DEB_DH_STRIP_ARGS=--dbg-package=google-o3d-dbgsym
+
# Workaround for Debian bug #364436
DEB_DH_MAKESHLIBS_ARGS=-n
diff --git a/o3d/installer/linux/debian_i386/control b/o3d/installer/linux/debian_i386/control
index ff7f05b..f9c6614 100644
--- a/o3d/installer/linux/debian_i386/control
+++ b/o3d/installer/linux/debian_i386/control
@@ -15,3 +15,12 @@ Description: Google O3D Plugin
the browser.
.
This package provides the NPAPI browser plugin for running O3D-based web apps.
+
+Package: google-o3d-dbgsym
+Architecture: i386
+Depends: google-o3d (= ${Source-Version})
+Description: Google O3D Plugin Debug Symbols
+ O3D is an open-source web API for creating rich, interactive 3D applications in
+ the browser.
+ .
+ This package contains symbol files for debugging.
diff --git a/o3d/installer/linux/debian_i386/rules b/o3d/installer/linux/debian_i386/rules
index 2bd95e0..152e73e 100755
--- a/o3d/installer/linux/debian_i386/rules
+++ b/o3d/installer/linux/debian_i386/rules
@@ -6,6 +6,8 @@ export LD_LIBRARY_PATH=$(shell echo $$LD_LIBRARY_PATH:$$PWD)
include /usr/share/cdbs/1/rules/debhelper.mk
+DEB_DH_STRIP_ARGS=--dbg-package=google-o3d-dbgsym
+
# For the 32-bit package, shlibdeps may not be able to find the three dependent
# libraries because they aren't included in our package and we don't list them
# as a build dependency (because we can't, since on a 64-bit system that would