summaryrefslogtreecommitdiffstats
path: root/php-pecl-pq.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-pq.spec')
-rw-r--r--php-pecl-pq.spec167
1 files changed, 83 insertions, 84 deletions
diff --git a/php-pecl-pq.spec b/php-pecl-pq.spec
index 03b7c90..f87d346 100644
--- a/php-pecl-pq.spec
+++ b/php-pecl-pq.spec
@@ -1,53 +1,44 @@
# remirepo spec file for php-pecl-pq
#
-# Copyright (c) 2014-2020 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2014-2024 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-pq
-%endif
+%{?scl:%scl_package php-pecl-pq}
# 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: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 2.1.8
-%if 0%{?gh_date:1}
-Release: 0.10.%{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
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+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;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
-%endif
-License: BSD
+License: BSD-2-Clause
URL: https://pecl.php.net/package/%{pecl_name}
-%if 0%{?fedora} >= 29 && 0%{?rhel} >= 8
+%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
BuildRequires: libpq-devel > 9
%else
BuildRequires: postgresql-devel > 9
%endif
+BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel > 7
+BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-json
-BuildRequires: %{?sub_prefix}php-pecl-raphf-devel >= 1.1.0
+BuildRequires: %{?scl_prefix}php-pecl-raphf-devel >= 1.1.0
%if %{with tests}
BuildRequires: postgresql-server
BuildRequires: postgresql-contrib
@@ -56,39 +47,12 @@ BuildRequires: postgresql-contrib
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-json%{?_isa}
-Requires: %{?sub_prefix}php-raphf%{?_isa} >= 1.1.0
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_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}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
-
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# 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
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
-
-%if 0%{?fedora} < 20 && 0%{?rhel} < 7
-# Filter shared private
-%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
-%{?filter_setup}
-%endif
%description
@@ -107,19 +71,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
@@ -128,9 +86,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
@@ -143,19 +101,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
@@ -179,7 +138,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
@@ -205,8 +164,8 @@ 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
OPT="-n"
[ -f %{php_extdir}/json.so ] && OPT="$OPT -d extension=json.so"
@@ -215,13 +174,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}
@@ -238,28 +197,23 @@ port = $PORT
EOF
pg_ctl -D $DATABASE -l $PWD/server.log -w -t 200 start
createdb -h localhost -p $PORT rpmtest
-cd NTS
-sed -e "/PQ_DSN/s/\"host.*\"/'host=localhost port=$PORT dbname=rpmtest'/" \
- -i tests/_setup.inc
+
+cd %{sources}
+export PQ_DSN="host=localhost port=$PORT dbname=rpmtest"
: 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 ..
@@ -274,7 +228,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}
@@ -287,6 +241,51 @@ exit $RET
%changelog
+* Fri Feb 16 2024 Remi Collet <remi@remirepo.net> - 2.2.3-2
+- F40: fix build dependencies
+
+* Tue Feb 6 2024 Remi Collet <remi@remirepo.net> - 2.2.3-1
+- update to 2.2.3
+- drop patch merged upstream
+
+* Mon Jan 29 2024 Remi Collet <remi@remirepo.net> - 2.2.2-5
+- Fix incompatible pointer types using patch from
+ https://github.com/m6w6/ext-pq/pull/52
+
+* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 2.2.2-2
+- rebuild for PHP 8.3.0RC1
+
+* 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
+
+* Thu Sep 8 2022 Remi Collet <remi@remirepo.net> - 2.2.0-8
+- add upstream patch for 8.2 and from
+ https://github.com/m6w6/ext-pq/pull/44
+
+* Wed Sep 1 2021 Remi Collet <remi@remirepo.net> - 2.2.0-7
+- rebuild for 8.1.0RC1
+
+* Tue Aug 31 2021 Remi Collet <remi@remirepo.net> - 2.2.0-1
+- update to 2.2.0
+
+* Wed Aug 4 2021 Remi Collet <remi@remirepo.net> - 2.1.8-6
+- add patch for 8.1.0beta2 from
+ https://github.com/m6w6/ext-pq/pull/41
+
+* Fri Jun 11 2021 Remi Collet <remi@remirepo.net> - 2.1.8-5
+- add patches for 8.1 from upstream and from
+ https://github.com/m6w6/ext-pq/pull/40
+
+* Fri Apr 30 2021 Remi Collet <remi@remirepo.net> - 2.1.8-4
+- F34 rebuild for https://github.com/remicollet/remirepo/issues/174
+
+* Wed Sep 30 2020 Remi Collet <remi@remirepo.net> - 2.1.8-2
+- rebuild for PHP 8.0.0RC1
+
* Thu Sep 24 2020 Remi Collet <remi@remirepo.net> - 2.1.8-1
- update to 2.1.8