summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json22
-rw-r--r--php-doctrine-dbal.spec77
2 files changed, 63 insertions, 36 deletions
diff --git a/composer.json b/composer.json
index acf3405..943dcf0 100644
--- a/composer.json
+++ b/composer.json
@@ -12,26 +12,36 @@
{"name": "Jonathan Wage", "email": "jonwage@gmail.com"}
],
"require": {
- "php": ">=5.3.2",
- "doctrine/common": ">=2.4,<2.8-dev"
+ "php": "^7.1",
+ "ext-pdo": "*",
+ "doctrine/common": "^2.7.1"
},
"require-dev": {
- "phpunit/phpunit": "4.*",
- "symfony/console": "2.*||^3.0"
+ "doctrine/coding-standard": "^4.0",
+ "phpunit/phpunit": "^7.0",
+ "phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5",
+ "symfony/console": "^2.0.5||^3.0",
+ "symfony/phpunit-bridge": "^3.4.5|^4.0.5"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"bin": ["bin/doctrine-dbal"],
+ "config": {
+ "sort-packages": true
+ },
"autoload": {
"psr-0": { "Doctrine\\DBAL\\": "lib/" }
},
+ "autoload-dev": {
+ "psr-0": { "Doctrine\\Tests\\": "tests/" }
+ },
"extra": {
"branch-alias": {
- "dev-master": "2.5.x-dev"
+ "dev-master": "2.7.x-dev"
}
},
"archive": {
- "exclude": ["!vendor", "tests", "*phpunit.xml", ".travis.yml", "build.xml", "build.properties", "composer.phar"]
+ "exclude": ["!vendor", "tests", "*phpunit.xml", ".appveyor.yml", ".travis.yml", "build.xml", "build.properties", "composer.phar"]
}
}
diff --git a/php-doctrine-dbal.spec b/php-doctrine-dbal.spec
index 6f99f32..ed05f2a 100644
--- a/php-doctrine-dbal.spec
+++ b/php-doctrine-dbal.spec
@@ -13,21 +13,23 @@
%global github_owner doctrine
%global github_name dbal
-%global github_version 2.5.12
-%global github_commit 7b9e911f9d8b30d43b96853dab26898c710d8f44
+%global github_version 2.7.2
+%global github_commit c0e5736016a51b427a8cba8bc470fbea78165819
%global composer_vendor doctrine
%global composer_project dbal
-# "php": ">=5.3.2"
-%global php_min_ver 5.3.2
-# "doctrine/common": ">=2.4,<2.8-dev"
-# NOTE: Min version not 2.4 because autoloader required
-%global doctrine_common_min_ver 2.5.0
-%global doctrine_common_max_ver 2.8
-# "symfony/console": "2.*||^3.0"
-%global symfony_console_min_ver 2.0
+# "php": "^7.1"
+%global php_min_ver 7.1
+# "doctrine/common": "^2.7.1"
+%global doctrine_common_min_ver 2.7.1
+%global doctrine_common_max_ver 3.0
+# "symfony/console": "^2.0.5||^3.0"
+%global symfony_console_min_ver 2.0.5
%global symfony_console_max_ver 4.0
+# "symfony/phpunit-bridge": "^3.4.5|^4.0.5"
+%global symfony_phpunit_min_ver 4.0.5
+%global symfony_phpunit_max_ver 5.0
%{!?phpdir: %global phpdir %{_datadir}/php}
@@ -36,7 +38,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 3%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: Doctrine Database Abstraction Layer (DBAL)
Group: Development/Libraries
@@ -52,20 +54,25 @@ Source1: %{name}-get-source.sh
# 2) Auto-load using Doctrine\Common\ClassLoader
Patch0: %{name}-bin.patch
-# Fix test suite using PHPUnit 5.4
-Patch1: %{name}-phpunit54.patch
-
BuildArch: noarch
# Tests
%if %{with_tests}
-BuildRequires: php-composer(phpunit/phpunit)
+BuildRequires: phpunit7
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires:(php-composer(doctrine/common) >= %{doctrine_common_min_ver} with php-composer(doctrine/common) < %{doctrine_common_max_ver})
+## composer.json (optional)
+BuildRequires:(php-composer(symfony/console) >= %{symfony_console_min_ver} with php-composer(symfony/console) < %{symfony_console_max_ver})
+BuildRequires:(php-composer(symfony/phpunit-bridge) >= %{symfony_phpunit_min_ver} with php-composer(symfony/phpunit-bridge) < %{symfony_phpunit_max_ver})
+%else
BuildRequires: php-composer(doctrine/common) >= %{doctrine_common_min_ver}
BuildRequires: php-composer(doctrine/common) < %{doctrine_common_max_ver}
+BuildRequires: php-symfony4-phpunit-bridge
## composer.json (optional)
BuildRequires: php-composer(symfony/console) >= %{symfony_console_min_ver}
BuildRequires: php-composer(symfony/console) < %{symfony_console_max_ver}
+%endif
## phpcompatinfo (computed from version 2.5.12)
BuildRequires: php-date
BuildRequires: php-json
@@ -79,16 +86,22 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(doctrine/common) >= %{doctrine_common_min_ver} with php-composer(doctrine/common) < %{doctrine_common_max_ver})
+# composer.json (optional)
+Requires: (php-composer(symfony/console) >= %{symfony_console_min_ver} with php-composer(symfony/console) < %{symfony_console_max_ver})
+%else
Requires: php-composer(doctrine/common) >= %{doctrine_common_min_ver}
Requires: php-composer(doctrine/common) < %{doctrine_common_max_ver}
# composer.json (optional)
Requires: php-composer(symfony/console) >= %{symfony_console_min_ver}
Requires: php-composer(symfony/console) < %{symfony_console_max_ver}
+%endif
+Requires: php-pdo
# phpcompatinfo (computed from version 2.5.12)
Requires: php-date
Requires: php-json
Requires: php-pcre
-Requires: php-pdo
Requires: php-reflection
Requires: php-spl
# Autoloader
@@ -122,10 +135,6 @@ Autoloader: %{phpdir}/Doctrine/DBAL/autoload.php
: Patch bin script
%patch0 -p1
-if %{_bindir}/phpunit --atleast-version 5.4; then
-%patch1 -p0
-fi
-
: Remove empty file
rm -f lib/Doctrine/DBAL/README.markdown
@@ -146,12 +155,12 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
'%{phpdir}/Doctrine/Common/autoload.php',
));
-\Fedora\Autoloader\Dependencies::optional(array(
- array(
+\Fedora\Autoloader\Dependencies::optional([
+ [
(getenv('RPM_SYMFONY_TREE')?:'%{phpdir}/Symfony3') . '/Component/Console/autoload.php',
'%{phpdir}/Symfony/Component/Console/autoload.php',
- ),
-));
+ ],
+]);
AUTOLOAD
@@ -165,22 +174,24 @@ install -pm 0755 bin/doctrine-dbal.php %{buildroot}/%{_bindir}/doctrine-dbal
%check
%if %{with_tests}
-# Rewrite "tests/Doctrine/Tests/TestInit.php" (aka PHPUnit bootstrap)
-mv tests/Doctrine/Tests/TestInit.php tests/Doctrine/Tests/TestInit.php.dist
-cat > tests/Doctrine/Tests/TestInit.php <<'BOOTSTRAP'
+cat > bs.php <<'BOOTSTRAP'
<?php
+# load SF4 before main autoloader which load SF3
+require_once '%{phpdir}/Symfony4/Bridge/PhpUnit/autoload.php';
require_once '%{buildroot}/%{phpdir}/Doctrine/DBAL/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4(
'Doctrine\\Tests\\',
- dirname(dirname(dirname(__DIR__))).'/tests/Doctrine/Tests'
+ __DIR__ . '/tests/Doctrine/Tests'
);
BOOTSTRAP
: Upstream tests
RETURN_CODE=0
-for PHP_EXEC in php %{?rhel:php54 php55} php56 php70 php71 php72; do
+for PHP_EXEC in php php71 php72 php73; do
if which $PHP_EXEC; then
- $PHP_EXEC %{_bindir}/phpunit --verbose || RETURN_CODE=1
+ $PHP_EXEC %{_bindir}/phpunit7 \
+ --bootstrap bs.php \
+ --verbose || RETURN_CODE=1
fi
done
exit $RETURN_CODE
@@ -199,6 +210,12 @@ exit $RETURN_CODE
%changelog
+* Wed Oct 17 2018 Remi Collet <remi@remirepo.net> - 2.7.2-1
+- update to 2.7.2
+- raise dependencies on PHP 7.1
+- use range dependencies
+- switch to phpunit7
+
* Tue May 30 2017 Remi Collet <remi@remirepo.net> - 2.5.12-3
- allow to force Symfony version using RPM_SYMFONY_TREE