diff options
author | Remi Collet <fedora@famillecollet.com> | 2017-03-04 16:56:34 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2017-03-04 16:56:34 +0100 |
commit | 4d9264c817e119d05dcde83fb1790d0cd8a3240a (patch) | |
tree | 6e261accde3e8d1eb055763f8b9f945fc0f77af8 | |
parent | de2ba73d9440b6c8c33a667c0894bf3f9af3650c (diff) |
php-doctrine-collections: 1.4.0 (backported from Fedora)
-rw-r--r-- | composer.json | 35 | ||||
-rw-r--r-- | php-doctrine-collections.spec | 92 |
2 files changed, 83 insertions, 44 deletions
diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..385fa93 --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "doctrine/collections", + "type": "library", + "description": "Collections Abstraction library", + "keywords": ["collections", "array", "iterator"], + "homepage": "http://www.doctrine-project.org", + "license": "MIT", + "authors": [ + {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, + {"name": "Roman Borschel", "email": "roman@code-factory.org"}, + {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, + {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, + {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} + ], + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "doctrine/coding-standard": "~0.1@dev" + }, + "autoload": { + "psr-0": { "Doctrine\\Common\\Collections\\": "lib/" } + }, + "autoload-dev": { + "psr-4": { + "Doctrine\\Tests\\": "tests/Doctrine/Tests" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + } +} diff --git a/php-doctrine-collections.spec b/php-doctrine-collections.spec index 36cf889..8164b44 100644 --- a/php-doctrine-collections.spec +++ b/php-doctrine-collections.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-doctrine-collections # -# 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 collections -%global github_version 1.3.0 -%global github_commit 6c1e4eef75f310ea1b3e30945e9f06e652128b8a +%global github_version 1.4.0 +%global github_commit 1a4fb7e902202c33cce8c55989b945612943c2ba %global composer_vendor doctrine %global composer_project collections -# "php": ">=5.3.2" -%global php_min_ver 5.3.2 +# "php": "^5.6 || ^7.0" +%global php_min_ver 5.6 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} @@ -28,13 +28,17 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 3%{?github_release}%{?dist} +Release: 1%{?github_release}%{?dist} Summary: Collections abstraction library 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 + +# GitHub export does not include tests. +# Run php-doctrine-collections-get-source.sh to create full source. +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -43,18 +47,20 @@ BuildArch: noarch ## composer.json BuildRequires: %{_bindir}/phpunit BuildRequires: php(language) >= %{php_min_ver} -## phpcompatinfo (computed from version 1.3.0) +## phpcompatinfo (computed from version 1.4.0) +BuildRequires: php-pcre BuildRequires: php-spl # Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 1.3.0) +# phpcompatinfo (computed from version 1.4.0) +Requires: php-pcre Requires: php-spl # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -65,37 +71,25 @@ Conflicts: php-pear(pear.doctrine-project.org/DoctrineCommon) < 2.4 %description %{summary}. +Autoloader: %{phpdir}/Doctrine/Common/Collections/autoload.php + %prep %setup -qn %{github_name}-%{github_commit} + +%build : Create autoloader -(cat <<'AUTOLOAD' +cat <<'AUTOLOAD' | tee lib/Doctrine/Common/Collections/autoload.php <?php /** - * Autoloader created by %{name}-%{version}-%{release} - * - * @return \Symfony\Component\ClassLoader\ClassLoader + * Autoloader for %{name} and its' dependencies + * (created by %{name}-%{version}-%{release}). */ +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\\Collections\\', dirname(dirname(dirname(__DIR__)))); - -return $fedoraClassLoader; +\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Common\\Collections\\', __DIR__); AUTOLOAD -) | tee lib/Doctrine/Common/Collections/autoload.php - - -%build -# Empty build section, nothing required %install @@ -106,19 +100,25 @@ cp -rp lib/* %{buildroot}%{phpdir}/ %check %if %{with_tests} -: Create tests autoloader -(cat <<'AUTOLOAD' +: Create tests bootstrap +cat <<'BOOTSTRAP' | tee bootstrap.php <?php - -$fedoraClassLoader = - require_once '%{buildroot}%{phpdir}/Doctrine/Common/Collections/autoload.php'; - -$fedoraClassLoader->addPrefix('Doctrine\\Tests', __DIR__ . '/tests'); -AUTOLOAD -) | tee autoload.php - -: Run tests -%{_bindir}/phpunit -v --bootstrap autoload.php +require_once '%{buildroot}%{phpdir}/Doctrine/Common/Collections/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Tests\\', __DIR__.'/tests/Doctrine/Tests'); +BOOTSTRAP + +: Upstream tests +%{_bindir}/phpunit --verbose --bootstrap bootstrap.php + +: Upstream tests with SCLs if available +SCL_RETURN_CODE=0 +for SCL in php70 php71; do + if which $SCL; then + $SCL %{_bindir}/phpunit --verbose --bootstrap bootstrap.php \ + || SCL_RETURN_CODE=1 + fi +done +exit $SCL_RETURN_CODE %else : Tests skipped %endif @@ -140,6 +140,10 @@ rm -rf %{buildroot} %changelog +* Sat Mar 04 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.4.0-1 +- Updated to 1.4.0 (RHBZ #1415530) +- Switched autoloader to php-composer(fedora/autoloader) + * Sat Jun 27 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-3 - Updated autoloader with trailing separator |