From 0c7679632b3dc90fedd1ec8b4c3f030097d2a519 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 28 Nov 2018 09:27:34 +0100 Subject: update to 5.1.0 raise dependency on bartlett/php-reflect 4.3 add explicit dependency on nikic/php-parser add explicit dependency on doctrine/cache add dependency on psr/log switch to phpunit7 --- composer.json | 25 ++----- php-bartlett-PHP-CompatInfo-5.0.0-autoload.php | 13 ---- php-bartlett-PHP-CompatInfo-5.0.0-rpm.patch | 85 ----------------------- php-bartlett-PHP-CompatInfo-5.1.0-autoload.php | 19 ++++++ php-bartlett-PHP-CompatInfo-5.1.0-rpm.patch | 73 ++++++++++++++++++++ php-bartlett-PHP-CompatInfo.spec | 94 ++++++++++++++++++-------- 6 files changed, 162 insertions(+), 147 deletions(-) delete mode 100644 php-bartlett-PHP-CompatInfo-5.0.0-autoload.php delete mode 100644 php-bartlett-PHP-CompatInfo-5.0.0-rpm.patch create mode 100644 php-bartlett-PHP-CompatInfo-5.1.0-autoload.php create mode 100644 php-bartlett-PHP-CompatInfo-5.1.0-rpm.patch diff --git a/composer.json b/composer.json index 76baccf..5277e8f 100644 --- a/composer.json +++ b/composer.json @@ -9,34 +9,24 @@ "source": "https://github.com/llaville/php-compat-info", "issues": "https://github.com/llaville/php-compat-info/issues" }, - "repositories": [ - { - "type": "pear", - "url": "https://pear.php.net" - } - ], "require": { - "php": ">=5.5", + "php": "^5.5|^7.0", "ext-libxml": "*", "ext-pcre": "*", "ext-spl": "*", "ext-json": "*", "ext-pdo_sqlite": "*", - "bartlett/php-reflect": "^4.2", - "bartlett/php-compatinfo-db": "^1.23" + "bartlett/php-reflect": "^4.3", + "nikic/php-parser": "^3.1", + "bartlett/php-compatinfo-db": "^1.23", + "psr/log": "^1.0" }, "require-dev": { "doctrine/cache": "^1.3", - "psr/log": "^1.0", - "monolog/monolog": "^1.10", - "bartlett/monolog-callbackfilterhandler": "^1.0", - "bartlett/monolog-growlhandler": "^1.0", - "bartlett/phpunit-loggertestlistener": "^1.5", - "bartlett/umlwriter": "^1.0" + "monolog/monolog": "^1.10" }, "suggest": { "doctrine/cache": "Allow caching results, since bartlett/php-reflect 2.2", - "psr/log": "Allow logging events with the LogPlugin", "monolog/monolog": "Allow logging events with the LogPlugin", "bartlett/monolog-callbackfilterhandler": "Advanced filtering strategies for Monolog", "bartlett/monolog-growlhandler": "Sends notifications to Growl for Monolog", @@ -70,9 +60,6 @@ } }, "config": { - "platform": { - "php": "5.5.0" - }, "optimize-autoloader": true } } diff --git a/php-bartlett-PHP-CompatInfo-5.0.0-autoload.php b/php-bartlett-PHP-CompatInfo-5.0.0-autoload.php deleted file mode 100644 index 4297383..0000000 --- a/php-bartlett-PHP-CompatInfo-5.0.0-autoload.php +++ /dev/null @@ -1,13 +0,0 @@ -setUseIncludePath(true); -- --if (\Phar::running()) { -- if ($home) { -- // when optional resources are not embedded in phar distribution, -- // avoid PHP Warnings, and lookup first in global vendor dir (COMPOSER_HOME) if exists -- $classMapfiltered = $fallbackClassMap($loader->getClassMap(), 'Net_Growl'); -- $loader->addClassMap($classMapfiltered); -- -- // try to find PEAR Net_Growl classes package in folder $fallbackNetGrowlDir (see phar-stub.php) -- $loader->add(false, $fallbackNetGrowlDir); -- } -+require_once $vendorDir . '/Bartlett/CompatInfo/autoload.php'; -+if (!getenv("BARTLETTRC")) { -+ putenv("BARTLETTRC=" . strtolower($appName) . '.json'); - } - - if (PHP_SAPI !== 'cli') { - return; - } - --if (\Phar::running()) { -- try { -- Bartlett\CompatInfoDb\Environment::checkRequirements(); -- } catch (\RuntimeException $e) { -- die ($e->getMessage()); -- } --} -- - use Bartlett\Reflect\Environment; - use Bartlett\CompatInfo\Console\Application; - - Environment::setScanDir(); - --$application = new Application($appName, '5.0'); -+$application = new Application($appName, '@package_version@'); - $application->run(); - diff --git a/php-bartlett-PHP-CompatInfo-5.1.0-autoload.php b/php-bartlett-PHP-CompatInfo-5.1.0-autoload.php new file mode 100644 index 0000000..61e455b --- /dev/null +++ b/php-bartlett-PHP-CompatInfo-5.1.0-autoload.php @@ -0,0 +1,19 @@ +setUseIncludePath(true); + + if (PHP_SAPI !== 'cli') { + return; + } + +-if (\Phar::running()) { +- try { +- Bartlett\CompatInfoDb\Environment::checkRequirements(); +- } catch (\RuntimeException $e) { +- die ($e->getMessage()); +- } +-} +- + use Bartlett\Reflect\Environment; + use Bartlett\CompatInfo\Console\Application; + + Environment::setScanDir(); + +-$application = new Application($appName, '5.1'); ++$application = new Application($appName, '@package_version@'); + $application->run(); diff --git a/php-bartlett-PHP-CompatInfo.spec b/php-bartlett-PHP-CompatInfo.spec index 0e7fa54..0dc48f5 100644 --- a/php-bartlett-PHP-CompatInfo.spec +++ b/php-bartlett-PHP-CompatInfo.spec @@ -11,7 +11,7 @@ %undefine __brp_mangle_shebangs %{!?php_version: %global php_version %(php -r 'echo PHP_VERSION;' 2>/dev/null)} -%global gh_commit ecf11cf73912e56cc91814b540e4789cdc8739c6 +%global gh_commit e1239c5433be4a121ade2ab5aec9bb81faae7134 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20151005 %global gh_owner llaville @@ -26,7 +26,7 @@ %endif Name: php-bartlett-PHP-CompatInfo -Version: 5.0.12 +Version: 5.1.0 %global specrel 1 Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Find out version and the extensions required for a piece of code to run @@ -40,39 +40,53 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit Source1: fedora-review-check # Autoloader for RPM - die composer ! -Source2: %{name}-5.0.0-autoload.php +Source2: %{name}-5.1.0-autoload.php # Autoload and sqlite database path -Patch0: %{name}-5.0.0-rpm.patch +Patch0: %{name}-5.1.0-rpm.patch BuildArch: noarch BuildRequires: php(language) >= 5.5 %if %{with_tests} # to run test suite -BuildRequires: %{_bindir}/phpunit BuildRequires: php-pdo_sqlite -%if 0%{?fedora} >= 27 -BuildRequires: (php-composer(bartlett/php-reflect) >= 4.2 with php-composer(bartlett/php-reflect) < 5) -BuildRequires: (php-composer(bartlett/php-compatinfo-db) >= 1.23 with php-composer(bartlett/php-compatinfo-db) < 2) +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global phpunit %{_bindir}/phpunit7 +BuildRequires: (php-composer(bartlett/php-reflect) >= 4.3 with php-composer(bartlett/php-reflect) < 5) +BuildRequires: (php-composer(nikic/php-parser) >= 3.1 with php-composer(nikic/php-parser) < 4) +BuildRequires: (php-composer(bartlett/php-compatinfo-db) >= 1.23 with php-composer(bartlett/php-compatinfo-db) < 2) +BuildRequires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2) +Requires: (php-composer(doctrine/cache) >= 1.3 with php-composer(doctrine/cache) < 2) +# remirepo:12 %else -BuildRequires: php-composer(bartlett/php-reflect) < 5 -BuildRequires: php-composer(bartlett/php-reflect) >= 4.2 -BuildRequires: php-composer(bartlett/php-compatinfo-db) < 2 -BuildRequires: php-composer(bartlett/php-compatinfo-db) >= 1.23 +%global phpunit %{_bindir}/phpunit +BuildRequires: php-composer(bartlett/php-reflect) < 5 +BuildRequires: php-composer(bartlett/php-reflect) >= 4.2 +BuildRequires: php-nikic-php-parser3 >= 3.1 +BuildRequires: php-composer(bartlett/php-compatinfo-db) < 2 +BuildRequires: php-composer(bartlett/php-compatinfo-db) >= 1.23 +BuildRequires: php-composer(psr/log) < 2 +BuildRequires: php-composer(psr/log) >= 1.0 +BuildRequires: php-composer(doctrine/cache) < 2 +BuildRequires: php-composer(doctrine/cache) >= 1.3 %endif +BuildRequires: %{phpunit} # For our patch / autoloader BuildRequires: php-composer(fedora/autoloader) %endif # From composer.json, "require" -# "php": ">=5.5", +# "php": "^5.5|^7.0", # "ext-libxml": "*", # "ext-pcre": "*", # "ext-spl": "*", # "ext-json": "*", # "ext-pdo_sqlite": "*", -# "bartlett/php-reflect": "^4.2", -# "bartlett/php-compatinfo-db": "^1.23" +# "bartlett/php-reflect": "^4.3", +# "nikic/php-parser": "^3.1", +# "bartlett/php-compatinfo-db": "^1.23", +# "psr/log": "^1.0" Requires: php(language) >= 5.5 Requires: php-cli Requires: php-json @@ -80,26 +94,31 @@ Requires: php-libxml Requires: php-pcre Requires: php-pdo_sqlite Requires: php-spl -%if 0%{?fedora} >= 27 -Requires: (php-composer(bartlett/php-reflect) >= 4.2 with php-composer(bartlett/php-reflect) < 5) -Requires: (php-composer(bartlett/php-compatinfo-db) >= 1.23 with php-composer(bartlett/php-compatinfo-db) < 2) +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(bartlett/php-reflect) >= 4.3 with php-composer(bartlett/php-reflect) < 5) +Requires: (php-composer(nikic/php-parser) >= 3.1 with php-composer(nikic/php-parser) < 4) +Requires: (php-composer(bartlett/php-compatinfo-db) >= 1.23 with php-composer(bartlett/php-compatinfo-db) < 2) +Requires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2) +# Mandatory for our patch +Requires: (php-composer(doctrine/cache) >= 1.3 with php-composer(doctrine/cache) < 2) +# remirepo:12 %else -Requires: php-composer(bartlett/php-reflect) < 5 -Requires: php-composer(bartlett/php-reflect) >= 4.2 +Requires: php-composer(bartlett/php-reflect) < 5 +Requires: php-composer(bartlett/php-reflect) >= 4.2 +Requires: php-nikic-php-parser3 >= 3.1 Requires: php-composer(bartlett/php-compatinfo-db) < 2 Requires: php-composer(bartlett/php-compatinfo-db) >= 1.23 +Requires: php-composer(psr/log) < 2 +Requires: php-composer(psr/log) >= 1.0 +# Mandatory for our patch +Requires: php-composer(doctrine/cache) < 2 +Requires: php-composer(doctrine/cache) >= 1.3 %endif # From composer.json, "require-dev": { -# "doctrine/cache": "^1.3", -# "psr/log": "^1.0", # "monolog/monolog": "^1.10", -# "bartlett/monolog-callbackfilterhandler": "^1.0", -# "bartlett/monolog-growlhandler": "^1.0", -# "bartlett/phpunit-loggertestlistener": "^1.5", -# "bartlett/umlwriter": "^1.0" # From composer.json, "suggest" # "doctrine/cache": "Allow caching results, since bartlett/php-reflect 2.2", -# "psr/log": "Allow logging events with the LogPlugin", # "monolog/monolog": "Allow logging events with the LogPlugin", # "bartlett/monolog-callbackfilterhandler": "Advanced filtering strategies for Monolog", # "bartlett/monolog-growlhandler": "Sends notifications to Growl for Monolog", @@ -107,6 +126,11 @@ Requires: php-composer(bartlett/php-compatinfo-db) >= 1.23 # "bartlett/umlwriter": "Allow writing UML class diagrams (Graphviz or PlantUML)" # "doctrine/cache": "Allow caching results, since bartlett/php-reflect 2.2" # "bartlett/umlwriter": "Allow writing UML class diagrams (Graphviz or PlantUML)" +# remirepo:1 +%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 +Suggests: php-composer(monolog/monolog) +# remirepo:1 +%endif # Required by autoloader Requires: php-composer(fedora/autoloader) @@ -160,9 +184,11 @@ ln -s %{buildroot}%{_datadir}/php/Bartlett/CompatInfo/autoload.php vendor/ ret=0 -for cmd in php php70 php71 php72; do - if which $cmd; then - $cmd %{_bindir}/phpunit --include-path %{buildroot}%{_datadir}/php --verbose || ret=1 +for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit" php71 php72 php73; do + if which $cmdarg; then + set $cmdarg + $1 ${2:-%{_bindir}/phpunit7} \ + --include-path %{buildroot}%{_datadir}/php --verbose || ret=1 fi done exit $ret @@ -188,6 +214,14 @@ fi %changelog +* Wed Nov 28 2018 Remi Collet - 5.1.0-1 +- update to 5.1.0 +- raise dependency on bartlett/php-reflect 4.3 +- add explicit dependency on nikic/php-parser +- add explicit dependency on doctrine/cache +- add dependency on psr/log +- switch to phpunit7 + * Fri Feb 2 2018 Remi Collet - 5.0.12-1 - Update to 5.0.12 (no change) - use range dependency on F27+ -- cgit