diff options
| -rw-r--r-- | composer.json | 19 | ||||
| -rw-r--r-- | php-PhpOption.spec | 61 | 
2 files changed, 64 insertions, 16 deletions
diff --git a/composer.json b/composer.json index 7289208..859838c 100644 --- a/composer.json +++ b/composer.json @@ -14,19 +14,30 @@          }      ],      "require": { -        "php": "^5.5.9 || ^7.0" +        "php": "^5.5.9 || ^7.0 || ^8.0"      },      "require-dev": { -        "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" +        "bamarni/composer-bin-plugin": "^1.4.1", +        "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0 || ^8.0 || ^9.0"      },      "autoload": {          "psr-4": {              "PhpOption\\": "src/PhpOption/"          }      }, +    "autoload-dev": { +        "psr-4": { +            "PhpOption\\Tests\\": "tests/PhpOption/Tests/" +        } +    }, +    "config": { +        "preferred-install": "dist" +    },      "extra": {          "branch-alias": { -            "dev-master": "1.6-dev" +            "dev-master": "1.7-dev"          } -    } +    }, +    "minimum-stability": "dev", +    "prefer-stable": true  } diff --git a/php-PhpOption.spec b/php-PhpOption.spec index 20b0c2c..c6763c3 100644 --- a/php-PhpOption.spec +++ b/php-PhpOption.spec @@ -2,7 +2,7 @@  #  # Fedora spec file for php-PhpOption  # -# Copyright (c) 2013-2019 Shawn Iwinski <shawn.iwinski@gmail.com> +# Copyright (c) 2013-2020 Shawn Iwinski <shawn.iwinski@gmail.com>  #  # License: MIT  # http://opensource.org/licenses/MIT @@ -12,15 +12,44 @@  %global github_owner     schmittjoh  %global github_name      php-option -%global github_version   1.6.0 -%global github_commit    f4e7a6a1382183412246f0d361078c29fb85089e +%global github_version   1.7.5 +%global github_commit    994ecccd8f3283ecf5ac33254543eb0ac946d525  %global composer_vendor  phpoption  %global composer_project phpoption -# "php": "^5.5.9 || ^7.0" +# "php": "^5.5.9 || ^7.0 || ^8.0"  %global php_min_ver      5.5.9 +# PHPUnit +## v9 +%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8 +%global phpunit_require phpunit9 +%global phpunit_exec    phpunit9 +%else +## v8 +%if 0%{?fedora} >= 29 +%global phpunit_require phpunit8 +%global phpunit_exec    phpunit8 +%else +## v7 +%if 0%{?fedora} >= 28 +%global phpunit_require phpunit7 +%global phpunit_exec    phpunit7 +%else +## v6 +%if 0%{?fedora} >= 26 +%global phpunit_require phpunit6 +%global phpunit_exec    phpunit6 +%else +## Pre-v6 +%global phpunit_require php-composer(phpunit/phpunit) +%global phpunit_exec    phpunit +%endif +%endif +%endif +%endif +  # Build using "--without tests" to disable tests  %global with_tests 0%{!?_without_tests:1} @@ -42,10 +71,10 @@ Source1:       %{name}-get-source.sh  BuildArch:     noarch  # Tests  %if %{with_tests} -BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: %{phpunit_require}  ## composer.json  BuildRequires: php(language) >= %{php_min_ver} -## phpcompatinfo (computed from version 1.6.0) +## phpcompatinfo (computed from version 1.7.5)  BuildRequires: php-spl  ## Autoloader  BuildRequires: php-composer(fedora/autoloader) @@ -53,7 +82,7 @@ BuildRequires: php-composer(fedora/autoloader)  # composer.json  Requires:      php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 1.6.0) +# phpcompatinfo (computed from version 1.7.5)  Requires:      php-spl  # Autoloader  Requires:      php-composer(fedora/autoloader) @@ -113,14 +142,19 @@ cp -rp src/PhpOption %{buildroot}%{phpdir}/  %check  %if %{with_tests} +: Create tests bootstrap +cat <<'BOOTSTRAP' | tee bootstrap.php +<?php +require '%{buildroot}%{phpdir}/PhpOption/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('PhpOption\\Tests\\', __DIR__.'/tests/PhpOption/Tests/'); +BOOTSTRAP +  : Upstream tests  RETURN_CODE=0 -PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php56 php70} php71 php72 php73 php74; do +PHPUNIT=$(which %{phpunit_exec}) +for PHP_EXEC in "" php73 php74 php80; do      if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then -        $PHP_EXEC $PHPUNIT --verbose \ -            --bootstrap %{buildroot}%{phpdir}/PhpOption/autoload.php \ -            || RETURN_CODE=1 +        $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php || RETURN_CODE=1      fi  done  exit $RETURN_CODE @@ -138,6 +172,9 @@ exit $RETURN_CODE  %changelog +* Mon Aug 17 2020 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.7.5-1 +- Update to 1.7.5 (RHBZ #1782417) +  * Sun Dec 01 2019 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.6.0-1  - Update to 1.6.0 (RHBZ #1771062)  | 
