summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-03-13 10:40:39 +0100
committerRemi Collet <remi@remirepo.net>2020-03-13 10:40:39 +0100
commitfb2975ff9c356cdf279a59857d52dc339e2e2a47 (patch)
treebfb7e453878db07b4fb8da35d69f3200c88e9175
parentc61d69885ee01c881479f9afcdbe79af8af14545 (diff)
Fix build with RPM 4.11 (EL-7)
-rw-r--r--config.m43
-rw-r--r--rpminfo.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/config.m4 b/config.m4
index ef96f22..650eb05 100644
--- a/config.m4
+++ b/config.m4
@@ -15,6 +15,9 @@ if test "$PHP_RPMINFO" != "no"; then
LIBRPM_LIBDIR=`$PKG_CONFIG rpm --libs`
LIBRPM_VERSON=`$PKG_CONFIG rpm --modversion`
AC_MSG_RESULT(from pkgconfig: version $LIBRPM_VERSON)
+ if $PKG_CONFIG rpm --atleast-version 4.12; then
+ AC_DEFINE(HAVE_WEAKDEP, 1, [ Weak dependencies in RPM 4.12 ])
+ fi
else
AC_MSG_ERROR(system librpm is too old: version 4.11.3 required)
fi
diff --git a/rpminfo.c b/rpminfo.c
index 53e4c6a..2eb3e0c 100644
--- a/rpminfo.c
+++ b/rpminfo.c
@@ -326,13 +326,15 @@ static int haveIndex(zend_long tag) {
tag == RPMDBI_INSTALLTID ||
tag == RPMDBI_SIGMD5 ||
tag == RPMDBI_SHA1HEADER ||
- tag == RPMDBI_INSTFILENAMES ||
+#ifdef HAVE_WEAKDEP
tag == RPMDBI_FILETRIGGERNAME ||
tag == RPMDBI_TRANSFILETRIGGERNAME ||
tag == RPMDBI_RECOMMENDNAME ||
tag == RPMDBI_SUGGESTNAME ||
tag == RPMDBI_SUPPLEMENTNAME ||
- tag == RPMDBI_ENHANCENAME) {
+ tag == RPMDBI_ENHANCENAME ||
+#endif
+ tag == RPMDBI_INSTFILENAMES) {
return 1;
}
return 0;