# remirepo/fedora spec file for php-phpspec # # Copyright (c) 2015-2017 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %global gh_commit 30f329cf253e581dac4410d5dbbd8b778b180028 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phpspec %global gh_project phpspec #global prever beta3 # Only allow a single Symfony version # to ensure components consistency %global symfony_ns Symfony3 %global symfony_min 3.2 %global symfony_max 4 Name: php-phpspec Version: 4.2.0 Release: 2%{?dist} Summary: Specification-oriented BDD framework for PHP Group: Development/Libraries License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}-%{gh_short}.tar.gz Source1: %{gh_project}-autoload.php # Use our autoloader Patch0: %{gh_project}-4-rpm.patch BuildArch: noarch BuildRequires: php(language) >= 7.0 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(sebastian/exporter) < 4 BuildRequires: php-composer(sebastian/exporter) >= 3 BuildRequires: php-symfony3-console >= %{symfony_min} BuildRequires: php-symfony3-event-dispatcher >= %{symfony_min} BuildRequires: php-symfony3-finder >= %{symfony_min} BuildRequires: php-symfony3-process >= %{symfony_min} BuildRequires: php-symfony3-yaml >= %{symfony_min} 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.2", # "phpunit/phpunit": "^5.7|^6.0", BuildRequires: php-composer(symfony/filesystem) < %{symfony_max} BuildRequires: php-composer(symfony/filesystem) >= %{symfony_min} BuildRequires: phpunit6 # Autoloader BuildRequires: php-composer(fedora/autoloader) >= 1 # From composer.json, require # "php": "^7.0,<7.3", # "phpspec/prophecy": "^1.5", # "phpspec/php-diff": "^1.0.0", # "sebastian/exporter": "^1.0 || ^2.0 || ^3.0", # "symfony/console": "^3.2", # "symfony/event-dispatcher": "^3.2", # "symfony/process": "^3.2", # "symfony/finder": "^3.2", # "symfony/yaml": "^3.2", # "doctrine/instantiator": "^1.0.5" # "ext-tokenizer": "*" Requires: php(language) >= 7.0 Requires: php-composer(phpspec/prophecy) >= 1.5 Requires: php-composer(phpspec/prophecy) < 2 Requires: php-composer(phpspec/php-diff) >= 1.0.0 Requires: php-composer(phpspec/php-diff) < 2 Requires: php-composer(sebastian/exporter) < 4 Requires: php-composer(sebastian/exporter) >= 3 Requires: php-symfony3-console >= %{symfony_min} Requires: php-symfony3-event-dispatcher >= %{symfony_min} Requires: php-symfony3-finder >= %{symfony_min} Requires: php-symfony3-process >= %{symfony_min} Requires: php-symfony3-yaml >= %{symfony_min} Requires: php-composer(doctrine/instantiator) >= 1.0.5 Requires: php-composer(doctrine/instantiator) < 2 Requires: php-tokenizer # Autoloader Requires: php-composer(fedora/autoloader) >= 1 # From phpcompatinfo report Requires: php-json Requires: php-pcntl Requires: php-pcre Requires: php-reflection Requires: php-spl # Composer Provides: php-composer(phpspec/phpspec) = %{version} # The application Provides: phpspec = %{version} %description phpspec is a tool which can help you write clean and working PHP code using behaviour driven development or BDD. BDD is a technique derived from test-first development. BDD is a technique used at story level and spec level. phpspec is a tool for use at the spec level or SpecBDD. The technique is to first use a tool like phpspec to describe the behaviour of an object you are about to write. Next you write just enough code to meet that specification and finally you refactor this code. %prep %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p0 -b .rpm sed -e 's/@SYMFONY@/%{symfony_ns}/' \ %{SOURCE1} > src/PhpSpec/autoload.php %build # Nothing %install # No namespace, so use a package specific dir mkdir -p %{buildroot}%{_datadir}/php cp -pr src/PhpSpec %{buildroot}%{_datadir}/php/PhpSpec install -Dpm755 bin/phpspec %{buildroot}%{_bindir}/phpspec %check export LANG=en_GB.utf8 # Ignore this test which use bossa/phpspec2-expect rm spec/PhpSpec/Message/CurrentExampleTrackerSpec.php # Ignore this test which rely on composer installation rm spec/PhpSpec/NamespaceProvider/ComposerPsrNamespaceProviderSpec.php for cmd in php php70 php71 php72; do if which $cmd; then $cmd -d memory_limit=1G -d include_path=.:%{buildroot}%{_datadir}/php \ bin/phpspec \ run --format pretty --verbose --no-ansi $cmd %{_bindir}/phpunit6 \ --verbose \ --bootstrap %{buildroot}%{_datadir}/php/PhpSpec/autoload.php fi done %files %{!?_licensedir:%global license %%doc} %license LICENSE %doc README.* CHANGES.* %doc composer.json %{_bindir}/phpspec %{_datadir}/php/PhpSpec %changelog * Tue Nov 7 2017 Remi Collet - 4.2.0-2 - fix FTBFS from Koschei using symfony package names * Sun Oct 29 2017 Remi Collet - 4.2.0-1 - Update to 4.2.0 * Thu Oct 19 2017 Remi Collet - 4.1.0-1 - Update to 4.1.0 * Sun Aug 27 2017 Remi Collet - 4.0.3-1 - Update to 4.0.3 - raise memory_limit for test suite * Mon Aug 7 2017 Remi Collet - 4.0.2-1 - Update to 4.0.2 - raise dependency on symfony 3.2 - raise dependency on PHP 7.0 - switch to phpunit6 * Fri May 12 2017 Remi Collet - 3.4.0-1 - Update to 3.4.0 * Thu May 11 2017 Remi Collet - 3.3.0-3 - only allow a single Symfony version * Mon May 8 2017 Remi Collet - 3.3.0-2 - fix autoloader for Symfony 3 - always use symfony 3 during the build (per upstream) * Thu Apr 27 2017 Remi Collet - 3.3.0-1 - Update to 3.3.0 - use phpunit6 on F26+ * Fri Mar 3 2017 Remi Collet - 3.2.3-3 - fix autoloader for dep. with multiple versions * Sun Jan 29 2017 Remi Collet - 3.2.3-1 - update to 3.2.3 * Tue Dec 6 2016 Remi Collet - 3.2.2-1 - update to 3.2.2 * Mon Dec 5 2016 Remi Collet - 3.2.1-1 - update to 3.2.1 * Mon Nov 28 2016 Remi Collet - 3.2.0-1 - update to 3.2.0 * Tue Nov 22 2016 Remi Collet - 3.1.1-2 - ignore sebastian/exporter max version - switch to fedora/autoloader * Tue Sep 27 2016 Remi Collet - 3.1.1-1 - update to 3.1.1 * Mon Sep 19 2016 Remi Collet - 3.1.0-1 - update to 3.1.0 * Mon Jul 18 2016 Remi Collet - 3.0.0-1 - update to 3.0.0 - raise dependency on php ^5.6 || ^7.0 - raise dependency on phpspec/prophecy ^1.5 - raise dependency on symfony/console ^2.7 || ^3.0 * Mon Jul 18 2016 Remi Collet - 2.5.1-1 - update to 2.5.1 * Mon Mar 21 2016 Remi Collet - 2.5.0-1 - update to 2.5.0 * Sat Jan 2 2016 Remi Collet - 2.4.1-1 - update to 2.4.1 * Sun Nov 29 2015 Remi Collet - 2.4.0-1 - update to 2.4.0 - allow to use symfony 3.0 * Wed Oct 28 2015 Remi Collet - 2.3.0-1 - update to 2.3.0 * Thu Aug 13 2015 Remi Collet - 2.3.0-0.1.beta1 - update to 2.3.0beta3 * Mon Jun 29 2015 Remi Collet - 2.2.1-3 - switch to $fedoraClassLoader autoloader - ensure /usr/share/php is in include_path * Sat May 30 2015 Remi Collet - 2.2.1-1 - update to 2.2.1 * Sun Apr 19 2015 Remi Collet - 2.2.0-1 - update to 2.2.0 - raise dependency on phpspec/prophecy 1.4 * Tue Feb 17 2015 Remi Collet - 2.1.1-1 - initial package