From 5df8c7a31ee088a96eaa26e2101a0930b3987d81 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 17 Jan 2018 12:16:45 +0200 Subject: [PATCH] Macroize build root policies for consistent disable/override ability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a separate macro for each brp we have, using standard naming convention and conditionalize the usage in %__os_install_post. VoilĂ , we have a standard way to disable (and also override) any brp scripts from specs that need it and a common scheme for new brps to follow. Note that this is not supposed to change the existing behavior and default build root policy invocations at all, any change in those would be a thinko/typo/copy-paste error in this commit. (cherry picked from commit c4646d791dea6b976fd5a04e2562c7b21b9389e0) Signed-off-by: Igor Gnatenko --- macros | 21 +++++++++++++++------ redhat-rpm-config.spec | 5 ++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/macros b/macros index fd53c16..736c26c 100644 --- a/macros +++ b/macros @@ -134,15 +134,24 @@ %__arch_install_post /usr/lib/rpm/check-buildroot +# Build root policy macros. Standard naming: +# convert all '-' in basename to '_', add two leading underscores. +%__brp_compress /usr/lib/rpm/brp-compress +%__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_python_bytecompile /usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} +%__brp_python_hardlink /usr/lib/rpm/brp-python-hardlink + %__os_install_post \ - /usr/lib/rpm/brp-compress \ + %{?__brp_compress} \ %{!?__debug_package:\ - /usr/lib/rpm/brp-strip %{__strip} \ - /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \ + %{?__brp_strip} \ + %{?__brp_strip_comment_note} \ } \ - /usr/lib/rpm/brp-strip-static-archive %{__strip} \ - %{?py_auto_byte_compile:/usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build}} \ - /usr/lib/rpm/brp-python-hardlink \ + %{?__brp_strip_static_archive} \ + %{?py_auto_byte_compile:%{?__brp_python_bytecompile} \ + %{?__brp_python_hardlink} \ %{nil} %__spec_install_post\ diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 1f90ac9..531531a 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -6,7 +6,7 @@ Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config -Version: 71 +Version: 72 Release: 1%{?dist} # No version specified. License: GPL+ @@ -147,6 +147,9 @@ install -p -m 755 -t %{buildroot}%{_rpmconfigdir} kmod.prov %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Wed Feb 21 2018 Igor Gnatenko - 72-1 +- Backport macroizing build root policies for consistent disable/override + * Tue Feb 20 2018 Igor Gnatenko - 71-1 - Backport %%set_build_flags