3

I want to build RPM files and I want them to be commonly used and beeing not depending on which distribution is installed. Now I found a requirement which name is different on RHEL and SLES. I found this as possible solution:

%if 0%{?suse_version}
 Requires:       jdk >= 2000:1.8.0_00-fcs, netcat, telnet, at
%else
 Requires:       jdk >= 2000:1.8.0_00-fcs, nc, telnet, at
%endif

But my problem with is, that it's an if query for the Build process, what I wish to have is depending on the distribution I install, the already build rpm file would solve this. Because with this solution, I would need to build RPM files for every kind of centos and rhel and sles distribution on all these different OSes while only the name of nc and netcat differ as Required packages.

Any idea how I can do that?

Thanks

Andreas Hubert
  • 381
  • 6
  • 18

2 Answers2

1

rpm-4.13 will solve my issue: http://www.rpm.org/wiki/PackagerDocs/BooleanDependencies

or - requires one of the operands to be fulfilled
Requires: (pkgA >= 3.2 or pkgB)
Andreas Hubert
  • 381
  • 6
  • 18
0

You cannot do what you are asking at install-time. However, you can require the executable itself, e.g. /bin/netcat and it should work... unless it was part of the great UsrMove...

Aaron D. Marasco
  • 6,506
  • 3
  • 26
  • 39