diff options
author | Remi Collet <remi@remirepo.net> | 2025-07-17 15:29:54 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2025-07-17 15:29:54 +0200 |
commit | 79b3e7e626a8dbb1d1dc3df28bbc9d73ad0a623c (patch) | |
tree | 0d2bd4352ad4911c92ab5052b53f63d460b7e8b8 | |
parent | 70ff61deb44feedf88dcc5abcc1012d398612951 (diff) |
https://github.com/php/pecl-database-mysql/pull/5
re-license spec file to CECILL-2.1
-rw-r--r-- | 5.patch | 41 | ||||
-rw-r--r-- | php-pecl-mysql.spec | 98 |
2 files changed, 77 insertions, 62 deletions
@@ -0,0 +1,41 @@ +From 9b287982cc72b7dae052906550bbaaae690bf3a7 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 17 Jul 2025 15:25:53 +0200 +Subject: [PATCH] use zend_ce_exception instead of zend_exception_get_default() + for 8.5 + +--- + php_mysql.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/php_mysql.c b/php_mysql.c +index c5b03e5..1e5ac5d 100644 +--- a/php_mysql.c ++++ b/php_mysql.c +@@ -2313,7 +2313,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ + * single value is an array. Also we'd have to make that one + * argument passed by reference. + */ +- zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0); ++ zend_throw_exception(zend_ce_exception, "Parameter ctor_params must be an array", 0); + return; + } + } +@@ -2331,7 +2331,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ + fcc.object = Z_OBJ_P(return_value); + + if (zend_call_function(&fci, &fcc) == FAILURE) { +- zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name)); ++ zend_throw_exception_ex(zend_ce_exception, 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name)); + } else { + if (!Z_ISUNDEF(retval)) { + zval_ptr_dtor(&retval); +@@ -2341,7 +2341,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ + efree(fci.params); + } + } else if (ctor_params) { +- zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name)); ++ zend_throw_exception_ex(zend_ce_exception, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name)); + } + } + diff --git a/php-pecl-mysql.spec b/php-pecl-mysql.spec index a2a020f..e4949a9 100644 --- a/php-pecl-mysql.spec +++ b/php-pecl-mysql.spec @@ -1,15 +1,12 @@ # remirepo spec file for php-pecl-mysql # -# Copyright (c) 2013-2021 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2013-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build - %if 0%{?scl:1} %scl_package php-pecl-mysql %else @@ -17,6 +14,8 @@ %global _root_libexecdir %{_libexecdir} %endif +%bcond_with tests + # https://github.com/php/pecl-database-mysql/commits/master %global gh_commit ca514c4dfacd7f1495d2fe142101fe3d91494d12 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) @@ -25,16 +24,17 @@ %global gh_date 20210423 %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name mysql -%global with_tests 0%{?_with_tests:1} # After 40-mysqlnd %global ini_name 50-%{pecl_name}.ini %global mysql_sock %(mysql_config --socket 2>/dev/null || echo /var/lib/mysql/mysql.sock) +%global sources %{gh_project}-%{gh_commit} +%global _configure ../%{sources}/configure Summary: MySQL database access functions Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 1.0.0 %if 0%{?gh_date:1} -Release: 0.25.%{gh_date}.%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 0.27.%{gh_date}.%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %else Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %endif @@ -44,19 +44,20 @@ URL: https://pecl.php.net/package/%{pecl_name} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz Source1: %{pecl_name}.ini +Patch0: 5.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.0 BuildRequires: %{?scl_prefix}php-mysqlnd BuildRequires: %{?scl_prefix}php-pear -%if %{with_tests} +%if %{with tests} BuildRequires: mariadb-server %endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-mysqlnd%{?_isa} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} # Set epoch so provides is > 0:7.0.0 (obsoleted by php-mysqlnd) Provides: %{?scl_prefix}php-%{pecl_name} = 1:%{version} @@ -64,19 +65,6 @@ Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = 1:%{version} Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -# Other third party repo stuff -%if "%{php_version}" > "7.3" -Obsoletes: php73-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.4" -Obsoletes: php74-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.0" -Obsoletes: php80-pecl-%{pecl_name} <= %{version} -%endif -%endif - %description This extension provides the mysql family of functions that were provided @@ -92,9 +80,8 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc -mv %{gh_project}-%{gh_commit} NTS %{__php} -r ' - $pkg = simplexml_load_file("NTS/package.xml"); + $pkg = simplexml_load_file("%{sources}/package.xml"); $pkg->date = substr("%{gh_date}",0,4)."-".substr("%{gh_date}",4,2)."-".substr("%{gh_date}",6,2); $pkg->version->release = "%{version}dev"; $pkg->stability->release = "devel"; @@ -103,10 +90,12 @@ mv %{gh_project}-%{gh_commit} NTS # Don't install (register) the tests sed -e 's/role="test"/role="src"/' \ - %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ + -e '/LICENSE/s/role="doc"/role="src"/' \ -i package.xml -cd NTS +cd %{sources} +%patch -P0 -p1 + # Check version as upstream often forget to update this extver=$(sed -n '/#define PHP_MYSQL_VERSION/{s/.* "//;s/".*$//;p}' php_mysql.h) if test "x${extver}" != "x%{version}%{?prever}%{?gh_date:-dev}"; then @@ -115,10 +104,9 @@ if test "x${extver}" != "x%{version}%{?prever}%{?gh_date:-dev}"; then fi cd .. - +mkdir NTS %if %{with_zts} -# duplicate for ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif @@ -132,15 +120,16 @@ peclconf() { --with-php-config=$1 } -cd NTS -%{_bindir}/phpize -peclconf %{_bindir}/php-config +cd %{sources} +%{__phpize} + +cd ../NTS +peclconf %{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize -peclconf %{_bindir}/zts-php-config +peclconf %{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -163,7 +152,7 @@ install -D -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/%{ini_name} # Documentation for i in LICENSE $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do [ -f NTS/$i ] && install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +do [ -f %{sources}/$i ] && install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done @@ -171,14 +160,12 @@ done cd NTS : Minimal load test for NTS extension -%{_bindir}/php --no-php-ini \ +%{__php} --no-php-ini \ --define extension=mysqlnd.so \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' %if %{with_zts} -cd ../ZTS - : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ --define extension=mysqlnd.so \ @@ -187,8 +174,7 @@ cd ../ZTS %endif -%if %{with_tests} -cd ../NTS +%if %{with tests} RET=0 : Running a server @@ -244,28 +230,8 @@ exit $RET %endif -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi -%endif - - %files -%{?_licensedir:%license NTS/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -279,6 +245,14 @@ fi %changelog +* Thu Jul 17 2025 Remi Collet <remi@remirepo.net> - 1.0.0-0.27.20210423.ca514c4 +- add fix for PHP 8.5.0alpha2 using patch from + https://github.com/php/pecl-database-mysql/pull/5 +- re-license spec file to CECILL-2.1 + +* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 1.0.0-0.26.20210423.ca514c4 +- buld out of sources tree + * Thu Sep 9 2021 Remi Collet <remi@remirepo.net> - 1.0.0-0.25.20210423.ca514c4 - refresh to more recent snapshot for PHP 8.1 |