Re: How I test RPM Conditionals ? in shell command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <sergio@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxxxxxxxxxxxx
> Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux