diff options
| author | Remi Collet <remi@remirepo.net> | 2026-07-16 07:27:30 +0200 |
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2026-07-16 07:27:30 +0200 |
| commit | 54ade05cb27510ba6f2a5e82910e236b459832e2 (patch) | |
| tree | c2af30254401a9135bc0b7fdb091b475dc337464 | |
| parent | a565dbb56b32a0e9b177d49f0963705a3cef2f1f (diff) | |
| -rw-r--r-- | php-pecl-rpminfo.spec | 29 | ||||
| -rw-r--r-- | php86.patch | 128 |
2 files changed, 149 insertions, 8 deletions
diff --git a/php-pecl-rpminfo.spec b/php-pecl-rpminfo.spec index dd2a3e2..54cea1f 100644 --- a/php-pecl-rpminfo.spec +++ b/php-pecl-rpminfo.spec @@ -20,22 +20,24 @@ %global _configure ../%{sources}/configure # Github forge -%global gh_vend remicollet -%global gh_proj rpminfo -%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} -%global tag v%{version} +%global gh_vend remicollet +%global gh_proj rpminfo +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +%global tag v%{version} # for EL-8 to avoid TAG usage -%global archivename %{gh_proj}-%{version} +%global archivename %{gh_proj}-%{version} Summary: RPM information Name: %{?scl_prefix}php-pecl-%{pecl_name} +License: PHP-3.01 Version: 1.2.1 +Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} %forgemeta -Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} -License: PHP-3.01 URL: %{forgeurl} Source0: %{forgesource} +Patch0: php86.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: pkgconfig(rpm) >= 4.13 @@ -55,7 +57,13 @@ Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %if 0%{?rhel} >= 10 && "%{?vendeur}" == "remi" && 0%{!?scl:1} -%if "%{php_version}" >= "8.5" +%if "%{php_version}" >= "8.6" +Obsoletes: php8.4-pecl-%{pecl_name} <= %{version} +Obsoletes: php8.5-pecl-%{pecl_name} <= %{version} +Obsoletes: php8.6-pecl-%{pecl_name} <= %{version} +Provides: php8.6-pecl-%{pecl_name} = %{version}-%{release} +Provides: php8.6-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +%elif "%{php_version}" >= "8.5" Obsoletes: php8.4-pecl-%{pecl_name} <= %{version} Obsoletes: php8.5-pecl-%{pecl_name} <= %{version} Provides: php8.5-pecl-%{pecl_name} = %{version}-%{release} @@ -81,6 +89,8 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %setup -q -c cd %{sources} +%patch -P0 -p1 + # Sanity check, really often broken extver=$(sed -n '/#define PHP_RPMINFO_VERSION/{s/.* "//;s/".*$//;p}' php_rpminfo.h) if test "x${extver}" != "x%{version}"; then @@ -199,6 +209,9 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}/%{php_ztsextdir}/%{pecl_name}.so" \ %changelog +* Thu Jul 16 2026 Remi Collet <remi@remirepo.net> - 1.2.1-3 +- upstream patch for PHP 8.6.0alpha2 + * Thu Mar 12 2026 Remi Collet <remi@remirepo.net> - 1.2.1-2 - drop pear/pecl dependency - sources from github diff --git a/php86.patch b/php86.patch new file mode 100644 index 0000000..6b86de1 --- /dev/null +++ b/php86.patch @@ -0,0 +1,128 @@ +From 8ba604b2a97d8433d0b5691f92dc022adf229725 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 26 Jun 2026 08:14:44 +0200 +Subject: [PATCH 1/3] zval_dtor remomved in 8.6 + +--- + rpminfo.c | 2 +- + tests/008-rpmdbsearch.phpt | 4 +++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/rpminfo.c b/rpminfo.c +index ee6e0c6..c90be1e 100644 +--- a/rpminfo.c ++++ b/rpminfo.c +@@ -234,7 +234,7 @@ PHP_FUNCTION(rpminfo) + } + if (error) { + ZVAL_DEREF(error); +- zval_dtor(error); ++ zval_ptr_dtor_nogc(error); + ZVAL_NULL(error); + } + if (php_check_open_basedir(path)) { +diff --git a/tests/008-rpmdbsearch.phpt b/tests/008-rpmdbsearch.phpt +index 6e0e402..2bd04f1 100644 +--- a/tests/008-rpmdbsearch.phpt ++++ b/tests/008-rpmdbsearch.phpt +@@ -2,7 +2,9 @@ + Check for rpmdbinfo function + --SKIPIF-- + <?php +-if (!extension_loaded("rpminfo")) print "skip"; ++if (!extension_loaded("rpminfo")) dir('skip extension missing'); ++$a = rpmdbsearch(PHP_BINARY, RPMTAG_INSTFILENAMES); ++if (is_null($a)) die('skip PHP installed from sources'); + ?> + + --FILE-- +-- +2.55.0 + +From 4f2744656cad572fe8ebe91cb0dc13b03069e569 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 26 Jun 2026 09:34:58 +0200 +Subject: [PATCH 2/3] simplify previous + +--- + rpminfo.c | 6 ++---- + tests/006-rpminfo-errors.phpt | 1 + + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/rpminfo.c b/rpminfo.c +index c90be1e..1183ff5 100644 +--- a/rpminfo.c ++++ b/rpminfo.c +@@ -233,9 +233,7 @@ PHP_FUNCTION(rpminfo) + RETURN_THROWS(); + } + if (error) { +- ZVAL_DEREF(error); +- zval_ptr_dtor_nogc(error); +- ZVAL_NULL(error); ++ ZEND_TRY_ASSIGN_REF_NULL(error); + } + if (php_check_open_basedir(path)) { + RETURN_NULL(); +@@ -268,7 +266,7 @@ PHP_FUNCTION(rpminfo) + } + if (e_len) { + if (error) { +- ZVAL_STRINGL(error, e_msg, e_len); ++ ZEND_TRY_ASSIGN_REF_STRINGL(error, e_msg, e_len); + } else { + php_error_docref(NULL, E_WARNING, "%s", e_msg); + } +diff --git a/tests/006-rpminfo-errors.phpt b/tests/006-rpminfo-errors.phpt +index 5d205d7..007ed5c 100644 +--- a/tests/006-rpminfo-errors.phpt ++++ b/tests/006-rpminfo-errors.phpt +@@ -9,6 +9,7 @@ var_dump(rpminfo(__DIR__ . "/missing.rpm")); + var_dump(rpminfo(__FILE__)); + + echo "\n+ PHP Warnings\n"; ++$error='xxx'; + var_dump(rpminfo(__DIR__ . "/missing.rpm", true, $error), + $error); + var_dump(rpminfo(__FILE__, false, $error), +-- +2.55.0 + +From 12e2cba1a2c33e3d709c6e1a4246ba236670c77f Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 26 Jun 2026 09:44:23 +0200 +Subject: [PATCH 3/3] improve rpminfo errors test + +--- + tests/006-rpminfo-errors.phpt | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tests/006-rpminfo-errors.phpt b/tests/006-rpminfo-errors.phpt +index 007ed5c..bf3a5f6 100644 +--- a/tests/006-rpminfo-errors.phpt ++++ b/tests/006-rpminfo-errors.phpt +@@ -7,8 +7,9 @@ Check for rpminfo function errors + echo "+ PHP Warnings\n"; + var_dump(rpminfo(__DIR__ . "/missing.rpm")); + var_dump(rpminfo(__FILE__)); ++var_dump(is_array(rpminfo(__DIR__ . "/bidon.rpm"))); + +-echo "\n+ PHP Warnings\n"; ++echo "\n+ Error returned\n"; + $error='xxx'; + var_dump(rpminfo(__DIR__ . "/missing.rpm", true, $error), + $error); +@@ -26,8 +27,9 @@ NULL + + Warning: rpminfo(): Can't read '%s/tests/006-rpminfo-errors.php': Argument is not a RPM file in %s on line %d + NULL ++bool(true) + +-+ PHP Warnings +++ Error returned + NULL + string(%d) "Can't open '%s/tests/missing.rpm': No such file or directory" + NULL +-- +2.55.0 + |
