From 562cf6c1bbe02f1986d5d657aa45a7d70ca90460 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 10 Apr 2025 10:06:42 +0200 Subject: resync --- php-pecl-mongodb2.spec | 425 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 328 insertions(+), 97 deletions(-) (limited to 'php-pecl-mongodb2.spec') diff --git a/php-pecl-mongodb2.spec b/php-pecl-mongodb2.spec index 3a60caa..894d8a2 100644 --- a/php-pecl-mongodb2.spec +++ b/php-pecl-mongodb2.spec @@ -1,97 +1,109 @@ # remirepo spec file for php-pecl-mongodb # -# Copyright (c) 2015-2025 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2015-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} -%global sub_prefix %{scl_prefix} %scl_package php-pecl-mongodb %else %global _root_prefix %{_prefix} %endif %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global pie_vend mongodb +%global pie_proj mongodb-extension %global pecl_name mongodb -%if "%{php_version}" < "5.6" -%global ini_name z-%{pecl_name}.ini -%else # After 40-smbclient.ini, see https://jira.mongodb.org/browse/PHPC-658 %global ini_name 50-%{pecl_name}.ini -%endif # test suite requires a MongoDB server -%global with_tests 0%{?_with_tests:1} - -# always use bundled libraries -%if 0 -%global with_syslib 1 -%global libmongo 1.16.1 -%global libmongover %(pkg-config --silence-errors --modversion libmongoc-1.0 2>/dev/null || echo %{libmongoc}) -%global libcrypt 1.0.1 -%global libcryptver %(pkg-config --silence-errors --modversion libmongocrypt 2>/dev/null || echo %{libcrypt}) +%bcond_with tests + +# temp for EL until available in EPEL +%if 0%{?fedora} >= 37 || 0%{?rhel} >= 8 +%bcond_without syslib %else -%global with_syslib 0 -%global libmongo 1.16.2 -%global libcrypt 1.0.3 +%bcond_with syslib +%endif + +# Bundled versions +%global bundled_libmongo 1.30.1 +%global bundled_libcrypt 1.12.0 +# Required versions (in config.m4) +%global minimal_libmongo 1.30.1 +%global minimal_libcrypt 1.12.0 + +%if %{with syslib} +# Build dependencies (in repository) +%global system_libmongo 1.30 +%global system_libcrypt 1.12 +# Runtime dependencies +%global runtime_libmongo %(pkg-config --silence-errors --modversion libmongoc-1.0 2>/dev/null || echo %{system_libmongo}) +%global runtime_libcrypt %(pkg-config --silence-errors --modversion libmongocrypt 2>/dev/null || echo %{system_libcrypt}) %endif Summary: MongoDB driver for PHP -Name: %{?sub_prefix}php-pecl-%{pecl_name} -%global upstream_version 1.7.5 -#global upstream_prever RC1 -#global upstream_lower ~rc1 +Name: %{?scl_prefix}php-pecl-%{pecl_name} +%global upstream_version 1.21.0 +#global upstream_prever beta1 +#global upstream_lower ~beta1 +%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global _configure ../%{sources}/configure Version: %{upstream_version}%{?upstream_lower} -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -License: ASL 2.0 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +%if %{with syslib} +License: Apache-2.0 +%else +License: Apache-2.0 AND ISC AND MIT AND Zlib AND BSD-3-Clause +%endif URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel > 5.6 +BuildRequires: %{?scl_prefix}php-devel >= 8.1 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json -%if %{with_syslib} -BuildRequires: pkgconfig(libbson-1.0) >= %{libmongo} -BuildRequires: pkgconfig(libmongoc-1.0) >= %{libmongo} -BuildRequires: pkgconfig(libmongocrypt) >= %{libcrypt} -Requires: libbson%{?_isa} >= %{libmongover} -Requires: mongo-c-driver-libs%{?_isa} >= %{libmongover} -Requires: libmongocrypt%{?_isa} >= %{libcryptver} +%if %{with syslib} +BuildRequires: pkgconfig(libbson-1.0) >= %{system_libmongo} +BuildRequires: pkgconfig(libmongoc-1.0) >= %{system_libmongo} +BuildRequires: pkgconfig(libmongocrypt) >= %{system_libcrypt} +Requires: libbson%{?_isa} >= %{runtime_libmongo} +Requires: mongo-c-driver-libs%{?_isa} >= %{runtime_libmongo} +Requires: libmongocrypt%{?_isa} >= %{runtime_libcrypt} %else -BuildRequires: cyrus-sasl-devel BuildRequires: openssl-devel -BuildRequires: snappy-devel -BuildRequires: zlib-devel -# We require 50 to ensure use of libicu-last (same version than PHP) -BuildRequires: libicu-devel >= 50 -Provides: bundled(libbson) = %{libmongo} -Provides: bundled(mongo-c-driver) = %{libmongo} -Provides: bundled(libmongocrypt) = %{libcrypt} +BuildRequires: pkgconfig(libsasl2) +BuildRequires: pkgconfig(libzstd) +BuildRequires: pkgconfig(zlib) +BuildRequires: pkgconfig(snappy) +%if 0%{?rhel} == 8 +# EL-8 will use bundled as only in subversion module +Provides: bundled(libutf8proc)= 2.8.0 +%else +BuildRequires: pkgconfig(libutf8proc) %endif -%if %{with_tests} +Provides: bundled(libbson) = %{bundled_libmongo} +Provides: bundled(mongo-c-driver) = %{bundled_libmongo} +Provides: bundled(libmongocrypt) = %{bundled_libcrypt} +%endif +%if %{with tests} BuildRequires: mongodb-server %endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-json%{?_isa} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} # Don't provide php-mongodb which is the pure PHP library -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 - +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description The purpose of this driver is to provide exceptionally thin glue between @@ -103,25 +115,39 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS - # Don't install/register 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 +pushd %{sources} + +%if %{with syslib} +# Check our macro values +cat src/*_VERSION_CURRENT +grep -q %{bundled_libmongo} src/LIBMONGOC_VERSION_CURRENT +grep -q %{bundled_libcrypt} src/LIBMONGOCRYPT_VERSION_CURRENT + +grep CHECK_MODULES config.m4 +grep -q %{minimal_libmongo} config.m4 +grep -q %{minimal_libcrypt} config.m4 + +# temporary: lower minimal required versions +sed -e 's/%{minimal_libmongo}/%{system_libmongo}/;s/%{minimal_libcrypt}/%{system_libcrypt}/' -i config.m4 +%endif + # Sanity check, really often broken extver=$(sed -n '/#define PHP_MONGODB_VERSION /{s/.* "//;s/".*$//;p}' phongo_version.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then : Error: Upstream extension version is ${extver}, expecting %{upstream_version}%{?upstream_prever}. exit 1 fi -cd .. +popd + +mkdir NTS %if %{with_zts} -# Duplicate source tree for NTS / ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif # Create configuration file @@ -138,46 +164,52 @@ EOF %{?dtsenable} peclbuild() { - %{_bindir}/${1}ize - -%if %{with_syslib} - # Ensure we use system library - # Need to be removed only after phpize because of m4_include - rm -r src/libmongoc* - %configure \ - --with-php-config=%{_bindir}/${1}-config \ +%if %{with syslib} --with-mongodb-system-libs \ - --with-mongodb-client-side-encryption \ - --enable-mongodb %else - - %configure \ - --with-php-config=%{_bindir}/${1}-config \ --enable-mongodb-crypto-system-profile \ - --with-mongodb-client-side-encryption \ + --with-mongodb-snappy \ + --with-mongodb-zlib \ + --with-mongodb-zstd \ --with-mongodb-sasl=cyrus \ - --with-mongodb-icu=yes \ --with-mongodb-ssl=openssl \ - --enable-mongodb +%if 0%{?rhel} == 8 + --with-mongodb-utf8proc=bundled \ +%else + --with-mongodb-utf8proc=system \ +%endif %endif + --with-php-config=${1} \ + --with-mongodb-client-side-encryption \ + --enable-mongodb - make %{?_smp_mflags} + %make_build } -cd NTS -peclbuild php +cd %{sources} +%{__phpize} +sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global + +%if %{with syslib} + # Ensure we use system library + # Need to be removed only after phpize because of m4_include + rm -r src/libmongoc* +%endif + +cd ../NTS +peclbuild %{__phpconfig} %if %{with_zts} cd ../ZTS -peclbuild zts-php +peclbuild %{__ztsphpconfig} %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} @@ -186,14 +218,14 @@ 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 # 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 @@ -213,7 +245,7 @@ OPT="-n" --modules | grep %{pecl_name} %endif -%if %{with_tests} +%if %{with tests} ret=0 %global mongo_version %(mongod --version | sed -n '/db version/{s/.*v//;p}' 2>/dev/null) @@ -239,21 +271,17 @@ if [ -s server.pid ] ; then : Run the test suite echo '{"STANDALONE": "mongodb://127.0.0.1:27017"}' | tee /tmp/PHONGO-SERVERS.json - pushd NTS - TEST_PHP_EXECUTABLE=%{__php} \ + pushd %{sources} TEST_PHP_ARGS="$OPT -d extension=%{buildroot}%{php_extdir}/%{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 -P --show-diff || ret=1 popd %if %{with_zts} pushd ZTS - TEST_PHP_EXECUTABLE=%{__ztsphp} \ TEST_PHP_ARGS="$OPT -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ - NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ - php -n run-tests.php --show-diff || ret=1 + %{__ztsphp} -n run-tests.php -q -P --show-diff || ret=1 popd %endif @@ -268,7 +296,7 @@ exit $ret %files -%{?_licensedir:%license NTS/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -282,11 +310,214 @@ exit $ret %changelog -* Tue Apr 8 2025 Remi Collet - 1.7.5-2 -- rebuild using bundled libraries +* Fri Feb 28 2025 Remi Collet - 1.21.0-1 +- update to 1.21.0 +- raise dependency on PHP 8.1 +- raise dependency on libbson and libmongc 1.30 +- raise dependency on libmongocrypt 1.12 + +* Wed Nov 27 2024 Remi Collet - 1.20.1-1 +- update to 1.20.1 + +* Mon Sep 30 2024 Remi Collet - 1.20.0-2 +- EL: rebuild with system libraries + +* Tue Sep 24 2024 Remi Collet - 1.20.0-1 +- update to 1.20.0 + +* Mon Sep 9 2024 Remi Collet - 1.19.4-1 +- update to 1.19.4 + +* Tue Jul 2 2024 Remi Collet - 1.19.3-1 +- update to 1.19.3 + +* Thu Jun 6 2024 Remi Collet - 1.19.2-1 +- update to 1.19.2 (no change) +- EL-7 use bundled libbson and libmongc 1.27.2 + +* Wed May 29 2024 Remi Collet - 1.19.1-1 +- update to 1.19.1 + +* Mon May 13 2024 Remi Collet - 1.19.0-1 +- update to 1.19.0 +- raise dependency on libbson and libmongc 1.27.0 +- raise dependency on libmongocrypt 1.10.0 + +* Fri Apr 12 2024 Remi Collet - 1.18.1-1 +- update to 1.18.1 (no change) +- EL use bundled libbson and libmongc 1.26.2 + +* Thu Mar 28 2024 Remi Collet - 1.18.0-1 +- update to 1.18.0 +- EL use bundled libbson and libmongc 1.26.1 +- EL use bundled libmongocrypt 1.9.1 + +* Tue Mar 19 2024 Remi Collet - 1.17.3-1 +- update to 1.17.3 (no change) +- EL use bundled libbson and libmongc 1.25.4 +- EL use bundled libmongocrypt 1.8.4 + +* Thu Dec 21 2023 Remi Collet - 1.17.2-1 +- update to 1.17.2 + +* Wed Dec 6 2023 Remi Collet - 1.17.1-1 +- update to 1.17.1 +- EL use bundled libbson and libmongc 1.25.2 + +* Wed Nov 15 2023 Remi Collet - 1.17.0-1 +- update to 1.17.0 +- raise dependency on PHP 7.4 +- EL use bundled libbson and libmongc 1.25.1 +- EL use bundled libmongocrypt 1.8.2 +- open https://github.com/mongodb/mongo-php-driver/pull/1490 drop ICU information + +* Wed Aug 30 2023 Remi Collet - 1.16.2-2 +- rebuild for PHP 8.3.0RC1 + +* Thu Aug 17 2023 Remi Collet - 1.16.2-1 +- update to 1.16.2 + +* Thu Jul 13 2023 Remi Collet - 1.16.1-2 +- EL-8/9 rebuild with libraries in EPEL stable + +* Fri Jun 23 2023 Remi Collet - 1.16.1-1 +- update to 1.16.1 (no change) + +* Thu Jun 22 2023 Remi Collet - 1.16.0-1 +- update to 1.16.0 +- EL use bundled libbson and libmongc 1.24.1 +- EL use bundled libmongocrypt 1.8.1 + +* Sat May 13 2023 Remi Collet - 1.15.3-1 +- update to 1.15.3 +- EL-7 use bundled libbson and libmongc 1.23.4 + +* Tue Apr 25 2023 Remi Collet - 1.15.2-2 +- build out of sources tree + +* Sat Apr 22 2023 Remi Collet - 1.15.2-1 +- update to 1.15.2 (no change) +- EL-7 use bundled libbson and libmongc 1.23.3 + +* Thu Feb 9 2023 Remi Collet - 1.15.1-1 +- update to 1.15.1 +- EL-7 use bundled libbson and libmongc 1.23.2 +- cleanup spec macros +- use SPDX license ID + +* Wed Nov 23 2022 Remi Collet - 1.15.0-1 +- update to 1.15.0 +- EL-7 use bundled libbson and libmongc 1.23.1 + +* Fri Oct 21 2022 Remi Collet - 1.14.2-1 +- update to 1.14.2 +- EL-7 use bundled libmongocrypt 1.5.2 + +* Mon Sep 12 2022 Remi Collet - 1.14.1-2 +- EL-9 rebuild with libraries in EPEL stable + +* Sat Sep 10 2022 Remi Collet - 1.14.1-1 +- update to 1.14.1 + +* Wed Jul 27 2022 Remi Collet - 1.14.0-2 +- build with system libraries + +* Mon Jul 18 2022 Remi Collet - 1.14.0-1 +- update to 1.14.0 +- use bundled libmongocrypt 1.5.0 +- use bundled libbson and libmongc 1.22.0 + +* Wed Jun 8 2022 Remi Collet - 1.14.0~beta1-1 +- update to 1.14.0beta1 +- use bundled libmongocrypt 1.5.0-rc1 +- use bundled libbson and libmongc 1.22.0-beta0 + +* Thu Mar 24 2022 Remi Collet - 1.13.0-1 +- update to 1.13.0 +- with libbson and libmongoc 1.21.1 and libmongocrypt 1.3.2 + +* Wed Feb 23 2022 Remi Collet - 1.12.1-1 +- update to 1.12.1 (no change) +- with libbson and libmongoc 1.20.1 + +* Wed Dec 15 2021 Remi Collet - 1.12.0-1 +- update to 1.12.0 +- with libbson and libmongoc 1.20.0 +- with libmongocrypt 1.3.0 +- raise dependency on PHP 7.2 + +* Wed Nov 3 2021 Remi Collet - 1.11.1-1 +- update to 1.11.1 (no change) + +* Sat Oct 30 2021 Remi Collet - 1.11.0-1 +- update to 1.11.0 +- with libbson and libmongoc 1.19.1 + +* Wed Sep 29 2021 Remi Collet - 1.11.0~alpha1-2 +- rebuild using ICU 69 + +* Tue Sep 14 2021 Remi Collet - 1.11.0~alpha1-1 +- update to 1.11.0alpha1 +- with libbson and libmongoc 1.19.0 +- drop patch merged upstream + +* Wed Sep 01 2021 Remi Collet - 1.10.0-4 +- rebuild for 8.1.0RC1 + +* Thu Aug 5 2021 Remi Collet - 1.10.0-3 +- rebuild with system library on EL-8 + +* Fri Jul 23 2021 Remi Collet - 1.10.0-2 +- add patch for PHP 8.1.0beta1 from + https://github.com/mongodb/mongo-php-driver/pull/1240 + +* Wed Jul 14 2021 Remi Collet - 1.10.0-1 +- update to 1.10.0 +- with libbson and libmongoc 1.18.0 +- with libmongocrypt 1.2.1 +- raise dependency on PHP 7.1 + +* Fri Apr 9 2021 Remi Collet - 1.10.0~alpha1-1 +- update to 1.10.0alpha1 +- with libbson and libmongoc 1.18.0alpha +- with libmongocrypt 1.2.1dev + +* Wed Apr 7 2021 Remi Collet - 1.9.1-1 +- update to 1.9.1 +- with libbson and libmongoc 1.17.4 + +* Wed Nov 25 2020 Remi Collet - 1.9.0-1 +- update to 1.9.0 (stable) + +* Wed Nov 11 2020 Remi Collet - 1.9.0~RC1-1 +- update to 1.9.0RC1 (beta) + +* Thu Nov 5 2020 Remi Collet - 1.8.2-1 +- update to 1.8.2 (no change) +- with libbson and libmongoc 1.17.2 +- with libmongocrypt 1.0.4 + +* Tue Oct 6 2020 Remi Collet - 1.8.1-1 +- update to 1.8.1 + +* Thu Aug 27 2020 Remi Collet - 1.8.0-2 +- rebuild with system library on EL-8 + +* Fri Jul 31 2020 Remi Collet - 1.8.0-1 +- update to 1.8.0 +- with libbson and libmongoc 1.17.0 + +* Fri Jul 17 2020 Remi Collet - 1.8.0~rc1-1 +- update to 1.8.0RC1 +- with libbson and libmongoc 1.17.0-rc0 + +* Thu Jun 11 2020 Remi Collet - 1.8.0~beta2-1 +- update to 1.8.0beta2 +- with libbson and libmongoc 1.17.0-beta2 -* Wed Jul 8 2020 Remi Collet - 1.7.5-1 -- update to 1.7.5 +* Wed Apr 15 2020 Remi Collet - 1.8.0~beta1-1 +- update to 1.8.0beta1 +- with libbson and libmongoc 1.17.0-beta * Wed Mar 11 2020 Remi Collet - 1.7.4-1 - update to 1.7.4 (no change) -- cgit