Sorry , I want to test RPM Conditionals generally like 

%if !0%{?fedora} < 22
echo yes
%endif

%if ! 0%{?rhel} < 8
echo yes
%endif

%if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 15 || 0%{?rhel} >= 7
echo yes
%endif 




On Mon, 2021-11-29 at 14:22 +0100, Jun Aruga wrote:
> 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

-- 
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

Reply via email to