summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-phpspec.spec28
-rw-r--r--phpspec-autoload.php9
2 files changed, 27 insertions, 10 deletions
diff --git a/php-phpspec.spec b/php-phpspec.spec
index be98448..6f0153f 100644
--- a/php-phpspec.spec
+++ b/php-phpspec.spec
@@ -14,7 +14,7 @@
Name: php-phpspec
Version: 3.3.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Specification-oriented BDD framework for PHP
Group: Development/Libraries
@@ -28,20 +28,28 @@ Source1: %{gh_project}-autoload.php
Patch0: %{gh_project}-3-rpm.patch
BuildArch: noarch
-BuildRequires: php-composer(phpspec/prophecy) >= 1.4
+BuildRequires: php-composer(phpspec/prophecy) < 2
+BuildRequires: php-composer(phpspec/prophecy) >= 1.5
+BuildRequires: php-composer(phpspec/php-diff) < 2
BuildRequires: php-composer(phpspec/php-diff) >= 1.0.0
-BuildRequires: php-composer(symfony/console) >= 2.3.0
-BuildRequires: php-composer(symfony/event-dispatcher) >= 2.1
-BuildRequires: php-composer(symfony/finder) >= 2.1
-BuildRequires: php-composer(symfony/process) >= 2.6
-BuildRequires: php-composer(symfony/yaml) >= 2.1
+BuildRequires: php-composer(symfony/console) < 4
+BuildRequires: php-composer(symfony/console) >= 3
+BuildRequires: php-composer(symfony/event-dispatcher) < 4
+BuildRequires: php-composer(symfony/event-dispatcher) >= 3
+BuildRequires: php-composer(symfony/finder) < 4
+BuildRequires: php-composer(symfony/finder) >= 3
+BuildRequires: php-composer(symfony/process) < 4
+BuildRequires: php-composer(symfony/process) >= 3
+BuildRequires: php-composer(symfony/yaml) < 4
+BuildRequires: php-composer(symfony/yaml) >= 3
+BuildRequires: php-composer(doctrine/instantiator) < 2
BuildRequires: php-composer(doctrine/instantiator) >= 1.0.1
# From composer.json, require-dev
# "behat/behat": "^3.3",
# "symfony/filesystem": "^3.0",
# "phpunit/phpunit": "^5.5|^6.0",
# "ciaranmcnulty/versionbasedtestskipper": "^0.2.1"
-BuildRequires: php-composer(symfony/filesystem) >= 2.1
+BuildRequires: php-composer(symfony/filesystem) >= 3
%if 0%{?fedora} >= 26
BuildRequires: php-composer(sebastian/exporter) < 4
%global phpunit %{_bindir}/phpunit6
@@ -190,6 +198,10 @@ fi
%changelog
+* Mon May 8 2017 Remi Collet <remi@remirepo.net> - 3.3.0-2
+- fix autoloader for Symfony 3
+- always use symfony 3 during the build (per upstream)
+
* Thu Apr 27 2017 Remi Collet <remi@remirepo.net> - 3.3.0-1
- Update to 3.3.0
- use phpunit6 on F26+
diff --git a/phpspec-autoload.php b/phpspec-autoload.php
index 13e657f..f8fae7e 100644
--- a/phpspec-autoload.php
+++ b/phpspec-autoload.php
@@ -4,8 +4,13 @@
require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('PhpSpec\\', __DIR__);
-$vendorDir = stream_resolve_include_path('Symfony/Component/Console/Application.php');
-\Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\', dirname(dirname($vendorDir)));
+if ($f = stream_resolve_include_path('Symfony3/Component/Console/Application.php')) {
+ \Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\', dirname(dirname($f)));
+} else if ($f = stream_resolve_include_path('Symfony/Component/Console/Application.php')) {
+ \Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\', dirname(dirname($f)));
+} else {
+ die("Can't find Symfony Framework\n");
+}
/* spec tree in current dir, when exists */
if (is_dir(getcwd().'/spec')) {