From 59e1c64946cb475725246ec8fe743ebc7054fe7d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 12 Feb 2020 14:54:45 +0100 Subject: Revert "build.macros: remove '--without
' rpmbuild functionality" This reverts commit 5057c7c260790cbe5dffeb823ff186282cdfd7f1. Rationale: it's very useful in order to work on huge packages before submiting them to BS --- build.macros.in | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'build.macros.in') diff --git a/build.macros.in b/build.macros.in index fb3b548..4a763db 100644 --- a/build.macros.in +++ b/build.macros.in @@ -373,15 +373,34 @@ popd %rpmhelper_required_version 0.24.11 %systemd_required_version 195 +#------------------------------------------------------------------------------ +# Redefine RPM sections to allow jumping over them using "--without
". +# This an interesting alternative to --short-circuit. +# The following are mostly equivalent: +# % rpmbuild -bi --short-circuit foo.spec && rpmbuild -bb --short-circuit foo.spec +# % rpmbuild -bb --without build foo.spec + +%prep %%prep \ +[ %{_with prep} -eq 1 ] || exit 0 \ +[ %{_with build} -eq 1 ] || exit 0 \ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} + +%build %%build \ +[ %{_with install} -eq 1 ] || exit 0 \ +[ %{_with build} -eq 1 ] || exit 0 \ +%{nil} + #--------------------------------------------------------------------- # Expanded at beginning of %install scriptlet. # %__spec_install_pre %{___build_pre}\ +if [ %{_with install} -eq 1 ]; then\ [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\ mkdir -p `dirname "$RPM_BUILD_ROOT"`\ mkdir "$RPM_BUILD_ROOT"\ -%{nil} +fi #--------------------------------------------------------------------- # Expanded at end of %install scriptlet. @@ -419,6 +438,11 @@ popd %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\ %%install\ +[ %{_with install} -eq 1 ] || exit 0 \ +%{nil} + +%check %%check \ +[ %{_with check} -eq 1 ] || exit 0 \ %{nil} # -- cgit v1.2.1