From 5df4d5c0d598e8e66ee041c22d243ff364866f4c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 12 Mar 2026 11:00:50 +0100 Subject: drop pear/pecl dependency sources from github --- composer.json | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ makesrc.sh | 33 ++++++++++++++++++++++ php-pecl-mongodb2.spec | 63 ++++++++++++++++++++++-------------------- 3 files changed, 140 insertions(+), 30 deletions(-) create mode 100644 composer.json create mode 100755 makesrc.sh diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..986a688 --- /dev/null +++ b/composer.json @@ -0,0 +1,74 @@ +{ + "name": "mongodb/mongodb-extension", + "description": "MongoDB driver extension", + "type": "php-ext", + "keywords": ["database", "driver", "mongodb", "persistence"], + "homepage": "https://jira.mongodb.org/browse/PHPC", + "license": "Apache-2.0", + "authors": [ + { "name": "Andreas Braun", "email": "andreas.braun@mongodb.com" }, + { "name": "Jeremy Mikola", "email": "jmikola@gmail.com" }, + { "name": "Jérôme Tamarelle", "email": "jerome.tamarelle@mongodb.com" } + ], + "require": { + "php": ">=8.1,<9", + "ext-date": "*", + "ext-json": "*" + }, + "php-ext": { + "extension-name": "mongodb", + "download-url-method": "pre-packaged-source", + "configure-options": [ + { + "name": "enable-mongodb-developer-flags", + "description": "Enable developer flags", + "needs-value": true + }, + { + "name": "enable-mongodb-coverage", + "description": "Enable code coverage", + "needs-value": true + }, + { + "name": "with-mongodb-system-libs", + "description": "Use system libraries for libbson, libmongoc, and libmongocrypt", + "needs-value": true + }, + { + "name": "with-mongodb-client-side-encryption", + "description": "Enable client-side encryption (auto/yes/no)", + "needs-value": true + }, + { + "name": "with-mongodb-snappy", + "description": "Enable Snappy for compression (auto/yes/no)", + "needs-value": true + }, + { + "name": "with-mongodb-zlib", + "description": "Enable zlib for compression (auto/system/bundled/no)", + "needs-value": true + }, + { + "name": "with-mongodb-zstd", + "description": "Enable zstd for compression (auto/yes/no)", + "needs-value": true + }, + { + "name": "with-mongodb-sasl", + "description": "Enable SASL for Kerberos authentication (auto/cyrus/no)", + "needs-value": true + }, + { + "name": "with-mongodb-ssl", + "description": "Enable crypto and TLS (auto/openssl/darwin/no)", + "needs-value": true + }, + { + "name": "enable-mongodb-crypto-system-profile", + "description": "Use system crypto profile (OpenSSL only) (yes/no)", + "needs-value": true + } + ] + } +} diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..3f387cf --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +NAME=$(basename $PWD) +OWNER=$(sed -n '/^%global gh_vend/{s/.* //;p}' $NAME.spec) +PROJECT=$(sed -n '/^%global gh_proj/{s/.* //;p}' $NAME.spec) +VER1=$(sed -n '/^%global upstream_version/{s/.* //;p}' $NAME.spec) +VER2=$(sed -n '/^%global upstream_prever/{s/.* //;p}' $NAME.spec) + +VERSION=${VER1}${VER2} + +echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" + +if [ -f $PROJECT-$VERSION.tgz ]; then + echo $PROJECT-$VERSION.tgz already present + exit 1 +fi + +echo "Cloning..." +rm -rf $PROJECT-$VERSION +git clone --recursive https://github.com/$OWNER/$PROJECT.git -b $VERSION $PROJECT-$VERSION + +echo "Composer..." +pushd $PROJECT-$VERSION + cp composer.json .. +popd + +echo "Archiving..." +tar czf $PROJECT-$VERSION.tgz --exclude-vcs $PROJECT-$VERSION + +echo "Cleaning..." +rm -rf $PROJECT-$VERSION + +echo "Done." diff --git a/php-pecl-mongodb2.spec b/php-pecl-mongodb2.spec index b653b3a..9dcb0c8 100644 --- a/php-pecl-mongodb2.spec +++ b/php-pecl-mongodb2.spec @@ -20,42 +20,51 @@ %bcond_with syslib # Bundled versions -%global bundled_libmongo 2.2.2 -%global bundled_libcrypt 1.17.2 +%global bundled_libmongo 2.2.2 +%global bundled_libcrypt 1.17.2 # Required versions (in config.m4) -%global minimal_libmongo 2.2.2 -%global minimal_libcrypt 1.17.2 +%global minimal_libmongo 2.2.2 +%global minimal_libcrypt 1.17.2 %if %{with syslib} # Build dependencies (in repository) -%global system_libmongo 2.2.2 -%global system_libcrypt 1.17.2 +%global system_libmongo 2.2.2 +%global system_libcrypt 1.17.2 # 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}) +%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 version 2 -Name: %{?scl_prefix}php-pecl-%{pecl_name}2 %global upstream_version 2.2.1 #global upstream_prever beta1 #global upstream_lower ~beta1 -%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} +%global sources %{gh_proj}-%{upstream_version}%{?upstream_prever} %global _configure ../%{sources}/configure -Version: %{upstream_version}%{?upstream_lower} -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} + +# Github forge +%global gh_vend mongodb +%global gh_proj mongo-php-driver +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +%global tag %{upstream_version}%{?upstream_prever} + +Summary: MongoDB driver for PHP version 2 +Name: %{?scl_prefix}php-pecl-%{pecl_name}2 +Release: 2%{?dist} %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 +Version: %{upstream_version}%{?upstream_lower} +%forgemeta +URL: %{forgeurl} +Source0: %{sources}.tgz +# get git snapshot with submodules +Source1: makesrc.sh BuildRequires: make BuildRequires: %{?dtsprefix}gcc 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) >= %{system_libmongo} @@ -119,10 +128,6 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -# Don't install/register tests -sed -e 's/role="test"/role="src"/' \ - -e '/LICENSE/s/role="doc"/role="src"/' \ - -i package.xml pushd %{sources} # Check our macro values @@ -218,20 +223,12 @@ peclbuild %{__ztsphpconfig} # install config file install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} -# Install XML package description -install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml - %if %{with_zts} %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 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i -done - %check OPT="-n" @@ -252,8 +249,10 @@ OPT="-n" %files %license %{sources}/LICENSE -%doc %{pecl_docdir}/%{pecl_name} -%{pecl_xmldir}/%{name}.xml +%doc %{sources}/composer.json +%doc %{sources}/CREDITS +%doc %{sources}/THIRD_PARTY_NOTICES +%doc %{sources}/*.md %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -265,6 +264,10 @@ OPT="-n" %changelog +* Thu Mar 12 2026 Remi Collet - 2.2.1-2 +- drop pear/pecl dependency +- sources from github + * Fri Feb 13 2026 Remi Collet - 2.2.1-1 - update to 2.2.1 -- cgit