3

The rpm spec file for my package looks like this:

    Requires:mysql-server >= 5.5.30, java >= 1.6, p7zip, openssl >= 1.0.2g

I have an RHEL system where the OpenSSL version is this:

    [ag@rhel1]# openssl
    OpenSSL> version
    OpenSSL 1.0.1e-fips 11 Feb 2013

    [ag@rhel1]# rpm -q --whatprovides openssl
    openssl-1.0.1e-51.el7_2.4.x86_64

When I try to test the install of my rpm package, it is supposed to fail because my package requires a minimum of 1.0.2g whereas 1.0.1e is installed. However, the installation succeeds without any problem. What am I missing here?

Nathan
  • 8,093
  • 8
  • 50
  • 76

2 Answers2

4

The syntax of the value in comparison is: [epoch:]version[-release]. If there is no epoch present, then 0 is assumed.

But OpenSSL have epoch set to 1. See rpm -qi openssl:

Name        : openssl
Epoch       : 1
Version     : 1.0.2g
...

And of course 1:0.0.0 > 0:9999.9999.99999.

So this should work:

Requires: openssl >= 1:1.0.2g
Nathan
  • 8,093
  • 8
  • 50
  • 76
msuchy
  • 5,162
  • 1
  • 14
  • 26
0

On my Opensuse13.1-32bit, OpenSSL has no epoch. It isn't guaranteed that rpm can figure out which version number is more recent than another. In the Maximum Rpm documentation they say:

It's pretty simple to determine that version 1.5 is older than version 1.6. But what about 2.01 and 2.1? Or 7.6a and 7.6? There's no way for RPM to keep up with all the different version-numbering schemes in use.

So, it is possible that rpm just cannot decipher which one is newer between 1.0.2g and 1.0.1e

Nathan
  • 8,093
  • 8
  • 50
  • 76
Chris Maes
  • 35,025
  • 12
  • 111
  • 136
  • 1
    You can always try `rpmdev-vercmp` to see the result. And yes different OS can have different epoch or release. So developer may want to use `%if 0%{rhel}` and similar conditions. – msuchy Apr 21 '16 at 07:57
  • @msuchy tx for the hint on rpmdevtools; I didn't even know they exist and I'm working with rpm for about 2 years now... I'll take a look at them. btw; you have my upvote already :) – Chris Maes Apr 21 '16 at 09:07