From ceca012d0cf7cc52de62b201672f1cb1734be7dc Mon Sep 17 00:00:00 2001 From: Icarus Sparry Date: Thu, 26 Jan 2017 14:23:53 -0800 Subject: [PATCH] Add options.conf ability to not strip binaries The hhvm binary in particular has extra elf sections added to it to store php code, and these are removed by the generic build macros that create the debug information. Other packages which need this are bazil, docker, go, linux-*. Signed-off-by: Icarus Sparry --- autospec/config.py | 1 + autospec/specfiles.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/autospec/config.py b/autospec/config.py index ddd4fbf..21a3dd6 100644 --- a/autospec/config.py +++ b/autospec/config.py @@ -87,6 +87,7 @@ config_options = { "pgo": "set profile for pgo", "use_clang": "add clang flags", "32bit" : "build 32 bit libraries", + "nostrip" : "disable stripping binaries", "verify_required": "require package verification for build"} def create_conf(): diff --git a/autospec/specfiles.py b/autospec/specfiles.py index dcffe67..9b25965 100644 --- a/autospec/specfiles.py +++ b/autospec/specfiles.py @@ -101,6 +101,7 @@ class Specfile(object): self.write_main_subpackage_requires() self.write_buildreq() + self.write_strip_command() self.write_patch_header() # main package extra content @@ -200,6 +201,12 @@ class Specfile(object): for req in sorted(self.buildreqs): self._write("BuildRequires : {}\n".format(req)) + def write_strip_command(self): + """ Write commands to prevent stripping binary if requested """ + if config.config_opts['nostrip']: + self._write("# Suppress stripping binaries\n") + self._write("%define __strip /bin/true\n%define debug_package %{nil}\n") + def write_patch_header(self): """ Write patch list header