From cbee9c31dbafdbf748eea93043194608cd08f889 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 19 Jun 2019 09:45:31 +0200 Subject: v1.2.1 from Fedora --- composer.json | 58 +++++++++++++++++++++-- php-consolidation-config.spec | 105 ++++++++++++++++++++++++++++-------------- 2 files changed, 123 insertions(+), 40 deletions(-) diff --git a/composer.json b/composer.json index ef01de5..f9060cc 100644 --- a/composer.json +++ b/composer.json @@ -21,20 +21,68 @@ "require": { "php": ">=5.4.0", "dflydev/dot-access-data": "^1.1.0", - "grasmash/yaml-expander": "^1.1" + "grasmash/expander": "^1" }, "require-dev": { - "phpunit/phpunit": "^4", - "symfony/console": "^2.5|^3", - "satooshi/php-coveralls": "^1.0", + "phpunit/phpunit": "^5", + "g1a/composer-test-scenarios": "^3", + "symfony/console": "^2.5|^3|^4", + "symfony/yaml": "^2.8.11|^3|^4", + "php-coveralls/php-coveralls": "^1", "squizlabs/php_codesniffer": "2.*" }, + "suggest": { + "symfony/yaml": "Required to use Consolidation\\Config\\Loader\\YamlConfigLoader" + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true, + "platform": { + "php": "5.6" + } + }, "scripts": { "cs": "phpcs --standard=PSR2 -n src", "cbf": "phpcbf --standard=PSR2 -n src", - "test": "SHELL_INTERACTIVE=true phpunit --colors=always" + "unit": "SHELL_INTERACTIVE=true phpunit --colors=always", + "lint": [ + "find src -name '*.php' -print0 | xargs -0 -n1 php -l", + "find tests/src -name '*.php' -print0 | xargs -0 -n1 php -l" + ], + "test": [ + "@lint", + "@unit", + "@cs" + ] }, "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, "branch-alias": { "dev-master": "1.x-dev" } diff --git a/php-consolidation-config.spec b/php-consolidation-config.spec index 938555d..9bd35c7 100644 --- a/php-consolidation-config.spec +++ b/php-consolidation-config.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-consolidation-config # -# Copyright (c) 2017 Shawn Iwinski +# Copyright (c) 2017-2019 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner consolidation %global github_name config -%global github_version 1.0.3 -%global github_commit d2afb616af44750c07283442944e3286ea48df8c +%global github_version 1.2.1 +%global github_commit cac1279bae7efb5c7fb2ca4c3ba4b8eb741a96c1 %global composer_vendor consolidation %global composer_project config @@ -23,14 +23,17 @@ # "dflydev/dot-access-data": "^1.1.0" %global dflydev_dot_access_data_min_ver 1.1.0 %global dflydev_dot_access_data_max_ver 2.0 -# "grasmash/yaml-expander": "^1.1" -%global grasmash_yaml_expander_min_ver 1.1 -%global grasmash_yaml_expander_max_ver 2.0 -# "symfony/console": "^2.5|^3" -# NOTE: Min version not 2.5 because autoloader required -%global symfony_min_ver 2.7.1 -%global symfony_max_ver 4.0 - +# "grasmash/expander": "^1" +%global grasmash_expander_min_ver 1.0 +%global grasmash_expander_max_ver 2.0 +# "symfony/console": "^2.5|^3|^4" +# "symfony/yaml": "^2.8.11|^3|^4" +%global symfony_min_ver 2.8.11 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global symfony_max_ver 5.0 +%else +%global symfony_max_ver 4 +%endif # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} @@ -41,7 +44,6 @@ Version: %{github_version} Release: 1%{?github_release}%{?dist} Summary: Provide configuration services for a command-line tool -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 @@ -49,20 +51,30 @@ Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{githu BuildArch: noarch # Tests %if %{with_tests} -BuildRequires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver} -BuildRequires: php-composer(symfony/event-dispatcher) >= %{symfony_min_ver} ## composer.json BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php-composer(phpunit/phpunit) +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(dflydev/dot-access-data) >= %{dflydev_dot_access_data_min_ver} with php-composer(dflydev/dot-access-data) < %{dflydev_dot_access_data_max_ver}) +BuildRequires: (php-composer(grasmash/expander) >= %{grasmash_expander_min_ver} with php-composer(grasmash/expander) < %{grasmash_expander_max_ver}) +BuildRequires: (php-composer(symfony/console) >= %{symfony_min_ver} with php-composer(symfony/console) < %{symfony_max_ver}) +BuildRequires: (php-composer(symfony/yaml) >= %{symfony_min_ver} with php-composer(symfony/yaml) < %{symfony_max_ver}) +### phpcompatinfo +BuildRequires: (php-composer(symfony/event-dispatcher) >= %{symfony_min_ver} with php-composer(symfony/event-dispatcher) < %{symfony_max_ver}) +%else BuildRequires: php-composer(dflydev/dot-access-data) < %{dflydev_dot_access_data_max_ver} BuildRequires: php-composer(dflydev/dot-access-data) >= %{dflydev_dot_access_data_min_ver} -BuildRequires: php-composer(grasmash/yaml-expander) < %{grasmash_yaml_expander_max_ver} -BuildRequires: php-composer(grasmash/yaml-expander) >= %{grasmash_yaml_expander_min_ver} -BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: php-composer(grasmash/expander) < %{grasmash_expander_max_ver} +BuildRequires: php-composer(grasmash/expander) >= %{grasmash_expander_min_ver} BuildRequires: php-composer(symfony/console) < %{symfony_max_ver} -BuildRequires: php-composer(symfony/console) >= %{symfony_min_ver} -## phpcompatinfo for version 1.0.3 +BuildRequires: php-composer(symfony/yaml) < %{symfony_max_ver} +### phpcompatinfo +BuildRequires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver} +%endif +## phpcompatinfo for version 1.2.1 BuildRequires: php-json BuildRequires: php-pcre +BuildRequires: php-reflection BuildRequires: php-spl ## Autoloader BuildRequires: php-composer(fedora/autoloader) @@ -70,11 +82,24 @@ BuildRequires: php-composer(fedora/autoloader) # composer.json Requires: php(language) >= %{php_min_ver} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(dflydev/dot-access-data) >= %{dflydev_dot_access_data_min_ver} with php-composer(dflydev/dot-access-data) < %{dflydev_dot_access_data_max_ver}) +Requires: (php-composer(grasmash/expander) >= %{grasmash_expander_min_ver} with php-composer(grasmash/expander) < %{grasmash_expander_max_ver}) +## phpcompatinfo +Requires: (php-composer(symfony/console) >= %{symfony_min_ver} with php-composer(symfony/console) < %{symfony_max_ver}) +Requires: (php-composer(symfony/event-dispatcher) >= %{symfony_min_ver} with php-composer(symfony/event-dispatcher) < %{symfony_max_ver}) +## suggest (weak dependencies) +Recommends: php-composer(symfony/yaml) +%else Requires: php-composer(dflydev/dot-access-data) < %{dflydev_dot_access_data_max_ver} Requires: php-composer(dflydev/dot-access-data) >= %{dflydev_dot_access_data_min_ver} -Requires: php-composer(grasmash/yaml-expander) < %{grasmash_yaml_expander_max_ver} -Requires: php-composer(grasmash/yaml-expander) >= %{grasmash_yaml_expander_min_ver} -# phpcompatinfo for version 1.0.3 +Requires: php-composer(grasmash/expander) < %{grasmash_expander_max_ver} +Requires: php-composer(grasmash/expander) >= %{grasmash_expander_min_ver} +## phpcompatinfo +Requires: php-composer(symfony/console) < %{symfony_max_ver} +Requires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver} +%endif +# phpcompatinfo for version 1.2.1 Requires: php-pcre Requires: php-spl # Autoloader @@ -119,7 +144,25 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Dependencies::required([ '%{phpdir}/Dflydev/DotAccessData/autoload.php', - '%{phpdir}/Grasmash/YamlExpander/autoload.php', + '%{phpdir}/Grasmash/Expander/autoload.php', + [ + '%{phpdir}/Symfony4/Component/Console/autoload.php', + '%{phpdir}/Symfony3/Component/Console/autoload.php', + '%{phpdir}/Symfony/Component/Console/autoload.php', + ], + [ + '%{phpdir}/Symfony4/Component/EventDispatcher/autoload.php', + '%{phpdir}/Symfony3/Component/EventDispatcher/autoload.php', + '%{phpdir}/Symfony/Component/EventDispatcher/autoload.php', + ], +]); + +\Fedora\Autoloader\Dependencies::optional([ + [ + '%{phpdir}/Symfony4/Component/Yaml/autoload.php', + '%{phpdir}/Symfony3/Component/Yaml/autoload.php', + '%{phpdir}/Symfony/Component/Yaml/autoload.php', + ] ]); AUTOLOAD @@ -137,23 +180,12 @@ cat <<'BOOTSTRAP' | tee bootstrap.php require '%{buildroot}%{phpdir}/Consolidation/Config/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('Consolidation\\TestUtils\\', __DIR__.'/tests/src'); - -\Fedora\Autoloader\Dependencies::required([ - [ - '%{phpdir}/Symfony3/Component/Console/autoload.php', - '%{phpdir}/Symfony/Component/Console/autoload.php', - ], - [ - '%{phpdir}/Symfony3/Component/EventDispatcher/autoload.php', - '%{phpdir}/Symfony/Component/EventDispatcher/autoload.php', - ], -]); BOOTSTRAP : Upstream tests RETURN_CODE=0 PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php55} php56 php70 php71 php72; do +for PHP_EXEC in "" php70 php71 php72 php73 php74; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php || RETURN_CODE=1 fi @@ -174,6 +206,9 @@ exit $RETURN_CODE %changelog +* Sat Jun 15 2019 Shawn Iwinski - 1.2.1-1 +- Update to 1.2.1 (RHBZ #1508224) + * Sun Oct 08 2017 Shawn Iwinski - 1.0.3-1 - Update to 1.0.3 -- cgit