[OBS] Subsitute macro not recursive ?


I use the project configuration to handle the different names of packages between linux distribution, like this :

# R library
%if 0%{?suse_version} || 0%{?mdkversion}
Substitute: R-core R-base 

I have two package, A and B.
I write my packages for fedora.
A’s spec files requires R-core.
When building for opensuse, the substitute command works fine : the package builds successfully instead of yelling “nothing provides R-core”.

Now package B requires package A.
When building for opensuse, it says “nothing provides R-core required by package A”,
even though both packages belong to the same project, so same configuration.

I expected the substitute macro to be recursive and handle dependencies requires.
Is this a known limitation of OBS ?
Is there any option, or possible clean workaround ?


Use BuildRequires instead.

Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.3 (i586) Kernel 2.6.34-12-desktop
up 1:06, 1 user, load average: 0.10, 0.10, 0.09
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

It’s my understanding that Substitute is just a thing that is used by the dependency solver of the OBS. But the spec file is not modified in any way.

So you can use Substitute for entries in “BuildRequires”. But it makes no sense for dependencies in “Requires”.

But anyway. You can just remove those

Requires(post): R-core
Requires(postun): R-core

Since you are not using any post or postun scriplet.

thanks for the explanation.

So the only way is to modify conditionally the spec file with
%if 0%{suse_version}
Requires: xxx
Requires: yyy

I thought it would be cleaner only to rely on project configuration, but it has it’s limitations.