summaryrefslogtreecommitdiffstats
path: root/php-doctrine-orm.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-doctrine-orm.spec')
-rw-r--r--php-doctrine-orm.spec198
1 files changed, 112 insertions, 86 deletions
diff --git a/php-doctrine-orm.spec b/php-doctrine-orm.spec
index e3512ad..ada4ad0 100644
--- a/php-doctrine-orm.spec
+++ b/php-doctrine-orm.spec
@@ -13,27 +13,37 @@
%global github_owner doctrine
%global github_name doctrine2
-%global github_version 2.4.8
-%global github_commit 5aedac1e5c5caaeac14798822c70325dc242d467
+%global github_version 2.5.11
+%global github_commit 249b737094f1e7cba4f0a8d19acf5be6cf3ed504
%global composer_vendor doctrine
%global composer_project orm
-# "php": ">=5.3.2"
-%global php_min_ver 5.3.2
-# "doctrine/collections": "~1.1"
-# NOTE: Min version not 1.1 because autoloader required
-%global collections_min_ver 1.3.0
+# "php": ">=5.4"
+%global php_min_ver 5.4
+# "doctrine/cache": "~1.4"
+# NOTE: Min version not 1.4.0 because autoloader required
+%global cache_min_ver 1.4.1
+%global cache_max_ver 2
+# "doctrine/collections": "~1.2"
+# NOTE: Min version not 1.2 because autoloader required
+%global collections_min_ver 1.3
%global collections_max_ver 2.0
-# "doctrine/dbal": "~2.4"
+# "doctrine/common": ">=2.5-dev,<2.9-dev"
+%global common_min_ver 2.5
+%global common_max_ver 2.9
+# "doctrine/dbal": ">=2.5-dev,<2.7-dev"
# NOTE: Min version not 2.4 because autoloader required
%global dbal_min_ver 2.5.4
-%global dbal_max_ver 3.0
-# "symfony/console": "~2.0"
-# "symfony/yaml": "~2.1"
-# NOTE: Min version not 2.1 because autoloader required
+%global dbal_max_ver 2.7
+# "doctrine/instantiator": "^1.0.1"
+%global instantiator_min_ver 1.0.1
+%global instantiator_max_ver 2.0
+# "symfony/console": "~2.5|~3.0"
+# "symfony/yaml": "~2.3|~3.0"
+# NOTE: Min version not 2.5 because autoloader required
%global symfony_min_ver 2.7.1
-%global symfony_max_ver 3.0
+%global symfony_max_ver 4.0
%{!?phpdir: %global phpdir %{_datadir}/php}
@@ -42,7 +52,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 3%{?dist}
+Release: 1%{?dist}
Summary: Doctrine Object-Relational-Mapper (ORM)
Group: Development/Libraries
@@ -58,29 +68,32 @@ 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
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Tests
%if %{with_tests}
-BuildRequires: php-composer(phpunit/phpunit)
## composer.json
-BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php-composer(doctrine/cache) < %{cache_max_ver}
+BuildRequires: php-composer(doctrine/cache) >= %{cache_min_ver}
BuildRequires: php-composer(doctrine/collections) < %{collections_max_ver}
BuildRequires: php-composer(doctrine/collections) >= %{collections_min_ver}
-BuildRequires: php-composer(doctrine/dbal) < %{dbal_max_ver}
-BuildRequires: php-composer(doctrine/dbal) >= %{dbal_min_ver}
-BuildRequires: php-composer(symfony/console) < %{symfony_max_ver}
-BuildRequires: php-composer(symfony/console) >= %{symfony_min_ver}
-BuildRequires: php-composer(symfony/yaml) < %{symfony_max_ver}
-BuildRequires: php-composer(symfony/yaml) >= %{symfony_min_ver}
+BuildRequires: php-composer(doctrine/common) < %{common_max_ver}
+BuildRequires: php-composer(doctrine/common) >= %{common_min_ver}
+BuildRequires: php-composer(doctrine/dbal) < %{dbal_max_ver}
+BuildRequires: php-composer(doctrine/dbal) >= %{dbal_min_ver}
+BuildRequires: php-composer(doctrine/instantiator) < %{instantiator_max_ver}
+BuildRequires: php-composer(doctrine/instantiator) >= %{instantiator_min_ver}
+BuildRequires: php-composer(phpunit/phpunit)
+BuildRequires: php-composer(symfony/console) < %{symfony_max_ver}
+BuildRequires: php-composer(symfony/console) >= %{symfony_min_ver}
+BuildRequires: php-composer(symfony/yaml) < %{symfony_max_ver}
+BuildRequires: php-composer(symfony/yaml) >= %{symfony_min_ver}
BuildRequires: php-pdo
-# phpcompatinfo (computed from version 2.4.8)
+# phpcompatinfo (computed from version 2.5.11)
BuildRequires: php-ctype
BuildRequires: php-date
BuildRequires: php-dom
+BuildRequires: php-json
BuildRequires: php-pcre
BuildRequires: php-reflection
BuildRequires: php-simplexml
@@ -91,19 +104,28 @@ BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
-Requires: php(language) >= %{php_min_ver}
+Requires: php(language) >= %{php_min_ver}
+Requires: php-composer(doctrine/cache) < %{cache_max_ver}
+Requires: php-composer(doctrine/cache) >= %{cache_min_ver}
Requires: php-composer(doctrine/collections) < %{collections_max_ver}
Requires: php-composer(doctrine/collections) >= %{collections_min_ver}
-Requires: php-composer(doctrine/dbal) < %{dbal_max_ver}
-Requires: php-composer(doctrine/dbal) >= %{dbal_min_ver}
-Requires: php-composer(symfony/console) < %{symfony_max_ver}
-Requires: php-composer(symfony/console) >= %{symfony_min_ver}
-Requires: php-composer(symfony/yaml) < %{symfony_max_ver}
-Requires: php-composer(symfony/yaml) >= %{symfony_min_ver}
+Requires: php-composer(doctrine/common) < %{common_max_ver}
+Requires: php-composer(doctrine/common) >= %{common_min_ver}
+Requires: php-composer(doctrine/dbal) < %{dbal_max_ver}
+Requires: php-composer(doctrine/dbal) >= %{dbal_min_ver}
+Requires: php-composer(doctrine/instantiator) < %{instantiator_max_ver}
+Requires: php-composer(doctrine/instantiator) >= %{instantiator_min_ver}
+Requires: php-composer(symfony/console) < %{symfony_max_ver}
+Requires: php-composer(symfony/console) >= %{symfony_min_ver}
Requires: php-pdo
-# phpcompatinfo (computed from version 2.4.8)
+# composer.json: suggest
+Requires: php-composer(symfony/yaml) < %{symfony_max_ver}
+Requires: php-composer(symfony/yaml) >= %{symfony_min_ver}
+# phpcompatinfo (computed from version 2.5.11)
Requires: php-ctype
+Requires: php-date
Requires: php-dom
+Requires: php-json
Requires: php-pcre
Requires: php-reflection
Requires: php-simplexml
@@ -145,18 +167,11 @@ Autoloader: %{phpdir}/Doctrine/ORM/autoload.php
: Patch bin script
%patch0 -p1
-
-if %{_bindir}/phpunit --atleast-version 5.4; then
-: Fix test suite using PHPUnit 5.4
-%patch1 -p0
-fi
+sed -i 's#__PHPDIR__#%{phpdir}#g' bin/doctrine.php
: Remove empty file
rm -f lib/Doctrine/ORM/README.markdown
-: Remove unnecessary executable bits
-chmod a-x lib/Doctrine/ORM/Tools/Pagination/Paginator.php
-
%build
: Create autoloader
@@ -170,18 +185,28 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\ORM\\', __DIR__);
-\Fedora\Autoloader\Dependencies::required(array(
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/Doctrine/Common/autoload.php',
+ '%{phpdir}/Doctrine/Common/Cache/autoload.php',
'%{phpdir}/Doctrine/Common/Collections/autoload.php',
'%{phpdir}/Doctrine/DBAL/autoload.php',
- '%{phpdir}/Symfony/Component/Console/autoload.php',
+ '%{phpdir}/Doctrine/Instantiator/autoload.php',
+ [
+ '%{phpdir}/Symfony3/Component/Console/autoload.php',
+ '%{phpdir}/Symfony/Component/Console/autoload.php',
+ ],
+]);
+
+\Fedora\Autoloader\Dependencies::optional([
+ [
+ '%{phpdir}/Symfony3/Component/Yaml/autoload.php',
'%{phpdir}/Symfony/Component/Yaml/autoload.php',
-));
+ ],
+]);
AUTOLOAD
%install
-rm -rf %{buildroot}
-
: Lib
mkdir -p %{buildroot}%{phpdir}
cp -rp lib/Doctrine %{buildroot}%{phpdir}/
@@ -209,56 +234,54 @@ require_once '%{buildroot}%{phpdir}/Doctrine/ORM/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Tests\\', __DIR__.'/tests/Doctrine/Tests');
BOOTSTRAP
-# Skip test known to fail
-sed -e 's/function testQueryCache_DependsOnHints/function SKIP_testQueryCache_DependsOnHints/' \
- -e 's/function testQueryCache_NoHitSaveParserResult/function SKIP_testQueryCache_NoHitSaveParserResult/' \
+: Skip tests known to fail
+sed \
+ -e 's/function testDeleteTransactionCommitShouldEvictCache/function SKIP_testDeleteTransactionCommitShouldEvictCache/' \
+ -e 's/function testInsertTransactionCommitShouldPutCache/function SKIP_testInsertTransactionCommitShouldPutCache/' \
+ -e 's/function testTransactionRollBackShouldClearQueue/function SKIP_testTransactionRollBackShouldClearQueue/' \
+ -e 's/function testUpdateTransactionCommitShouldPutCache/function SKIP_testUpdateTransactionCommitShouldPutCache/' \
+ -i tests/Doctrine/Tests/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersisterTest.php
+sed \
+ -e 's/function testLoadedAssociationToManyShouldTriggerEvent/function SKIP_testLoadedAssociationToManyShouldTriggerEvent/' \
+ -e 's/function testLoadedAssociationToOneShouldTriggerEvent/function SKIP_testLoadedAssociationToOneShouldTriggerEvent/' \
+ -e 's/function testLoadedEntityUsingFindShouldTriggerEvent/function SKIP_testLoadedEntityUsingFindShouldTriggerEvent/' \
+ -e 's/function testLoadedEntityUsingQueryShouldTriggerEvent/function SKIP_testLoadedEntityUsingQueryShouldTriggerEvent/' \
+ -e 's/function testLoadedProxyAssociationToManyShouldTriggerEvent/function SKIP_testLoadedProxyAssociationToManyShouldTriggerEvent/' \
+ -e 's/function testLoadedProxyAssociationToOneShouldTriggerEvent/function SKIP_testLoadedProxyAssociationToOneShouldTriggerEvent/' \
+ -e 's/function testLoadedProxyEntityShouldTriggerEvent/function SKIP_testLoadedProxyEntityShouldTriggerEvent/' \
+ -e 's/function testLoadedProxyPartialShouldTriggerEvent/function SKIP_testLoadedProxyPartialShouldTriggerEvent/' \
+ -i tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php
+sed 's/function testQueryCache_NoHitSaveParserResult/function SKIP_testQueryCache_NoHitSaveParserResult/' \
-i tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php
-sed 's/function testNativeQueryResultCaching/function SKIP_testNativeQueryResultCaching/' \
- -i tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php
-sed 's/function testQueryCache_DependsOnFilters/function SKIP_testQueryCache_DependsOnFilters/' \
- -i tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php
-%if 0%{?fedora} > 24
-sed 's/function testReusedSplObjectHashDoesNotConfuseUnitOfWork/function SKIP_testReusedSplObjectHashDoesNotConfuseUnitOfWork/' \
- -i tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php
-%endif
-%if 1
-sed 's/function testFindMappingFileNamespacedFoundFileNotFound/function SKIP_testFindMappingFileNamespacedFoundFileNotFound/' \
- -i tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php
-%endif
+rm -f \
+ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2692Test.php \
+ tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3123Test.php
-# Weird el6 error
-# TODO: Investigate and submit upstream patch
-%if 0%{?el6}
-sed 's#$this->_em->clear();#if (isset($this->_em)) { $this->_em->clear(); }#' \
- -i tests/Doctrine/Tests/OrmFunctionalTestCase.php
-%endif
-%if 0%{?el5}
-# Seems to use sqlite3, not available
-rm tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php
+%if 0%{?rhel} < 7
+rm tests/Doctrine/Tests/ORM/Functional/Ticket/GH6464Test.php
%endif
-%{_bindir}/phpunit --verbose -d memory_limit="512M" --bootstrap bootstrap.php
-
-: Upstream tests with SCLs if available
-SCL_RETURN_CODE=0
-for SCL in %{?rhel:php54 php55} php56 php70 php71; do
- if which $SCL; then
- $SCL %{_bindir}/phpunit --verbose -d memory_limit="512M" \
- --bootstrap bootstrap.php || SCL_RETURN_CODE=1
+: Upstream tests
+RETURN_CODE=0
+PHPUNIT=$(which phpunit)
+for PHP_EXEC in "" %{?rhel:php55} php56 php70 php71 php72; do
+ if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
+ if [ $($PHP_EXEC -r 'echo PHP_VERSION_ID;') -ge 70200 ]; then
+ sed 's/function testQueryCache_HitDoesNotSaveParserResult/function SKIP_testQueryCache_HitDoesNotSaveParserResult/' \
+ -i tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php
+ fi
+
+ $PHP_EXEC $PHPUNIT --verbose -d memory_limit="512M" --bootstrap bootstrap.php \
+ || RETURN_CODE=1
fi
done
-exit $SCL_RETURN_CODE
+exit $RETURN_CODE
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md *.markdown composer.json
@@ -267,6 +290,9 @@ rm -rf %{buildroot}
%changelog
+* Wed Sep 20 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.11-1
+- Updated to 2.5.11 (RHBZ #1207905)
+
* Sat Feb 25 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.4.8-3
- Fix FTBFS in rawhide (RHBZ #1424060)
- Use php-composer(fedora/autoloader)