trac#355: Do not use rpmvercmp to compare EntityStateEVRStringType as it is
trac#355: Do not use rpmvercmp to compare EntityStateEVRStringType as it is

Make a use of rpmEVRcmp (or something like that) instead.

This change is not fully in line with the current OVAL specification
(version 5.10.1) regarding EntityStateEVRStringType which reads:

    Comparisons involving this datatype should follow
    the algorithm of librpm's rpmvercmp() function.

However, this wording of specification needs to be amended to better
reflect reality of librpm (and dependant ecosystem). Librpm never
uses rpmvercmp for comparison of EVR literals (Epoch:Version-Release).

Librpm approaches EVR literals comparison in the way as folows:

  * (parse EVR to Epoch:Version-Release)
  * compare Epoch numbers first
  * if that equals -> compare Version by rpmvercmp
  * if that equals -> compare Release by rpmvercmp

Hence, librpm uses rpmvercmp function iteratively. It does never
compare EVR as it is by rpmvercmp.

Note that rpmdev-vercmp tool compares even epochs using rpmvercmp.
These two approaches are more-or-less equivalent. The later allows
for greater flexibility in Epoch literal.

By way of example, in the rpm word:

    0:0.4.20.1-6.el5 is greater then 0:0.4.20-33.el5_5.2

in the OVAL word, on the other hand:

    0:0.4.20.1-6.el5 is lesser then 0:0.4.20-33.el5_5.2

That makes OVAL inconsistent with characteristics of the underlying
word.

And finally note for the implementation: Sadly, librpm version 4 does
not export anything like rpmEVRcmp for an external use. OpenSCAP
needs to copy several static functions from librpm version 4 to
minic rpmEVRcmp of rpm5.

mpreisler/openscap,OpenSCAP/openscap,redhatrises/openscap,Hexadorsimal/openscap,jan-cerny/openscap,redhatrises/openscap,mpreisler/openscap,redhatrises/openscap,isimluk/openscap,ybznek/openscap,OpenSCAP/openscap,OpenSCAP/openscap,Hexadorsimal/openscap,redhatrises/openscap,ybznek/openscap,redhatrises/openscap,isimluk/openscap,openprivacy/openscap,ybznek/openscap,jan-cerny/openscap,OpenSCAP/openscap,postfix/openscap,isimluk/openscap,isimluk/openscap,mpreisler/openscap,OpenSCAP/openscap,postfix/openscap,postfix/openscap,openprivacy/openscap,jan-cerny/openscap,postfix/openscap,openprivacy/openscap,Hexadorsimal/openscap,openprivacy/openscap,Hexadorsimal/openscap,jan-cerny/openscap,mpreisler/openscap,ybznek/openscap,mpreisler/openscap,Hexadorsimal/openscap,openprivacy/openscap,postfix/openscap,postfix/openscap,jan-cerny/openscap,Hexadorsimal/openscap,redhatrises/openscap,isimluk/openscap,ybznek/openscap,isimluk/openscap,OpenSCAP/openscap,mpreisler/openscap,ybznek/openscap,openprivacy/openscap,jan-cerny/openscap