2

Is there a way in the rpm spec file to specify as build requirement packageX or packageY.

Current nodejs 4.1 requires g++>=4.8 or clang++>=3.4 to be able to build the package.

This is only a requirement to build the rpm not a requirement of the package to work after install. I don't know how to specify that or if it is possible at all with BuildRequires.

paulsm25
  • 61
  • 5
  • 1
    This is now possible as of RPM 4.13. https://fedoraproject.org/wiki/Packaging:Guidelines#Rich.2FBoolean_dependencies http://www.rpm.org/wiki/PackagerDocs/BooleanDependencies – carlwgeorge Mar 03 '16 at 03:10

2 Answers2

1

It is not possible to specify X or Y with rpm spec.

But, what you can do is specify dependency on a filepath, for example:

BuildRequires: /usr/bin/sudo

yum-builddeps will then look for a package that provides the specific file. For this to work both X and Y have to provide a file wih same path.

Jakov Sosic
  • 5,157
  • 3
  • 22
  • 33
  • This answer is wrong. In a spec file, you can specify build requirements by package name, virtual provides, or file path. – carlwgeorge Feb 24 '16 at 00:29
  • To use virtual provides, X and Y both have to have exactly the same provide. To use filepath, both of them have to have same filepath. I don't see my answer in collision with your comment. – Jakov Sosic Feb 28 '16 at 14:36
  • Ahhh I think I misread the original question. Sorry about that. – carlwgeorge Feb 29 '16 at 17:40
  • It happens! PS. kudos for IUS packages, they're awesome :) – Jakov Sosic Mar 01 '16 at 14:20
  • No problem, I enjoy maintaining IUS. I want to remove my downvote on your answer since I'm an idiot, but the site is telling me I can't unless you edit it. If you edit your answer in some way (add a space?) then I'll remove the downvote (that is if you care about fake internet points). – carlwgeorge Mar 03 '16 at 03:09
0

Node.js is dependant on some libraries. In your specific case it is very unwise to allow to build node.js with just any compiler - you see, node.js, as any other library-dependant software should be built with same compiler familey, as the libraries it depends on are built. This isn't the strict rule, however - everything may be just OK when using different compiler families. But in many cases the dynamic loader will be unable to resolve specific symbols due to different symbol mangling algorythms (and I, for example, has seens such cases), so unless you made all the needed precautions to exclude this possibility, you probably should not rely on it. So I guess your spec file should be more specific, or may be you should create multiple srpms for cases with different compilers.

P.S. I think this question would better fit to the SE portal.

drookie
  • 8,051
  • 1
  • 17
  • 27