aboutsummaryrefslogtreecommitdiffstats
path: root/build.macros.in
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-02-12 14:54:45 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-02-12 15:00:09 +0100
commit59e1c64946cb475725246ec8fe743ebc7054fe7d (patch)
tree7e8d8d69b650f5946b2d402032b3a841ad7e6e32 /build.macros.in
parent73670dca612cfb3bd0c632e7dc25d3255f6d65ef (diff)
downloadrpm-setup-59e1c64946cb475725246ec8fe743ebc7054fe7d.tar
rpm-setup-59e1c64946cb475725246ec8fe743ebc7054fe7d.tar.gz
rpm-setup-59e1c64946cb475725246ec8fe743ebc7054fe7d.tar.bz2
rpm-setup-59e1c64946cb475725246ec8fe743ebc7054fe7d.tar.xz
rpm-setup-59e1c64946cb475725246ec8fe743ebc7054fe7d.zip
Revert "build.macros: remove '--without <section>' rpmbuild functionality"
This reverts commit 5057c7c260790cbe5dffeb823ff186282cdfd7f1. Rationale: it's very useful in order to work on huge packages before submiting them to BS
Diffstat (limited to 'build.macros.in')
-rw-r--r--build.macros.in26
1 files changed, 25 insertions, 1 deletions
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 <section>".
+# 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}
#