[Pacemaker] [PATCH 4 of 4] Medium: build: add compatibility wrappers for conditional builds in legacy RPM versions

Florian Haas florian.haas at linbit.com
Fri Feb 5 13:47:21 UTC 2010


# HG changeset patch
# User Florian Haas <florian.haas at linbit.com>
# Date 1265375521 -3600
# Branch stable-1.0
# Node ID 9f9d1d22197dcda845e5d624addfe5159605c14f
# Parent  35eba1386aff888c38b181054c5afcb0f80a2910
Medium: build: add compatibility wrappers for conditional builds in legacy RPM versions

Legacy versions of RPM, most notably the one bundled with RHEL 4, do
not support conditional builds with the --with and --without
options. Add compatibility wrappers that define the necessary macros
in case they aren't yet natively defined yet.

("Stolen" from the spec file that DRBD uses.)

diff -r 35eba1386aff -r 9f9d1d22197d pacemaker.spec
--- a/pacemaker.spec	Fri Feb 05 14:08:59 2010 +0100
+++ b/pacemaker.spec	Fri Feb 05 14:12:01 2010 +0100
@@ -11,6 +11,13 @@
 
 %global pcmk_release %{?alphatag:0.}%{specversion}%{?alphatag:.%{alphatag}}%{?dist}
 
+# Compatibility macro wrappers for legacy RPM versions that do not
+# support conditional builds
+%{!?bcond_without: %{expand: %%global bcond_without() %%{expand:%%%%{!?_without_%%{1}:%%%%global with_%%{1} 1}}}}
+%{!?bcond_with:    %{expand: %%global bcond_with()    %%{expand:%%%%{?_with_%%{1}:%%%%global with_%%{1} 1}}}}
+%{!?with:          %{expand: %%global with()          %%{expand:%%%%{?with_%%{1}:1}%%%%{!?with_%%{1}:0}}}}
+%{!?without:       %{expand: %%global without()       %%{expand:%%%%{?with_%%{1}:0}%%%%{!?with_%%{1}:1}}}}
+
 # Conditionals
 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
 # to disable or enable specific features




More information about the Pacemaker mailing list