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 <ser...@serjux.com> 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 -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> 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/devel@lists.fedoraproject.org
> Do not reply to spam on the list, report it: 
> https://pagure.io/fedora-infrastructure



-- 
Jun | He - Him
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
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/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to