summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--53.patch24
-rw-r--r--php-pecl-pq.spec76
2 files changed, 62 insertions, 38 deletions
diff --git a/53.patch b/53.patch
new file mode 100644
index 0000000..ed40ab8
--- /dev/null
+++ b/53.patch
@@ -0,0 +1,24 @@
+From da7fe208d67f10ed106aec33163496e42a129022 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 8 Jul 2025 15:07:07 +0200
+Subject: [PATCH] Relax text expectation (for 8.5)
+
+-Warning: fclose(): %d is not a valid stream resource in ...
++Warning: fclose(): cannot close the provided stream, as it must not be manually closed in ...
+---
+ tests/lob003.phpt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/lob003.phpt b/tests/lob003.phpt
+index f6d846e..c25dac7 100644
+--- a/tests/lob003.phpt
++++ b/tests/lob003.phpt
+@@ -25,7 +25,7 @@ Test
+ resource(%d) of type (stream)
+ resource(%d) of type (stream)
+
+-Warning: fclose(): %d is not a valid stream resource in %s on line %d
++Warning: fclose(): %s in %s on line %d
+ resource(%d) of type (stream)
+ string(0) ""
+ DONE
diff --git a/php-pecl-pq.spec b/php-pecl-pq.spec
index f87d346..35ab051 100644
--- a/php-pecl-pq.spec
+++ b/php-pecl-pq.spec
@@ -1,8 +1,8 @@
# remirepo spec file for php-pecl-pq
#
-# Copyright (c) 2014-2024 Remi Collet
-# License: CC-BY-SA-4.0
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2014-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
@@ -13,6 +13,8 @@
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name pq
+%global pie_vend m6w6
+%global pie_proj ext-pq
#global prever RC1
%global ini_name 50-%{pecl_name}.ini
@@ -23,16 +25,14 @@
Summary: PostgreSQL client library (libpq) binding
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 2.2.3
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
License: BSD-2-Clause
URL: https://pecl.php.net/package/%{pecl_name}
-%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
+Patch0: 53.patch
+
BuildRequires: libpq-devel > 9
-%else
-BuildRequires: postgresql-devel > 9
-%endif
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
@@ -49,10 +49,15 @@ Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-json%{?_isa}
Requires: %{?scl_prefix}php-raphf%{?_isa} >= 1.1.0
-Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
-Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+# Extension
+Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
+Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
+# PECL
+Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+# PIE
+Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version}
+Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version}
%description
@@ -74,10 +79,12 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
# Don't install tests
sed -e '/role="test"/d' \
- %{?_licensedir: -e '/LICENSE/s/role="doc"/role="src"/' }\
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-i package.xml
cd %{sources}
+%patch -P0 -p1 -b .pr53
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_PQ_VERSION/{s/.* "//;s/".*$//;p}' php_pq.h)
if test "x${extver}" != "x%{version}%{?prever}"; then
@@ -103,26 +110,30 @@ EOF
cd %{sources}
%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
cd ../NTS
%configure \
--with-libdir=%{_lib} \
--with-php-config=%{__phpconfig}
-make %{?_smp_mflags}
+
+%make_build
%if %{with_zts}
cd ../ZTS
%configure \
--with-libdir=%{_lib} \
--with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# install config file
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -131,7 +142,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -142,26 +153,6 @@ do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%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
-
-
%check
: ignore tests with erratic results
rm %{sources}/tests/cancel001.phpt
@@ -228,7 +219,7 @@ exit $RET
%files
%doc %{pecl_docdir}/%{pecl_name}
-%{?_licensedir:%license %{sources}/LICENSE}
+%license %{sources}/LICENSE
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -241,6 +232,15 @@ exit $RET
%changelog
+* Wed Jul 30 2025 Remi Collet <remi@remirepo.net> - 2.2.3-4
+- ignore 1 test failing with 8.5.0alpha3 reported as
+ https://github.com/m6w6/ext-pq/issues/54
+
+* Tue Jul 8 2025 Remi Collet <remi@remirepo.net> - 2.2.3-3
+- re-license spec file to CECILL-2.1
+- add patch for test suite with PHP 8.5 from
+ https://github.com/m6w6/ext-pq/pull/53
+
* Fri Feb 16 2024 Remi Collet <remi@remirepo.net> - 2.2.3-2
- F40: fix build dependencies