summaryrefslogtreecommitdiff
path: root/libappstream-glib
diff options
context:
space:
mode:
Diffstat (limited to 'libappstream-glib')
-rw-r--r--libappstream-glib/as-utils.c8
-rw-r--r--libappstream-glib/meson.build4
2 files changed, 12 insertions, 0 deletions
diff --git a/libappstream-glib/as-utils.c b/libappstream-glib/as-utils.c
index e475c65..6f46e52 100644
--- a/libappstream-glib/as-utils.c
+++ b/libappstream-glib/as-utils.c
@@ -40,6 +40,10 @@
#include <stdlib.h>
#include <uuid.h>
+#ifdef HAVE_RPM
+#include <rpm/rpmlib.h>
+#endif
+
#include "as-app-private.h"
#include "as-enums.h"
#include "as-node.h"
@@ -1465,7 +1469,11 @@ as_utils_vercmp_full (const gchar *version_a,
g_autofree gchar *str_b = as_utils_version_parse (version_b);
return as_utils_vercmp_internal (str_a, str_b);
} else {
+#ifdef HAVE_RPM
+ return rpmvercmp (version_a, version_b);
+#else
return as_utils_vercmp_internal (version_a, version_b);
+#endif
}
}
diff --git a/libappstream-glib/meson.build b/libappstream-glib/meson.build
index 3de5881..5f726b0 100644
--- a/libappstream-glib/meson.build
+++ b/libappstream-glib/meson.build
@@ -17,6 +17,10 @@ if get_option('dep11')
deps += yaml
endif
+if get_option('rpm')
+ deps += rpm
+endif
+
if get_option('stemmer')
deps += stemmer
endif