You can use `%bcond_with foo` (foo is not set as "false") or
`%bcond_without foo` (foo is set as "true") syntax.
```
%bcond_without foo # foo is set as true
%if %{with foo}
echo 1
%else
echo 0
%endif
```
Then run `mock --with foo *.rpm` or `mock --without foo *.rpm` for the
SRPM file.
Jun
An example using the %bcond macros.
https://src.fedoraproject.org/rpms/rpm/blob/rawhide/f/rpm.spec
On Mon, Nov 29, 2021 at 2:03 PM Sérgio Basto <[email protected]> wrote:
>
> Hi,
>
> How I can check RPM Conditionals [1], for example How I can check what
> is the result of:
>
> %if 1
> echo 1;
> %else
> echo 0;
> %endif
>
> Best regards,
>
> [1]
> https://rpm-packaging-guide.github.io/#rpm-conditionals
>
>
> --
> Sérgio M. B.
> _______________________________________________
> devel mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> Fedora Code of Conduct:
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
> https://lists.fedoraproject.org/archives/list/[email protected]
> Do not reply to spam on the list, report it:
> https://pagure.io/fedora-infrastructure
--
Jun | He - Him
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure