[Fedora-packaging] Re: Macro expansion problem

Axel Thimm Axel.Thimm at ATrpms.net
Tue Aug 26 21:49:34 UTC 2008


On Tue, Aug 26, 2008 at 05:33:13PM -0400, Michel Salim wrote:
> On Tue, Aug 26, 2008 at 1:47 PM, Axel Thimm <Axel.Thimm at atrpms.net> wrote:
> > On Tue, Aug 26, 2008 at 01:39:00PM -0400, Michel Salim wrote:
> >> On Tue, Aug 26, 2008 at 7:46 AM, Rex Dieter <rdieter at math.unl.edu> wrote:
> >> > Michel Salim wrote:
> >> >>
> >> >> At the risk of asking the obvious, why does this fail:
> >> >>
> >> >> %define nunitver %(gacutil -l nunit.core | tail -n 2 | grep nunit.core
> >> >> | cut -d "=" -f 2 | cut -
> >> >> d "," -f 1)
> >> >>
> >> >> Requires: mono(nunit.core) = %{nunitver}
> >> >
> >> > I'll venture because our buildsys needs to (re)generate the srpm, and at
> >> > that time, no BR's are installed and gacutil isn't available => failure.
> >> > To protect against that, do something like:
> >> >
> >> > %define nunitver %(gacutil -l nunit.core 2>& /dev/null | ...)
> >> >
> >> > %if "x%{?nunitver}" != "x"
> >> > Requires: mono(nunit.core) = %{nunitver}
> >> > %endif
> >> >
> >> Axel: It fails by being empty.
> >>
> >> Tom, Rex: as Rex said, it is because BRs are not installed when the
> >> SRPM is regenerated (perhaps we need a different directive, like
> >> PreBuildRequires: ? Hmm)
> >>
> >> So in this case, nunitver will *always* be empty, so I'm not sure how
> >> the test will help.
> >
> > This idiom is often used with perl/python/php etc. The first phase
> > creating the src.rpm will be giving you some warnings, but the second
> > phase, the actual building of the binaries will have the bits in place
> > due to the BuildRequires, so it will not be empty then.
> 
> Aha! Yes, cute. The Requires: that end up in the binary package will
> actually be the proper values, then, not the values that end up in the
> source RPM?

Yes, the values at the binary build, not at the src.rpm build.
-- 
Axel.Thimm at ATrpms.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-packaging/attachments/20080827/8b13d896/attachment.sig>


More information about the Fedora-packaging mailing list