summaryrefslogtreecommitdiffstats
path: root/php-doctrine-common.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-doctrine-common.spec')
-rw-r--r--php-doctrine-common.spec130
1 files changed, 64 insertions, 66 deletions
diff --git a/php-doctrine-common.spec b/php-doctrine-common.spec
index e9ef912..364e75f 100644
--- a/php-doctrine-common.spec
+++ b/php-doctrine-common.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-doctrine-common
#
-# Copyright (c) 2013-2015 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2013-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,14 +12,14 @@
%global github_owner doctrine
%global github_name common
-%global github_version 2.5.3
-%global github_commit 10f1f19651343f87573129ca970aef1a47a6f29e
+%global github_version 2.7.2
+%global github_commit 930297026c8009a567ac051fd545bf6124150347
%global composer_vendor doctrine
%global composer_project common
-# "php": ">=5.3.2"
-%global php_min_ver 5.3.2
+# "php": "~5.6|~7.0"
+%global php_min_ver 5.6
# "doctrine/annotations": "1.*"
# NOTE: Min version not 1.0 because autoloader required
%global doctrine_annotations_min_ver 1.2.6
@@ -54,55 +54,63 @@ Summary: Common library for Doctrine projects
Group: Development/Libraries
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
-Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# 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
+
BuildArch: noarch
# Library version value check
BuildRequires: php-cli
# Tests
%if %{with_tests}
## composer.json
-BuildRequires: %{_bindir}/phpunit
-BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php(language) >= %{php_min_ver}
+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_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_min_ver}
-BuildRequires: php-doctrine-inflector >= %{doctrine_inflector_min_ver}
-#BuildRequires: php-composer(doctrine/lexer) >= %%{doctrine_lexer_min_ver}
-BuildRequires: php-doctrine-lexer >= %{doctrine_lexer_min_ver}
-## phpcompatinfo (computed from version 2.5.3)
+BuildRequires: php-composer(doctrine/inflector) < %{doctrine_inflector_max_ver}
+#BuildRequires: php-composer(doctrine/inflector) >= %%{doctrine_inflector_min_ver}
+BuildRequires: php-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-doctrine-lexer >= %{doctrine_lexer_min_ver}
+BuildRequires: php-composer(phpunit/phpunit)
+## phpcompatinfo (computed from version 2.7.2)
BuildRequires: php-date
BuildRequires: php-pcre
BuildRequires: php-reflection
BuildRequires: php-spl
BuildRequires: php-tokenizer
# Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
-Requires: php(language) >= %{php_min_ver}
+Requires: php(language) >= %{php_min_ver}
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/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-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-doctrine-lexer >= %{doctrine_lexer_min_ver}
-Requires: php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver}
-# phpcompatinfo (computed from version 2.5.0)
+#Requires: php-composer(doctrine/inflector) >= %%{doctrine_inflector_min_ver}
+Requires: php-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-doctrine-lexer >= %{doctrine_lexer_min_ver}
+Requires: php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver}
+# phpcompatinfo (computed from version 2.7.2)
Requires: php-pcre
Requires: php-reflection
Requires: php-spl
Requires: php-tokenizer
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -122,6 +130,9 @@ Autoloader: %{phpdir}/Doctrine/Common/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
+: Fix version
+sed -i 's#2.7.0-DEV#%{version}#' lib/Doctrine/Common/Version.php
+
%build
: Create autoloader
@@ -130,33 +141,22 @@ cat <<'AUTOLOAD' | tee lib/Doctrine/Common/autoload.php
/**
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
- *
- * @return \Symfony\Component\ClassLoader\ClassLoader
*/
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$fedoraClassLoader->addPrefix('Doctrine\\Common\\', dirname(dirname(__DIR__)));
-
-require_once '%{phpdir}/Doctrine/Common/Annotations/autoload.php';
-require_once '%{phpdir}/Doctrine/Common/Cache/autoload.php';
-require_once '%{phpdir}/Doctrine/Common/Collections/autoload.php';
-require_once '%{phpdir}/Doctrine/Common/Inflector/autoload.php';
-require_once '%{phpdir}/Doctrine/Common/Lexer/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Common\\', __DIR__);
-return $fedoraClassLoader;
+\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',
+));
AUTOLOAD
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{phpdir}
cp -rp lib/* %{buildroot}%{phpdir}/
@@ -184,31 +184,21 @@ sed -e 's/function testGetManagerForAliasedClass/function SKIP_testGetManagerFor
-i tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php
%endif
-run=0
-ret=0
-if which php56; then
- php56 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --verbose
-fi
-exit $ret
+: Upstream tests
+RETURN_CODE=0
+PHPUNIT=$(which phpunit)
+for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do
+ if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC $PHPUNIT --verbose || RETURN_CODE=1
+ fi
+done
+exit $RETURN_CODE
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -222,6 +212,14 @@ rm -rf %{buildroot}
%changelog
+* Sun Jul 09 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.7.2-1
+- Updated to 2.7.2 (RHBZ #1258673)
+
+* Fri May 12 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.3-3
+- Switch autoloader to php-composer(fedora/autoloader)
+- Add max versions to build dependencies
+- Test with SCLs if available
+
* Fri Jul 22 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.3-1
- Updated to 2.5.3 (RHBZ #1347924 / CVE-2015-5723)
- Added library version value check