aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--build.macros.in26
2 files changed, 29 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index f06fb67..9aa214c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- build.macros: restore '--without <section>' rpmbuild functionality
+ (which is very useful in order to work on huge packages before submiting them
+ to BS)
+
Version 2.52 - 4 February 2020, by Jani Välimaa
- build.macros: remove '--without <section>' rpmbuild functionality
- build.macros: add __spec_install_post
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}
#