%ifarch note

Mamoru TASAKA mtasaka at fedoraproject.org
Fri Oct 11 07:26:34 UTC 2013


> On Oct 11, 2013 1:55 PM, "Mamoru TASAKA" <mtasaka at fedoraproject.org> wrote:
> >
> > > Since I hit this, I'd imagine other people might.
> > > If your package has:
> > >
> > > BuildArch: noarch
> > >
> > > It will set %{_target_cpu} to "noarch".
> > >
> > > If you also use %ifarch in that spec file, you might be expecting it to
> > > match %{_arch} (the architecture of the build server). It does not. It
> > > matches %{_target_cpu}.
> > >
> > > If you need to conditionalize on the value of %{_arch} in such a spec
> > > file, you need to do it explicitly:
> > >
> > > %if %{_arch} == x86_64 || %{_arch} == i686
> > >
> > > Hope that helps other folks,
> > >
> > > ~tom
> >
> > Using %if %{_arch} == x86_64 || %{_arch} == i686 seems to break building srpm
> > on arm koji:
> > http://koji.fedoraproject.org/koji/taskinfo?taskID=6049393
> > (when making srpm on i686 or x86_64, it seems okay).
> >
> > Perhaps when building srpm on arm, _arch is not defined on koji.
> >
> > Regards,
> > Mamoru

> Till just told me about %ifnarch %{arm}.
> Is it better?

This is explained in the original spot's mail (, which 
is included in this mail), i.e.
when "BuildArch: noarch" exists, %ifarch or %ifnarch
doesn't work as expected (when building binary rpm).

(Currently my reply seems to create new thread...)

Regard,
Mamoru






More information about the devel mailing list