[Rpm-maint] [rpm-software-management/rpm] Add %bcond macro for defining build conditionals (#1520)

Petr Viktorin notifications at github.com
Fri Sep 3 15:32:11 UTC 2021


@encukou commented on this pull request.



> @@ -76,47 +76,25 @@
 %defined()	%{expand:%%{?%{1}:1}%%{!?%{1}:0}}
 %undefined()	%{expand:%%{?%{1}:0}%%{!?%{1}:1}}
 
-# Shorthand for %{defined with_...}
+# Handle conditional builds.
+# (see 'conditionalbuilds' in the manual)
+#
+# Internally, the `--with foo` option defines the macro `_with_foo` and the
+# `--without foo` option defines the macro `_without_foo`.
+# Based on those and a default (used when neither is given), bcond macros
+# define the macro `with_foo`, which should later be checked:
+
+%bcond()	%{expand:%[ (%2)
+    ? "%{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}"
+    : "%{expand:%%{?_with_%{1}:%%global with_%{1} 1}}"
+]}
+%bcond_with()		%{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
+%bcond_without()	%{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}

I haven't found a way to avoid it :(

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1520#discussion_r701984570
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210903/3d8eaec4/attachment.html>


More information about the Rpm-maint mailing list