This is a simple library that compares two versions using an algorithm loosely based on the rpmvercmp algorithm.
rpmvercmp