summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json16
-rw-r--r--php-mongodb-autoload.php6
-rw-r--r--php-mongodb.spec64
3 files changed, 59 insertions, 27 deletions
diff --git a/composer.json b/composer.json
index 9b671ef..c6e2822 100644
--- a/composer.json
+++ b/composer.json
@@ -9,28 +9,28 @@
{ "name": "Jeremy Mikola", "email": "jmikola@gmail.com" }
],
"require": {
- "php": "^7.0",
+ "php": "^7.0 || ^8.0",
"ext-hash": "*",
"ext-json": "*",
- "ext-mongodb": "^1.8",
- "jean85/pretty-package-versions": "^1.2"
+ "ext-mongodb": "^1.8.1",
+ "jean85/pretty-package-versions": "^1.2",
+ "symfony/polyfill-php80": "^1.19"
},
"require-dev": {
- "phpunit/phpunit": "^6.4 || ^8.3",
- "sebastian/comparator": "^2.0 || ^3.0",
"squizlabs/php_codesniffer": "^3.5, <3.5.5",
- "symfony/phpunit-bridge": "^4.4@dev"
+ "symfony/phpunit-bridge": "5.x-dev"
},
"autoload": {
"psr-4": { "MongoDB\\": "src/" },
"files": [ "src/functions.php" ]
},
"autoload-dev": {
- "psr-4": { "MongoDB\\Tests\\": "tests/" }
+ "psr-4": { "MongoDB\\Tests\\": "tests/" },
+ "files": [ "tests/PHPUnit/Functions.php" ]
},
"extra": {
"branch-alias": {
- "dev-master": "1.7.x-dev"
+ "dev-master": "1.8.x-dev"
}
}
}
diff --git a/php-mongodb-autoload.php b/php-mongodb-autoload.php
deleted file mode 100644
index 6381225..0000000
--- a/php-mongodb-autoload.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-/* Autoloader for mongodb/mongodb and its dependencies */
-
-require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('MongoDB\\', __DIR__);
-require_once __DIR__. '/functions.php';
diff --git a/php-mongodb.spec b/php-mongodb.spec
index a4481ee..18b4811 100644
--- a/php-mongodb.spec
+++ b/php-mongodb.spec
@@ -9,7 +9,7 @@
# disabled for https://fedoraproject.org/wiki/Changes/MongoDB_Removal
%bcond_with tests
-%global gh_commit 38b685191c047a57275d6ccd2ea5c50f23638485
+%global gh_commit 953dbc19443aa9314c44b7217a16873347e6840d
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner mongodb
#global gh_date 20151102
@@ -18,7 +18,7 @@
#global prever beta2
Name: php-%{gh_owner}
-Version: 1.7.2
+Version: 1.8.0
%if 0%{?gh_date}
Release: 1%{gh_date}git%{gh_short}%{?dist}
%else
@@ -30,43 +30,65 @@ License: ASL 2.0
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}-%{?gh_short}.tar.gz
-# Autoloader
-Source1: %{name}-autoload.php
# Get rid of jean85/pretty-package-versions
Patch0: %{name}-rpm.patch
BuildArch: noarch
BuildRequires: php(language) >= 7.0
BuildRequires: php-cli
+BuildRequires: php-reflection
BuildRequires: php-date
+BuildRequires: php-dom
BuildRequires: php-hash
BuildRequires: php-json
BuildRequires: php-spl
-BuildRequires: php-pecl(mongodb) >= 1.8
+BuildRequires: php-pecl(mongodb) >= 1.8.1
+# remirepo:1
+%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(symfony/polyfill-php80) >= 1.19 with php-composer(symfony/polyfill-php80) < 2)
+# remirepo:4
+%else
+BuildRequires: php-symfony-polyfill < 2
+BuildRequires: php-symfony-polyfill >= 1.19
+%endif
%if %{with tests}
BuildRequires: mongodb-server >= 2.4
# From composer.json, "require-dev": {
# "phpunit/phpunit": "^6.4 || ^8.3",
# "sebastian/comparator": "^2.0 || ^3.0",
# "squizlabs/php_codesniffer": "^3.5, <3.5.5",
-# "symfony/phpunit-bridge": "^4.4@dev"
+# "symfony/phpunit-bridge": "^5.x@dev"
+%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
+%global phpunit %{_bindir}/phpunit9
+%else
%global phpunit %{_bindir}/phpunit8
+%endif
BuildRequires: %{phpunit}
%endif
# For autoloader
BuildRequires: php-composer(fedora/autoloader)
# From composer.json, "require": {
-# "php": "^7.0"
+# "php": "^7.0 || ^8.0"
# "ext-hash": "*",
# "ext-json": "*",
-# "ext-mongodb": "^1.7"
+# "ext-mongodb": "^1.8.1"
# "jean85/pretty-package-versions": "^1.2"
+# "symfony/polyfill-php80": "^1.19"
Requires: php(language) >= 7.0
Requires: php-hash
Requires: php-json
-Requires: php-pecl(mongodb) >= 1.8
-# From phpcompatinfo report for 1.5.0
+Requires: php-pecl(mongodb) >= 1.8.1
+# remirepo:1
+%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8
+Requires: (php-composer(symfony/polyfill-php80) >= 1.19 with php-composer(symfony/polyfill-php80) < 2)
+# remirepo:4
+%else
+Requires: php-symfony-polyfill < 2
+Requires: php-symfony-polyfill >= 1.19
+%endif
+# From phpcompatinfo report for 1.8.0
+Requires: php-reflection
Requires: php-date
Requires: php-spl
# For autoloader
@@ -92,7 +114,17 @@ Autoloader: %{_datadir}/php/%{psr0}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-cp %{SOURCE1} src/autoload.php
+cat << 'EOF' | tee src/autoload.php
+<?php
+/* Autoloader for mongodb/mongodb and its dependencies */
+
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('MongoDB\\', __DIR__);
+require_once __DIR__. '/functions.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{_datadir}/php/Symfony/Polyfill/autoload.php',
+]);
+EOF
# Get rid of jean85/pretty-package-versions
%patch0 -p1 -b .rpm
@@ -140,14 +172,15 @@ cat << 'EOF' | tee tests/bootstrap.php
require_once '%{buildroot}%{_datadir}/php/%{psr0}/autoload.php';
// Test suite
\Fedora\Autoloader\Autoload::addPsr4('MongoDB\\Tests\\', __DIR__);
+require_once __DIR__ . '/PHPUnit/Functions.php
EOF
: Run the test suite
ret=0
-for cmdarg in "php %{phpunit}" "php56 %{_bindir}/phpunit" php70 php71 php72; do
+for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do
if which $cmdarg; then
set $cmdarg
- $1 ${2:-%{_bindir}/phpunit8} --verbose || ret=1
+ $1 ${2:-%{_bindir}/phpunit9} --verbose || ret=1
fi
done
@@ -170,6 +203,11 @@ exit $ret
%changelog
+* Wed Nov 25 2020 Remi Collet <remi@remirepo.net> - 1.8.0-1
+- update to 1.8.0
+- raise dependency on mongodb extension 1.8.1
+- add dependency on symfony/polyfill-php80
+
* Fri Nov 6 2020 Remi Collet <remi@remirepo.net> - 1.7.2-1
- update to 1.7.2