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

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

 



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

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




[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