summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PHPINFO2
-rw-r--r--REFLECTION5
-rw-r--r--php-pecl-pq.spec98
3 files changed, 43 insertions, 62 deletions
diff --git a/PHPINFO b/PHPINFO
index c72398e..9be5a92 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -2,7 +2,7 @@
pq
PQ Support => enabled
-Extension Version => 2.2.1
+Extension Version => 2.2.2
Used Library => Compiled => Linked
libpq => 14.3 => 14.0.3
diff --git a/REFLECTION b/REFLECTION
index c1a48ff..6260811 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #122 pq version 2.2.1 ] {
+Extension [ <persistent> extension #122 pq version 2.2.2 ] {
- Dependencies {
Dependency [ raphf (Required) ]
@@ -1269,7 +1269,7 @@ Extension [ <persistent> extension #122 pq version 2.2.1 ] {
Class [ <internal:pq> <iterateable> class pq\Result implements IteratorAggregate, Traversable, Countable ] {
- - Constants [21] {
+ - Constants [22] {
Constant [ public int EMPTY_QUERY ] { 0 }
Constant [ public int COMMAND_OK ] { 1 }
Constant [ public int TUPLES_OK ] { 2 }
@@ -1289,6 +1289,7 @@ Extension [ <persistent> extension #122 pq version 2.2.1 ] {
Constant [ public int CONV_SCALAR ] { 15 }
Constant [ public int CONV_ARRAY ] { 16 }
Constant [ public int CONV_DATETIME ] { 32 }
+ Constant [ public int CONV_JSON ] { 256 }
Constant [ public int CONV_BYTEA ] { 8 }
Constant [ public int CONV_ALL ] { 65535 }
}
diff --git a/php-pecl-pq.spec b/php-pecl-pq.spec
index 1eac230..9eab2b8 100644
--- a/php-pecl-pq.spec
+++ b/php-pecl-pq.spec
@@ -6,34 +6,31 @@
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-pq
-%endif
+%{?scl:%scl_package php-pecl-pq}
+
+# Defined in Fedora >= 37 and RHEL >= 10, in PHP >= 7.4 for remirepo
+%{!?__phpize: %global __phpize %{_bindir}/phpize}
+%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize}
+%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config}
+%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config}
# Build using "--without tests" to disable tests
%bcond_without tests
-%global gh_commit e381164032a750583657e449875f62d52b7b6609
-%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
-%global gh_owner m6w6
-%global gh_project ext-pq
-#global gh_date 20150819
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name pq
#global prever RC1
%global ini_name 50-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
+
Summary: PostgreSQL client library (libpq) binding
Name: %{?scl_prefix}php-pecl-%{pecl_name}
-Version: 2.2.1
-%if 0%{?gh_date:1}
-Release: 1%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
-%else
+Version: 2.2.2
Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
-%endif
License: BSD-2-Clause
URL: https://pecl.php.net/package/%{pecl_name}
@@ -64,19 +61,6 @@ 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}
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7
-# Other third party repo stuff
-%if "%{php_version}" > "7.2"
-Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
-
%description
PostgreSQL client library (libpq) binding.
@@ -94,19 +78,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-%if 0%{?ghdate}
-mv %{gh_project}-%{gh_commit} NTS
-mv NTS/package.xml .
-%else
-mv %{pecl_name}-%{version}%{?prever} NTS
-%endif
# Don't install tests
sed -e '/role="test"/d' \
%{?_licensedir: -e '/LICENSE/s/role="doc"/role="src"/' }\
-i package.xml
-cd NTS
+cd %{sources}
# 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
@@ -115,9 +93,9 @@ if test "x${extver}" != "x%{version}%{?prever}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -130,19 +108,20 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -166,7 +145,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -192,11 +171,12 @@ fi
%check
: ignore tests with erratic results
-rm ?TS/tests/cancel001.phpt
-rm ?TS/tests/flush001.phpt
+rm %{sources}/tests/cancel001.phpt
+rm %{sources}/tests/flush001.phpt
%if 0%{?rhel} == 7
: https://github.com/m6w6/ext-pq/issues/42
-rm ?TS/tests/async010.phpt
+rm %{sources}/tests/async010.phpt
+rm %{sources}/tests/gh-issue047_jsonb.phpt
%endif
OPT="-n"
@@ -206,13 +186,13 @@ OPT="-n"
: Minimal load test for NTS extension
%{__php} $OPT \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%if %{with_zts}
: Minimal load test for ZTS extension
%{__ztsphp} $OPT \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%endif
%if %{with tests}
@@ -229,28 +209,24 @@ port = $PORT
EOF
pg_ctl -D $DATABASE -l $PWD/server.log -w -t 200 start
createdb -h localhost -p $PORT rpmtest
-cd NTS
+
+cd %{sources}
sed -e "/PQ_DSN/s/\"host.*\"/'host=localhost port=$PORT dbname=rpmtest'/" \
-i tests/_setup.inc
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="$OPT -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php --show-diff || RET=1
+%{__php} -n run-tests.php -q --show-diff || RET=1
%if %{with_zts}
-cd ../ZTS
-sed -e "/PQ_DSN/s/\"host.*\"/'host=localhost port=$PORT dbname=rpmtest'/" \
- -i tests/_setup.inc
-
: Upstream test suite for ZTS extension
-TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \
-TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_EXECUTABLE=%{__ztsphp} \
+TEST_PHP_ARGS="$OPT -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{_bindir}/zts-php -n run-tests.php --show-diff || RET=1
+%{__ztsphp} -n run-tests.php -q --show-diff || RET=1
%endif
cd ..
@@ -265,7 +241,7 @@ exit $RET
%files
%doc %{pecl_docdir}/%{pecl_name}
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -278,6 +254,10 @@ exit $RET
%changelog
+* Mon Jun 12 2023 Remi Collet <remi@remirepo.net> - 2.2.2-1
+- update to 2.2.2
+- build out of sources tree
+
* Fri Mar 3 2023 Remi Collet <remi@remirepo.net> - 2.2.1-1
- update to 2.2.1