stan wrote:
On Wed, 2 May 2018 23:57:53 -0400
Todd Zullinger <tmz(a)pobox.com> wrote:
> The --with/--without arguments toggle conditions set via
> %bcond_with and %bcond_without. So that won't do what Robin
> wants.
>
> More details on --with/--without are here:
>
>
http://rpm.org/user_doc/conditional_builds.html
>
Thanks.
My knowledge of this is minimal, but I was going by the kernel, which
was probably a bad choice, as the kernel is unique. There, passing
--without-debuginfo turns off debug package generation, but that is
probably due to special coding in the spec file, shown below.
[...]
Well... I didn't go into all the details about how the
--with/--without options work. I started to write more in
my initial reply, but then I thought I was getting too deep
in the weeds, so I dropped that. ;)
For a little more detail on it, the kernel isn't doing
anything special there with regards to --with/--without.
They're doing essentially what the %bcond_with/out macros
do.
In /usr/lib/rpm/macros, %bcond_with and %bcond_without are
defined like this:
%bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
They're really just shortcuts for setting %with_$foo and
related macros. You can read more in the macros file,
starting around line 104 in rpm-4.14.0:
https://github.com/rpm-software-management/rpm/blob/rpm-4.14.0-release/ma...
It's a lot of macro work there, but it boils down to making
things easier for packages to use the %bcond macros and the
--with/--without command line arguments. Even the command
line arguments are just shortcuts to define %_with_$foo and
%_without_$foo macros.
Hopefully that's at least mildly interesting and/or useful
information. More importantly, I hope I managed to sum it
up reasonably, without any major errors. ;)
--
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If God had meant for us to be naked, we would have been born that way.