[Mageia-dev] rpm lies to bcond_with{out} usage

simple w8 simplew8 at gmail.com
Thu Apr 12 06:12:51 CEST 2012


Hi,

In /usr/lib/rpm/macros it does say:

# Handle conditional builds. %bcond_with is for case when feature is
# default off and needs to be activated with --with ... command line
# switch. %bcond_without is for the dual case.
#
# %bcond_with foo defines symbol with_foo if --with foo was specified on
# command line.
# %bcond_without foo defines symbol with_foo if --without foo was *not*
# specified on command line.
#
# For example (spec file):
#
# (at the beginning)
# %bcond_with extra_fonts
# %bcond_without static
# (and later)
# %if %{with extra_fonts}
# ...
# %else
# ...
# %endif
# %if ! %{with static}
# ...
# %endif
# %ifdef %{with static}
# ...
# %endif

But seams this is NO longer true, i have add in a spec "%bcond_with foo"

so if i want to deny it (following the explained usage) i would have
to do:  %if ! %{with foo}

but seams its not denying, rpm is lying!

So far the only way i found to deny and that does in fact deny is to
use: %if %{!with foo}

Surprised? Well so am i!

Seams that rpm behaviour goes very confusing,  since also "rpmquery"
no longer does what is expected i.e. "rpmquery -i foo" doesn not show
any info about the package.

Can this be fixed with a patch?
Maybe would be better for the rpm maintainer report these problems upstream?


More information about the Mageia-dev mailing list