summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json11
-rw-r--r--php-doctrine-common3.spec177
2 files changed, 46 insertions, 142 deletions
diff --git a/composer.json b/composer.json
index 92aa5ec..655bfaa 100644
--- a/composer.json
+++ b/composer.json
@@ -19,14 +19,7 @@
],
"require": {
"php": "^7.1 || ^8.0",
- "doctrine/inflector": "^1.0",
- "doctrine/cache": "^1.0",
- "doctrine/collections": "^1.0",
- "doctrine/lexer": "^1.0",
- "doctrine/annotations": "^1.0",
- "doctrine/event-manager": "^1.0",
- "doctrine/reflection": "^1.0",
- "doctrine/persistence": "^1.3.3"
+ "doctrine/persistence": "^2.0"
},
"require-dev": {
"phpstan/phpstan": "^0.11",
@@ -48,7 +41,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "2.11.x-dev"
+ "dev-master": "3.0.x-dev"
}
}
}
diff --git a/php-doctrine-common3.spec b/php-doctrine-common3.spec
index 483cec0..8e97b78 100644
--- a/php-doctrine-common3.spec
+++ b/php-doctrine-common3.spec
@@ -1,8 +1,6 @@
-# remirepo spec file for php-doctrine-common, from:
+# remirepo/fedora spec file for php-doctrine-common3
#
-# Fedora spec file for php-doctrine-common
-#
-# Copyright (c) 2013-2019 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2013-2020 Shawn Iwinski, Remi Collet
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,54 +10,32 @@
%global github_owner doctrine
%global github_name common
-%global github_version 2.13.1
-%global github_commit fb00cd761126b11d8f334c09cf5b1f3f83fefc17
+%global github_version 3.0.0
+%global github_commit 05ab20457d332cc0eef880b17cdbbffcd6af526f
+%global major 3
%global composer_vendor doctrine
%global composer_project common
+%global ns_vendor Doctrine
+%global ns_project Common
+
# "php": "^7.1 || ^8.0"
%global php_min_ver 7.1
-# "doctrine/annotations": "^1.0"
-# NOTE: Min version not 1.0 because autoloader required
-%global doctrine_annotations_min_ver 1.2.6
-%global doctrine_annotations_max_ver 2.0
-# "doctrine/cache": "^1.0"
-# NOTE: Min version not 1.0 because autoloader required
-%global doctrine_cache_min_ver 1.4.1
-%global doctrine_cache_max_ver 2.0
-# "doctrine/collections": "^1.0"
-# NOTE: Min version not 1.0 because autoloader required
-%global doctrine_collections_min_ver 1.3.0
-%global doctrine_collections_max_ver 2.0
-# "doctrine/inflector": "^1.0"
-# NOTE: Min version not 1.0 because autoloader required
-%global doctrine_inflector_min_ver 1.0.1
-%global doctrine_inflector_max_ver 2.0
-# "doctrine/lexer": "^1.0"
-# NOTE: Min version not 1.0 because autoloader required
-%global doctrine_lexer_min_ver 1.0.1
-%global doctrine_lexer_max_ver 2.0
-# "doctrine/event-manager": "^1.0"
-%global doctrine_event_min_ver 1.0
-%global doctrine_event_max_ver 2
-# "doctrine/reflection": "^1.0"
-%global doctrine_refl_min_ver 1.0
-%global doctrine_refl_max_ver 2
-# "doctrine/persistence": "^1.3.3"
-%global doctrine_pers_min_ver 1.3.3
-%global doctrine_pers_max_ver 2
+# "doctrine/persistence": "^2.0"
+%global doctrine_pers_min_ver 2.0
+%global doctrine_pers_max_ver 3
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
%{!?phpdir: %global phpdir %{_datadir}/php}
-Name: php-%{composer_vendor}-%{composer_project}
+Name: php-%{composer_vendor}-%{composer_project}%{major}
Epoch: 1
Version: %{github_version}
Release: 1%{?dist}
-Summary: Common library for Doctrine projects
+Summary: Common library for Doctrine projects version %{major}
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
@@ -67,7 +43,7 @@ URL: https://github.com/%{github_owner}/%{github_name}
# GitHub export does not include tests.
# Run php-doctrine-common-get-source.sh to create full source.
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
-Source1: %{name}-get-source.sh
+Source1: makesrc.sh
BuildArch: noarch
# Library version value check
@@ -78,147 +54,75 @@ BuildRequires: php-cli
BuildRequires: php(language) >= %{php_min_ver}
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver} with php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver})
-BuildRequires: (php-composer(doctrine/cache) >= %{doctrine_cache_min_ver} with php-composer(doctrine/cache) < %{doctrine_cache_max_ver})
-BuildRequires: (php-composer(doctrine/collections) >= %{doctrine_collections_min_ver} with php-composer(doctrine/collections) < %{doctrine_collections_max_ver})
-BuildRequires: (php-composer(doctrine/inflector) >= %{doctrine_inflector_min_ver} with php-composer(doctrine/inflector) < %{doctrine_inflector_max_ver})
-BuildRequires: (php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} with php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver})
-BuildRequires: (php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver} with php-composer(doctrine/event-manager) < %{doctrine_event_max_ver})
-BuildRequires: (php-composer(doctrine/reflection) >= %{doctrine_refl_min_ver} with php-composer(doctrine/reflection) < %{doctrine_refl_max_ver})
BuildRequires: (php-composer(doctrine/persistence) >= %{doctrine_pers_min_ver} with php-composer(doctrine/persistence) < %{doctrine_pers_max_ver})
-# remirepo:18
+# remirepo:3
%else
-BuildRequires: php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver}
-BuildRequires: php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver}
-BuildRequires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
-BuildRequires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
-BuildRequires: php-composer(doctrine/collections) < %{doctrine_collections_max_ver}
-BuildRequires: php-composer(doctrine/collections) >= %{doctrine_collections_min_ver}
-BuildRequires: php-composer(doctrine/inflector) < %{doctrine_inflector_max_ver}
-BuildRequires: php-composer(doctrine/inflector) >= %{doctrine_inflector_min_ver}
-BuildRequires: php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver}
-BuildRequires: php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver}
-BuildRequires: php-composer(doctrine/event-manager) < %{doctrine_event_max_ver}
-BuildRequires: php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver}
-BuildRequires: php-composer(doctrine/reflection) >= %{doctrine_refl_min_ver}
-BuildRequires: php-composer(doctrine/reflection) < %{doctrine_refl_max_ver}
-BuildRequires: php-composer(doctrine/persistence) >= %{doctrine_pers_min_ver}
-BuildRequires: php-composer(doctrine/persistence) < %{doctrine_pers_max_ver}
+BuildRequires: php-doctrine-persistence2
%endif
BuildRequires: phpunit7
-## phpcompatinfo (computed from version 2.8.1)
+## phpcompatinfo (computed from version 3.0.0)
+BuildRequires: php-reflection
BuildRequires: php-date
BuildRequires: php-pcre
-BuildRequires: php-reflection
BuildRequires: php-spl
-BuildRequires: php-tokenizer
# Autoloader
-BuildRequires: php-composer(fedora/autoloader)
+BuildRequires: php-fedora-autoloader-devel
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver} with php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver})
-Requires: (php-composer(doctrine/cache) >= %{doctrine_cache_min_ver} with php-composer(doctrine/cache) < %{doctrine_cache_max_ver})
-Requires: (php-composer(doctrine/collections) >= %{doctrine_collections_min_ver} with php-composer(doctrine/collections) < %{doctrine_collections_max_ver})
-Requires: (php-composer(doctrine/inflector) >= %{doctrine_inflector_min_ver} with php-composer(doctrine/inflector) < %{doctrine_inflector_max_ver})
-Requires: (php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} with php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver})
-Requires: (php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver} with php-composer(doctrine/event-manager) < %{doctrine_event_max_ver})
-Requires: (php-composer(doctrine/reflection) >= %{doctrine_refl_min_ver} with php-composer(doctrine/reflection) < %{doctrine_refl_max_ver})
Requires: (php-composer(doctrine/persistence) >= %{doctrine_pers_min_ver} with php-composer(doctrine/persistence) < %{doctrine_pers_max_ver})
-# remirepo:18
+# remirepo:3
%else
-Requires: php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver}
-Requires: php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver}
-Requires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
-Requires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
-Requires: php-composer(doctrine/collections) >= %{doctrine_collections_min_ver}
-Requires: php-composer(doctrine/collections) < %{doctrine_collections_max_ver}
-Requires: php-composer(doctrine/inflector) >= %{doctrine_inflector_min_ver}
-Requires: php-composer(doctrine/inflector) < %{doctrine_inflector_max_ver}
-Requires: php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver}
-Requires: php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver}
-Requires: php-composer(doctrine/event-manager) < %{doctrine_event_max_ver}
-Requires: php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver}
-Requires: php-composer(doctrine/reflection) >= %{doctrine_refl_min_ver}
-Requires: php-composer(doctrine/reflection) < %{doctrine_refl_max_ver}
-Requires: php-composer(doctrine/persistence) >= %{doctrine_pers_min_ver}
-Requires: php-composer(doctrine/persistence) < %{doctrine_pers_max_ver}
+Requires: php-doctrine-persistence2
%endif
-# phpcompatinfo (computed from version 2.8.1)
-Requires: php-pcre
+# phpcompatinfo (computed from version 3.0.0)
Requires: php-reflection
+Requires: php-pcre
Requires: php-spl
-Requires: php-tokenizer
# Autoloader
Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
-# PEAR
-Provides: php-pear(pear.doctrine-project.org/DoctrineCommon) = %{version}
-# Rename
-Obsoletes: php-doctrine-DoctrineCommon < %{version}
-Provides: php-doctrine-DoctrineCommon = %{version}
+
%description
The Doctrine Common project is a library that provides extensions to core PHP
functionality.
-Autoloader: %{phpdir}/Doctrine/Common/autoload.php
+Autoloader: %{phpdir}/%{ns_vendor}/%{ns_project}%{major}/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
-sed -e 's/2.12.0-DEV/%{version}/' -i lib/Doctrine/Common/Version.php
-
%build
: Create autoloader
-cat <<'AUTOLOAD' | tee lib/Doctrine/Common/autoload.php
-<?php
-/**
- * Autoloader for %{name} and its' dependencies
- * (created by %{name}-%{version}-%{release}).
- */
-require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
-
-\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Common\\', __DIR__);
+phpab --template fedora \
+ --output lib/%{ns_vendor}/%{ns_project}/autoload.php \
+ lib/%{ns_vendor}/%{ns_project}
+cat <<'AUTOLOAD' | tee -a lib/%{ns_vendor}/%{ns_project}/autoload.php
\Fedora\Autoloader\Dependencies::required(array(
- '%{phpdir}/Doctrine/Common/Annotations/autoload.php',
- '%{phpdir}/Doctrine/Common/Cache/autoload.php',
- '%{phpdir}/Doctrine/Common/Collections/autoload.php',
- '%{phpdir}/Doctrine/Common/Inflector/autoload.php',
- '%{phpdir}/Doctrine/Common/Lexer/autoload.php',
- '%{phpdir}/Doctrine/Common/EventManager/autoload.php',
- '%{phpdir}/Doctrine/Common/Reflection/autoload.php',
- '%{phpdir}/Doctrine/Common/Persistence/autoload.php',
+ '%{phpdir}/%{ns_vendor}/Persistence2/autoload.php',
));
AUTOLOAD
%install
-mkdir -p %{buildroot}%{phpdir}
-cp -rp lib/* %{buildroot}%{phpdir}/
+mkdir -p %{buildroot}%{phpdir}/%{ns_vendor}
+cp -rp lib/%{ns_vendor}/%{ns_project} %{buildroot}%{phpdir}/%{ns_vendor}/%{ns_project}%{major}
%check
-: Library version value check
-%{_bindir}/php -r '
- require_once "%{buildroot}%{phpdir}/Doctrine/Common/Version.php";
- $version = \Doctrine\Common\Version::VERSION;
- echo "Version $version (expected %{version})\n";
- exit(version_compare("%{version}", "$version", "=") ? 0 : 1);
-'
-
%if %{with_tests}
: Modify tests init
-sed "s#require.*autoload.*#require_once '%{buildroot}%{phpdir}/Doctrine/Common/autoload.php';#" \
- -i tests/Doctrine/Tests/TestInit.php
+sed "s#require.*autoload.*#require_once '%{buildroot}%{phpdir}/%{ns_vendor}/%{ns_project}%{major}/autoload.php';#" \
+ -i tests/%{ns_vendor}/Tests/TestInit.php
: Upstream tests
@@ -241,12 +145,19 @@ exit $RETURN_CODE
%doc *.md
%doc UPGRADE*
%doc composer.json
-%{phpdir}/Doctrine/Common/*.php
-%{phpdir}/Doctrine/Common/Proxy
-%{phpdir}/Doctrine/Common/Util
+%{phpdir}/%{ns_vendor}/%{ns_project}%{major}
%changelog
+* Tue May 26 2020 Remi Collet <remi@remirepo.net> - 3.0.0-1
+- update to 3.0.0
+- rename to php-doctrine-common3
+- move to /usr/share/php/Doctrine/Common3
+- raise dependency on doctrine/persistence 2.0
+- drop dependency on doctrine/inflector, doctrine/cache, doctrine/collections,
+ doctrine/lexer, doctrine/annotations, doctrine/event-manager and
+ and doctrine/reflection
+
* Tue May 26 2020 Remi Collet <remi@remirepo.net> - 2.13.1-1
- update to 2.13.1