Odd mock build problem

Toshio Kuratomi toshio at tiki-lounge.com
Wed Mar 1 20:24:01 UTC 2006


On Wed, 2006-03-01 at 21:09 +0100, Oliver Andrich wrote:
> On Wed, Mar 01, 2006 at 12:03:06PM -0800, Toshio Kuratomi wrote:
> > Here's an adaptation of Rex's maxima/sbcl snippet.  I'm not a genius
> > with mock and I'm not at all familiar with ruby so this may not work.
> > Would you care to give it a test?
> > 
> > # Get Ruby versioning
> > # The idea is to make a hack that works, even in mock (-: Thanks Rex!
> > %global ruby_ver %(ruby -rrbconfig -e 'puts Config::CONFIG["ruby_version"])
> > %if "%{?ruby_ver}" >= "1.8"
> > %define ruby_ver2 = %{ruby_ver}
> > %endif
> > Requires: ruby %{?ruby_ver2}
> 
> Hm, sorry if I show my complete misunderstanding, but how can something
> like that help? Some of the other readers have stated, that ruby isn't
> available at all inside mock. So, how does that work? I am curious.

My understanding -- and this is where _my_ ignorance of mock may show --
is that mock makes two passes on the spec file.

Pass 1) is to decide what is required to build the package.  This pass
does not have ruby installed.  This means that the current template
macros will cause mock to error.  (Because they expand to Requires:
[Nothing]).  With this snippet, the Requires expands to "Requires: ruby"
at this point which is valid and mock can proceed.

Pass 2) is actually building the package in the populated buildroot.  By
this time ruby has been installed in the BuildRoot (Because of the
BuildRequires: ruby).  So the package that gets built has a requirement
of "Requires: ruby = 1.8" which should have the versioned directories
the package requires.

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-extras-list/attachments/20060301/e629554b/attachment.sig>


More information about the fedora-extras-list mailing list