From 72c311efdca1fd3866a90175ddbb79f4c4436c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Sun, 21 Oct 2018 10:33:41 +0300 Subject: Strip binaries and libraries in __os_install_post if __debug_package isn't defined Add __brp_strip, __brp_strip_comment_note, __brp_strip_static_archive and __brp_strip_shared for stripping. One can skip stripping by using '%define __strip %{_bindir}/true' in .spec, if needed. --- build.macros.in | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'build.macros.in') diff --git a/build.macros.in b/build.macros.in index 743258f..fd03706 100644 --- a/build.macros.in +++ b/build.macros.in @@ -451,6 +451,10 @@ fi #--------------------------------------------------------------------- # Expanded at end of %install scriptlet. +%__brp_strip /usr/lib/rpm/brp-strip %{__strip} +%__brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} +%__brp_strip_static_archive /usr/lib/rpm/brp-strip-static-archive %{__strip} +%__brp_strip_shared /usr/lib/rpm/brp-strip-shared %{__strip} %__brp_python_bytecompile /usr/lib/rpm/brp-python-bytecompile "%{__python}" "%{?_python_bytecompile_errors_terminate_build}" "%{?_python_bytecompile_extra}" %__brp_python_hardlink /usr/lib/rpm/brp-python-hardlink # __brp_mangle_shebangs_exclude - shebangs to exclude @@ -461,6 +465,12 @@ fi %__os_install_post \ %{?__spec_helper_post}%{?!__spec_helper_post:/usr/share/spec-helper/spec-helper} \ + %{!?__debug_package:\ + %{?__brp_strip} \ + %{?__brp_strip_comment_note} \ + %{?__brp_strip_static_archive} \ + %{?__brp_strip_shared} \ + } \ %{?py_auto_byte_compile:%{?__brp_python_bytecompile}} \ %{?__brp_python_hardlink} \ %{?__brp_mangle_shebangs} \ -- cgit v1.2.1