# remirepo/fedora spec file for php-mock2 # # Copyright (c) 2016-2018 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # %global gh_commit 22d297231118e6fd5b9db087fbe1ef866c2b95d2 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner php-mock %global gh_project php-mock %global with_tests 0%{!?_without_tests:1} %global major 2 Name: php-mock%{major} Version: 2.0.0 Release: 2%{?dist} Summary: PHP-Mock can mock built-in PHP functions License: WTFPL URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz BuildArch: noarch BuildRequires: php(language) >= 5.6 %if %{with_tests} # from composer.json, "require-dev": { # "phpunit/phpunit": "^5.7" %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 2) %else BuildRequires: php-phpunit-Text-Template %endif BuildRequires: php-phpunit-PHPUnit >= 5.7 %endif # For autoloader BuildRequires: php-composer(fedora/autoloader) # from composer.json, "require": { # "php": ">=5.6", # "phpunit/php-text-template": "^1" Requires: php(language) >= 5.6 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(phpunit/php-text-template) >= 1 with php-composer(phpunit/php-text-template) < 2) %else Requires: php-phpunit-Text-Template %endif # From phpcompatinfo report from version 2.0.0 Requires: php-date Requires: php-reflection Requires: php-spl # For autoloader Requires: php-composer(fedora/autoloader) %if 0%{?fedora} > 21 || 0%{?rhel} >= 8 # from composer.json, "suggest": { # "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." Suggests: php-composer(php-mock/php-mock-phpunit) %endif Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} %description PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed. Autoloader: %{_datadir}/php/phpmock%{major}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} : Create autoloader cat << 'AUTOLOAD' | tee classes/autoload.php - 2.0.0-2 - use range dependencies on F27+ * Tue Dec 5 2017 Remi Collet - 2.0.0-1 - rename to php-mock2 - Update to 2.0.0 - raise dependency on PHP 5.6 * Thu May 11 2017 Remi Collet - 1.0.1-4 - switch to fedora/autoloader * Mon Feb 22 2016 Remi Collet - 1.0.1-2 - Fix: license is WTFPL, from review #1306968 * Fri Feb 12 2016 Remi Collet - 1.0.1-1 - initial package