[Rpm-maint] AND dependencies
vondruch at redhat.com
Fri Apr 12 11:53:57 UTC 2013
In February, I attended Developer Conference  and I saw interesting
presentation by Michael Schröder [2, 3]. What was the most interesting
part for me are the AND dependencies (slides 6/7 ) and I'd really
love to see support for them in RPM. Let me show you my use case.
There are two main Ruby implementations available in Fedora, i.e. MRI
and JRuby. We would like to share the gems between them. The plain Ruby
gems works just fine with both implementations. The problem is with gems
with binary extensions, lets say rubygem-nokogiri. In such gem, there is
typically some common Ruby code and the binary code, which is specific
for either implementation.
So now, we have ruby, jruby and rubygem-nokogiri packages and system,
where we want to install rubygem-nokogiri. Unfortunately, if
rubygem-nokogiri is monolithic package, which ships bindings for both
implementations, we would end up with both Ruby implementations on our
system. But this is not what we want, since for production system, one
Ruby implementation is typically enough.
Ok, so we can split out the Ruby implantation specific code into
subpackages. So now we have rubygem-nokogiri with pure Ruby code and we
have rubygem-nokogiri-mri and rubygem-nokogiri-jruby with the
implementation specific bits. Now the questions, how to ensure, that
"yum install rubygem-nokogiri" installs all the needed bits to be able
to execute the code by either ruby or jruby.
We are able to ensure, the either one or both Ruby implementations will
be installed on the system using virtual provide, such as "Requires:
ruby(release)", but in RPM there is currently no way how to specify,
that rubygem-nokogiri-mri must be available for rubygem-nokogiri to work
properly, if MRI Ruby are installed on the system. I can imagine, that
something like "Requires: jruby && rubygem-nokogiri-jruby" and
"Requires: ruby && rubygem-nokogiri-mri".
It seems that libsolv can solve such dependencies, though RPM is missing
appropriate metadata and SuSE has to workaround it by special
packageand() virtual provide. So now the question is, what prevents RPM
from support of such dependency properly?
BTW I can provide you another case for VIM and Ruby bindings, if you are
not convinced yet, that RPM should know AND dependencies ;)
More information about the Rpm-maint