How to specify an alternative dependency for RPM spec file?

Dear OpenSuSE community,

My question is not relevant to programming as such, but for development.

I am composing the RPM spec file in which I would like to define the following dependency:

BuildRequires:	libstdc++43-devel or libstdc++44-devel or libstdc++45-devel

(I have different build environments running different versions of SuSE which have different libstdc).

I have found the similar question here. The spec I’ve found for Fedora says, that this syntax is possible, unfortunately it does not work for me for SuSE 11.2. This HOWTO as well as this spec however do not mention about this possibility.

If alternative dependency is not supported by SuSE RPM manager, does it mean I need to replace the version XX in libstdc++XX-devel each time I upgrade/migrate to new distro? Is there any other RPM-specific forum or maillist where can ask more information?

On Thu, 2011-03-31 at 19:36 +0000, dma k wrote:
> Dear OpenSuSE community,
>
> My question is not relevant to programming as such, but for
> development.
>
> I am composing the RPM spec file in which I would like to define the
> following dependency:
>
>
> Code:
> --------------------
> BuildRequires: libstdc++43-devel or libstdc++44-devel or libstdc++45-devel
> --------------------
>
>
> (I have different build environments running different versions of SuSE
> which have different -libstdc-).
>
> I have found the similar question ‘here’
> (http://forums.fedoraforum.org/archive/index.php/t-101804.html). The
> ‘spec’ (http://tinyurl.com/68ohqxb) I’ve found for Fedora says, that
> this syntax is possible, unfortunately it does not work for me for SuSE
> 11.2. ‘This HOWTO’ (http://tinyurl.com/6lfryx) as well as ‘this spec’
> (http://rpm5.org/docs/api/specfile.html) however do not mention about
> this possibility.
>
> If alternative dependency is not supported by SuSE RPM manager, does it
> mean I need to replace the version XX in -libstdc++XX-devel- each time I
> upgrade/migrate to new distro? Is there any other RPM-specific forum or
> maillist where can ask more information?
>
>
Hi
You would use the%if 0%{?suse_version} macro. Have a look here;
http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.29-0.3-default
up 18:56, 2 users, load average: 0.07, 0.04, 0.01
GPU GeForce 8600 GTS Silent - Driver Version: 260.19.26

Thank you for the hint. Indeed the trick with %if 0%{?suse_version} helps in this situation.

I personally think, that having a version in name for binary packages is OK (e.g. libstdc++44, libstdc++45) as it allows to install and use several libraries without conflicts. But the development package should be only one. More over, I found it confusing when I saw both libstdc+±devel-4.5 and libstdc++45-devel-4.5.1 in the repository. And one can’t escape installation of libstdc++45-devel because it is used by gcc45-c++, so what’s the use from libstdc+±devel-4.5?

# rpm -q -requires gcc45-c++
libstdc++45-devel = 4.5.1_20101208-9.8

I think, virtual packages target exactly this kind of problems.