summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.m49
-rw-r--r--package.xml8
-rw-r--r--rpminfo.c12
-rw-r--r--rpminfo.stub.php2
-rw-r--r--rpminfo_arginfo.h8
5 files changed, 6 insertions, 33 deletions
diff --git a/config.m4 b/config.m4
index d0e2565..abff0a9 100644
--- a/config.m4
+++ b/config.m4
@@ -5,18 +5,11 @@ PHP_ARG_ENABLE(rpminfo, whether to enable rpminfo support,
if test "$PHP_RPMINFO" != "no"; then
- PKG_CHECK_MODULES([LIBRPM], [rpm >= 4.11.3])
+ PKG_CHECK_MODULES([LIBRPM], [rpm >= 4.13])
PHP_EVAL_LIBLINE($LIBRPM_LIBS, RPMINFO_SHARED_LIBADD)
PHP_EVAL_INCLINE($LIBRPM_CFLAGS)
- AC_MSG_CHECKING(for rpm >= 4.13)
- PKG_CHECK_EXISTS([rpm >= 4.13],
- AC_DEFINE(HAVE_ARCHIVE, 1, [ Archive reader since RPM 4.13 ])
- AC_DEFINE(HAVE_WEAKDEP, 1, [ Indexes on weak dependency field since RPM 4.13 ])
- AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])
- )
-
PHP_SUBST(RPMINFO_SHARED_LIBADD)
PHP_NEW_EXTENSION(rpminfo, rpminfo.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
diff --git a/package.xml b/package.xml
index ff6a59e..196b964 100644
--- a/package.xml
+++ b/package.xml
@@ -23,10 +23,10 @@ Documentation: https://www.php.net/rpminfo
<api>stable</api>
</stability>
<license uri="https://www.php.net/license/3_01.txt" filesource="LICENSE">PHP-3.01</license>
- <notes>
-- check open_basedir restriction
-- new function: rpmgetsymlink(string $path, string $name): ?string
- </notes>
+ <notes><![CDATA[
+- display author and license in phpinfo
+- drop support for librpm < 4.13
+ ]]></notes>
<contents>
<dir name="/">
<!-- sources -->
diff --git a/rpminfo.c b/rpminfo.c
index e3fc4f5..55a5351 100644
--- a/rpminfo.c
+++ b/rpminfo.c
@@ -35,7 +35,6 @@
#include "rpminfo_arginfo.h"
-#ifdef HAVE_ARCHIVE
struct php_rpm_stream_data_t {
FD_t gzdi;
Header h;
@@ -46,7 +45,6 @@ struct php_rpm_stream_data_t {
#define STREAM_DATA_FROM_STREAM() \
struct php_rpm_stream_data_t *self = (struct php_rpm_stream_data_t *) stream->abstract;
-#endif
ZEND_DECLARE_MODULE_GLOBALS(rpminfo)
@@ -349,14 +347,12 @@ static int haveIndex(zend_long tag) {
tag == RPMDBI_INSTALLTID ||
tag == RPMDBI_SIGMD5 ||
tag == RPMDBI_SHA1HEADER ||
-#ifdef HAVE_WEAKDEP
tag == RPMDBI_FILETRIGGERNAME ||
tag == RPMDBI_TRANSFILETRIGGERNAME ||
tag == RPMDBI_RECOMMENDNAME ||
tag == RPMDBI_SUGGESTNAME ||
tag == RPMDBI_SUPPLEMENTNAME ||
tag == RPMDBI_ENHANCENAME ||
-#endif
tag == RPMDBI_INSTFILENAMES) {
return 1;
}
@@ -578,7 +574,6 @@ PHP_FUNCTION(rpmaddtag)
}
/* }}} */
-#ifdef HAVE_ARCHIVE
static ssize_t php_rpm_ops_read(php_stream *stream, char *buf, size_t count)
{
ssize_t n = -1;
@@ -871,7 +866,6 @@ PHP_FUNCTION(rpmgetsymlink)
Fclose(gzdi);
}
/* }}} */
-#endif /* HAVE_ARCHIVE */
/* {{{ PHP_MINIT_FUNCTION
@@ -919,9 +913,7 @@ PHP_MINIT_FUNCTION(rpminfo)
}
rpmtdFree(names);
-#ifdef HAVE_ARCHIVE
php_register_url_stream_wrapper("rpm", &php_stream_rpm_wrapper);
-#endif
return SUCCESS;
}
@@ -977,11 +969,7 @@ PHP_MINFO_FUNCTION(rpminfo)
php_info_print_table_row(2, "Author", PHP_RPMINFO_AUTHOR);
php_info_print_table_row(2, "License", PHP_RPMINFO_LICENSE);
php_info_print_table_row(2, "RPM library version", RPMVERSION);
-#ifdef HAVE_ARCHIVE
php_info_print_table_row(2, "RPM stream wrapper", "yes");
-#else
- php_info_print_table_row(2, "RPM stream wrapper", "no");
-#endif
php_info_print_table_end();
/* Remove comments if you have entries in php.ini
diff --git a/rpminfo.stub.php b/rpminfo.stub.php
index 7e6e32e..aa87215 100644
--- a/rpminfo.stub.php
+++ b/rpminfo.stub.php
@@ -12,6 +12,4 @@ function rpminfo(string $path, bool $full = false, ?string &$error = null): Arra
function rpmvercmp(string $evr1, string $evr2, ?string $operator = null): int|bool {}
-#ifdef HAVE_ARCHIVE
function rpmgetsymlink(string $path, string $name): string|null {}
-#endif
diff --git a/rpminfo_arginfo.h b/rpminfo_arginfo.h
index aa0e1d3..0764f6f 100644
--- a/rpminfo_arginfo.h
+++ b/rpminfo_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e65e33b4f6ebedcc7ef3030714ebf7e4c06f2778 */
+ * Stub hash: 6b129e53b21eb21027683874775c2cdb7d1d485d */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rpmaddtag, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, rpmtag, IS_LONG, 0)
@@ -29,12 +29,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_rpmvercmp, 0, 2, MAY_BE_LONG|MAY
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, operator, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
-#if defined(HAVE_ARCHIVE)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rpmgetsymlink, 0, 2, IS_STRING, 1)
ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_END_ARG_INFO()
-#endif
ZEND_FUNCTION(rpmaddtag);
@@ -42,9 +40,7 @@ ZEND_FUNCTION(rpmdbinfo);
ZEND_FUNCTION(rpmdbsearch);
ZEND_FUNCTION(rpminfo);
ZEND_FUNCTION(rpmvercmp);
-#if defined(HAVE_ARCHIVE)
ZEND_FUNCTION(rpmgetsymlink);
-#endif
static const zend_function_entry ext_functions[] = {
@@ -53,8 +49,6 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(rpmdbsearch, arginfo_rpmdbsearch)
ZEND_FE(rpminfo, arginfo_rpminfo)
ZEND_FE(rpmvercmp, arginfo_rpmvercmp)
-#if defined(HAVE_ARCHIVE)
ZEND_FE(rpmgetsymlink, arginfo_rpmgetsymlink)
-#endif
ZEND_FE_END
};