diff options
author | Remi Collet <remi@remirepo.net> | 2019-05-15 16:40:06 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-05-15 16:40:06 +0200 |
commit | 0d42d06f582989713c337ae5d91cac8e63610eb5 (patch) | |
tree | 288902e4cde5a9451188b39886326aad9a9fc8c2 /php-stecman-symfony-console-completion.spec | |
parent | 176e121aa16e53abd0f98fc6875663b5dbdce2bb (diff) |
Diffstat (limited to 'php-stecman-symfony-console-completion.spec')
-rw-r--r-- | php-stecman-symfony-console-completion.spec | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/php-stecman-symfony-console-completion.spec b/php-stecman-symfony-console-completion.spec index 1e90226..9799f5f 100644 --- a/php-stecman-symfony-console-completion.spec +++ b/php-stecman-symfony-console-completion.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-stecman-symfony-console-completion # -# Copyright (c) 2017 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2017-2019 Shawn Iwinski <shawn@iwin.ski> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,18 +12,18 @@ %global github_owner stecman %global github_name symfony-console-completion -%global github_version 0.7.0 -%global github_commit 5461d43e53092b3d3b9dbd9d999f2054730f4bbb +%global github_version 0.10.1 +%global github_commit 7bfa9b93e216896419f2f8de659935d7e04fecd8 %global composer_vendor stecman %global composer_project symfony-console-completion # "php": ">=5.3.2" %global php_min_ver 5.3.2 -# "symfony/console": "~2.3 || ~3.0" +# "symfony/console": "~2.3 || ~3.0 || ~4.0" # NOTE: Min version not 2.3 because autoloader required %global symfony_min_ver %{?el6:2.3.31}%{!?el6:2.7.1} -%global symfony_max_ver 4.0 +%global symfony_max_ver 5.0 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} @@ -35,7 +35,6 @@ Version: %{github_version} Release: 2%{?github_release}%{?dist} Summary: Automatic BASH completion for Symfony Console based applications -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 @@ -46,10 +45,14 @@ BuildArch: noarch ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) -BuildRequires: php-composer(symfony/console) < %{symfony_max_ver} -BuildRequires: php-composer(symfony/console) >= %{symfony_min_ver} -## phpcompatinfo for version 0.7.0 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(symfony/console) >= %{symfony_min_ver} with php-composer(symfony/console) < %{symfony_max_ver}) +%else +BuildRequires: php-symfony3-console +%endif +## phpcompatinfo for version 0.10.1 BuildRequires: php-pcre +BuildRequires: php-reflection BuildRequires: php-spl ## Autoloader BuildRequires: php-composer(fedora/autoloader) @@ -57,9 +60,13 @@ BuildRequires: php-composer(fedora/autoloader) # composer.json Requires: php(language) >= %{php_min_ver} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(symfony/console) >= %{symfony_min_ver} with php-composer(symfony/console) < %{symfony_max_ver}) +%else Requires: php-composer(symfony/console) < %{symfony_max_ver} Requires: php-composer(symfony/console) >= %{symfony_min_ver} -# phpcompatinfo for version 0.7.0 +%endif +# phpcompatinfo for version 0.10.1 Requires: php-pcre Requires: php-spl # Autoloader @@ -99,6 +106,7 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Dependencies::required(array( array( + '%{phpdir}/Symfony4/Component/Console/autoload.php', '%{phpdir}/Symfony3/Component/Console/autoload.php', '%{phpdir}/Symfony/Component/Console/autoload.php', ), @@ -113,22 +121,30 @@ cp -rp src %{buildroot}%{phpdir}/Stecman/Component/Symfony/Console/BashCompletio %check %if %{with_tests} +: Create tests bootstrap +cat <<'BOOTSTRAP' | tee -a bootstrap.php +<?php +require_once '%{buildroot}%{phpdir}/Stecman/Component/Symfony/Console/BashCompletion/autoload.php'; +if (!class_exists('PHPUnit\\Framework\\TestCase')) { + class_alias('PHPUnit_Framework_TestCase', 'PHPUnit\\Framework\\TestCase'); +} +BOOTSTRAP + %if 0%{?el6} : Skip tests requiring PHPUnit >= 4.4 sed \ -e 's/function testCompleteDoubleDash/function SKIP_testCompleteDoubleDash/' \ -e 's/function testCompleteOptionFull/function SKIP_testCompleteOptionFull/' \ + -e 's/function testCompleteOptionShortcutFirst/function SKIP_testCompleteOptionShortcutFirst/' \ -i tests/Stecman/Component/Symfony/Console/BashCompletion/CompletionHandlerTest.php %endif : Upstream tests RETURN_CODE=0 PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do +for PHP_EXEC in "" %{?rhel:php54 php55 php56 php70} php71 php72 php73 php74; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then - $PHP_EXEC $PHPUNIT --verbose \ - --bootstrap %{buildroot}%{phpdir}/Stecman/Component/Symfony/Console/BashCompletion/autoload.php \ - || RETURN_CODE=1 + $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php || RETURN_CODE=1 fi done exit $RETURN_CODE @@ -150,6 +166,13 @@ exit $RETURN_CODE %changelog +* Tue May 14 2019 Shawn Iwinski <shawn@iwin.ski> - 0.10.1-2 +- Fix EPEL6 build + +* Tue May 14 2019 Shawn Iwinski <shawn@iwin.ski> - 0.10.1-1 +- Update to 0.10.1 (RHBZ #1562562) +- Add range version dependencies for Fedora >= 27 || RHEL >= 8 + * Fri Nov 03 2017 Shawn Iwinski <shawn@iwin.ski> - 0.7.0-2 - Remove rename of license file |