From 4d9264c817e119d05dcde83fb1790d0cd8a3240a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 4 Mar 2017 16:56:34 +0100 Subject: php-doctrine-collections: 1.4.0 (backported from Fedora) --- composer.json | 35 ++++++++++++++++ php-doctrine-collections.spec | 92 ++++++++++++++++++++++--------------------- 2 files changed, 83 insertions(+), 44 deletions(-) create mode 100644 composer.json 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 +# Copyright (c) 2013-2017 Shawn Iwinski # # 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 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 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 - 1.4.0-1 +- Updated to 1.4.0 (RHBZ #1415530) +- Switched autoloader to php-composer(fedora/autoloader) + * Sat Jun 27 2015 Shawn Iwinski - 1.3.0-3 - Updated autoloader with trailing separator -- cgit