From 9651e41907c0705eb87107a4e7f92098c9e53f09 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 11 Mar 2021 14:19:08 +0100 Subject: test build of upcoming 5.5.0 raise dependency on PHP 7.2 raise dependency on bartlett/php-compatinfo-db 3.3 --- composer.json | 22 +++++++- php-bartlett-PHP-CompatInfo-5.4.2-rpm.patch | 73 ------------------------- php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch | 85 +++++++++++++++++++++++++++++ php-bartlett-PHP-CompatInfo.spec | 42 ++++++++------ 4 files changed, 129 insertions(+), 93 deletions(-) delete mode 100644 php-bartlett-PHP-CompatInfo-5.4.2-rpm.patch create mode 100644 php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch diff --git a/composer.json b/composer.json index 06575eb..7d2e089 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "issues": "https://github.com/llaville/php-compat-info/issues" }, "require": { - "php": "^7.1.3|^8.0", + "php": "^7.2|^8.0", "ext-libxml": "*", "ext-pcre": "*", "ext-spl": "*", @@ -18,7 +18,7 @@ "ext-pdo": "*", "ext-pdo_sqlite": "*", "bartlett/php-reflect": "^4.4", - "bartlett/php-compatinfo-db": "^2.0", + "bartlett/php-compatinfo-db": "^3.3", "doctrine/collections": "^1.4", "composer/package-versions-deprecated": "^1.8", "psr/log": "^1.0", @@ -57,6 +57,24 @@ "Bartlett\\Tests\\CompatInfo\\": "tests/" } }, + "scripts": { + "setup-database": [ + "mkdir -p ${HOME}/.cache/bartlett/ && touch ${HOME}/.cache/bartlett/compatinfo-db.sqlite", + "export DATABASE_URL=sqlite:///${HOME}/.cache/bartlett/compatinfo-db.sqlite", + "vendor/bin/doctrine orm:generate-proxies" + ], + "post-install-cmd": [ + "@setup-database", + "vendor/bin/doctrine orm:schema-tool:create", + "vendor/bartlett/php-compatinfo-db/bin/compatinfo-db db:init" + ], + "post-update-cmd": [ + "@setup-database" + ] + }, + "scripts-descriptions": { + "setup-database": "Initializes SQLite database from JSON files in data directory." + }, "minimum-stability": "dev", "prefer-stable": true, "config": { diff --git a/php-bartlett-PHP-CompatInfo-5.4.2-rpm.patch b/php-bartlett-PHP-CompatInfo-5.4.2-rpm.patch deleted file mode 100644 index d77f69b..0000000 --- a/php-bartlett-PHP-CompatInfo-5.4.2-rpm.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo ---- ./bin/phpcompatinfo.rpm 2020-11-23 09:20:15.949928560 +0100 -+++ ./bin/phpcompatinfo 2020-11-23 09:23:44.418075703 +0100 -@@ -8,39 +8,13 @@ if (PHP_SAPI !== 'cli') { - - gc_disable(); // performance boost - --if (\Phar::running()) { -- $possibleAutoloadPaths = [ -- 'phar://phpcompatinfo.phar/vendor/autoload.php' -- ]; --} else { -- $possibleAutoloadPaths = [ -- // local dev repository -- __DIR__ . '/../vendor/autoload.php', -- // dependency -- __DIR__ . '/../../../../vendor/autoload.php', -- ]; --} -- --$isAutoloadFound = false; --foreach ($possibleAutoloadPaths as $possibleAutoloadPath) { -- if (file_exists($possibleAutoloadPath)) { -- require_once $possibleAutoloadPath; -- $isAutoloadFound = true; -- break; -- } --} -- --if ($isAutoloadFound === false) { -- throw new RuntimeException(sprintf( -- 'Unable to find "vendor/autoload.php" in "%s" paths.', -- implode('", "', $possibleAutoloadPaths) -- )); --} -+$vendorDir = '/usr/share/php/Bartlett/CompatInfo'; -+require_once $vendorDir . '/autoload.php'; - - use Bartlett\CompatInfo\Console\ApplicationInterface; - - /** @var \Symfony\Component\DependencyInjection\ContainerBuilder $container */ --$container = require dirname(__DIR__) . '/config/container.php'; -+$container = require $vendorDir . '/config/container.php'; - - $app = $container->get(ApplicationInterface::class); - $app->setContainer($container); -diff -up ./src/Bartlett/CompatInfo/Console/Application.php.rpm ./src/Bartlett/CompatInfo/Console/Application.php ---- ./src/Bartlett/CompatInfo/Console/Application.php.rpm 2020-11-20 13:00:53.000000000 +0100 -+++ ./src/Bartlett/CompatInfo/Console/Application.php 2020-11-23 09:21:14.242121292 +0100 -@@ -30,8 +30,6 @@ use Symfony\Component\DependencyInjectio - use Symfony\Component\EventDispatcher\EventDispatcher; - use Symfony\Component\EventDispatcher\EventDispatcherInterface ; - --use PackageVersions\Versions; -- - use Phar; - use function substr_count; - -@@ -78,14 +76,6 @@ class Application extends BaseApplicatio - $version = self::VERSION; - } elseif (substr_count($version, '.') === 2) { - // release is in X.Y.Z format -- } else { -- // composer or git strategy -- $version = Versions::getVersion('bartlett/php-compatinfo'); -- list($ver, ) = explode('@', $version); -- -- if (strpos($ver, 'dev') === false) { -- $version = $ver; -- } - } - parent::__construct(self::NAME, $version); - diff --git a/php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch b/php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch new file mode 100644 index 0000000..db16a0c --- /dev/null +++ b/php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch @@ -0,0 +1,85 @@ +diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo +--- ./bin/phpcompatinfo.rpm 2020-11-23 09:20:15.949928560 +0100 ++++ ./bin/phpcompatinfo 2020-11-23 09:23:44.418075703 +0100 +@@ -8,39 +8,13 @@ if (PHP_SAPI !== 'cli') { + + gc_disable(); // performance boost + +-if (\Phar::running()) { +- $possibleAutoloadPaths = [ +- 'phar://phpcompatinfo.phar/vendor/autoload.php' +- ]; +-} else { +- $possibleAutoloadPaths = [ +- // local dev repository +- __DIR__ . '/../vendor/autoload.php', +- // dependency +- __DIR__ . '/../../../../vendor/autoload.php', +- ]; +-} +- +-$isAutoloadFound = false; +-foreach ($possibleAutoloadPaths as $possibleAutoloadPath) { +- if (file_exists($possibleAutoloadPath)) { +- require_once $possibleAutoloadPath; +- $isAutoloadFound = true; +- break; +- } +-} +- +-if ($isAutoloadFound === false) { +- throw new RuntimeException(sprintf( +- 'Unable to find "vendor/autoload.php" in "%s" paths.', +- implode('", "', $possibleAutoloadPaths) +- )); +-} ++$vendorDir = '/usr/share/php/Bartlett/CompatInfo'; ++require_once $vendorDir . '/autoload.php'; + + use Bartlett\CompatInfo\Console\ApplicationInterface; + + /** @var \Symfony\Component\DependencyInjection\ContainerBuilder $container */ +-$container = require dirname(__DIR__) . '/config/container.php'; ++$container = require $vendorDir . '/config/container.php'; + + $app = $container->get(ApplicationInterface::class); + $app->setContainer($container); +diff -up ./src/Bartlett/CompatInfo/Console/Application.php.rpm ./src/Bartlett/CompatInfo/Console/Application.php +--- ./src/Bartlett/CompatInfo/Console/Application.php.rpm 2020-11-20 13:00:53.000000000 +0100 ++++ ./src/Bartlett/CompatInfo/Console/Application.php 2020-11-23 09:21:14.242121292 +0100 +@@ -30,8 +30,6 @@ use Symfony\Component\DependencyInjectio + use Symfony\Component\EventDispatcher\EventDispatcher; + use Symfony\Component\EventDispatcher\EventDispatcherInterface ; + +-use PackageVersions\Versions; +- + use Phar; + use function substr_count; + +@@ -78,14 +76,6 @@ class Application extends BaseApplicatio + $version = self::VERSION; + } elseif (substr_count($version, '.') === 2) { + // release is in X.Y.Z format +- } else { +- // composer or git strategy +- $version = Versions::getVersion('bartlett/php-compatinfo'); +- list($ver, ) = explode('@', $version); +- +- if (strpos($ver, 'dev') === false) { +- $version = $ver; +- } + } + parent::__construct(self::NAME, $version); + +diff -up ./config/set/default.php.rpm ./config/set/default.php +--- ./config/set/default.php.rpm 2021-03-11 11:31:29.234038995 +0100 ++++ ./config/set/default.php 2021-03-11 11:32:21.553810893 +0100 +@@ -33,7 +33,7 @@ use function Symfony\Component\Dependenc + */ + return static function (ContainerConfigurator $containerConfigurator): void + { +- $containerConfigurator->import(dirname(__DIR__,2) . '/vendor/bartlett/php-compatinfo-db/config/set/default.php'); ++ $containerConfigurator->import('/usr/share/php/Bartlett/CompatInfoDb/config/set/default.php'); + $containerConfigurator->import(__DIR__ . '/common.php'); + + $parameters = $containerConfigurator->parameters(); diff --git a/php-bartlett-PHP-CompatInfo.spec b/php-bartlett-PHP-CompatInfo.spec index f365211..a8c5f88 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 85f8a27a74c88e38895c65f6e5250030a97a9b4b +%global gh_commit eee33868bcfb662d55eb7164b9bb749619c8b9d6 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20151005 %global gh_owner llaville @@ -19,6 +19,9 @@ #global prever RC2 %bcond_without tests +%global upstream_version 5.5.0 +#global upstream_prever RC1 + %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 %global sym_prefix php-symfony3 %else @@ -26,9 +29,8 @@ %endif Name: php-bartlett-PHP-CompatInfo -Version: 5.4.4 -%global specrel 1 -Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} +Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} +Release: 0%{?dist} Summary: Find out version and the extensions required for a piece of code to run License: BSD @@ -40,17 +42,17 @@ Source1: fedora-review-check # Autoload and sqlite database path # avoid jean85/pretty-package-versions -Patch0: %{name}-5.4.2-rpm.patch +Patch0: %{name}-5.5.0-rpm.patch BuildArch: noarch -BuildRequires: php(language) >= 7.1.3 +BuildRequires: php(language) >= 7.2 %if %{with tests} # to run test suite BuildRequires: php-pdo_sqlite # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(bartlett/php-reflect) >= 4.4 with php-composer(bartlett/php-reflect) < 5) -BuildRequires: (php-composer(bartlett/php-compatinfo-db) >= 2.0 with php-composer(bartlett/php-compatinfo-db) < 3) +BuildRequires: (php-composer(bartlett/php-compatinfo-db) >= 3.3 with php-composer(bartlett/php-compatinfo-db) < 4) BuildRequires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2) BuildRequires: (php-composer(ramsey/uuid) >= 4.0 with php-composer(ramsey/uuid) < 5) BuildRequires: (php-composer(symfony/config) >= 4.4 with php-composer(symfony/config) < 6) @@ -64,7 +66,7 @@ BuildRequires: (php-composer(doctrine/collections) >= 1.4 with php-comp # remirepo:14 %else BuildRequires: php-bartlett-PHP-Reflect >= 4.4 -BuildRequires: php-bartlett-php-compatinfo-db >= 1.23 +BuildRequires: php-bartlett-php-compatinfo-db >= 3.3 BuildRequires: php-PsrLog >= 1.0 BuildRequires: php-ramsey-uuid >= 4.0 BuildRequires: php-symfony4-config >= 4.4 @@ -76,14 +78,14 @@ BuildRequires: php-symfony4-serializer >= 4.4 BuildRequires: php-symfony4-stopwatch >= 4.4 BuildRequires: php-doctrine-collections >= 1.4 %endif -%global phpunit %{_bindir}/phpunit8 +%global phpunit %{_bindir}/phpunit9 BuildRequires: %{phpunit} # For our patch / autoloader BuildRequires: php-fedora-autoloader-devel %endif # From composer.json, "require" -# "php": "^7.1.3|^8.0", +# "php": "^7.2|^8.0", # "ext-libxml": "*", # "ext-pcre": "*", # "ext-spl": "*", @@ -91,7 +93,7 @@ BuildRequires: php-fedora-autoloader-devel # "ext-pdo": "*", # "ext-pdo_sqlite": "*", # "bartlett/php-reflect": "^4.4", -# "bartlett/php-compatinfo-db": "^2.0", +# "bartlett/php-compatinfo-db": "^3.3", # "doctrine/collections": "^1.4", # "composer/package-versions-deprecated": "^1.8", # "psr/log": "^1.0", @@ -103,7 +105,7 @@ BuildRequires: php-fedora-autoloader-devel # "symfony/dependency-injection": "^4.4|^5.0", # "symfony/serializer": "^4.4|^5.0", # "symfony/stopwatch": "^4.4|^5.0" -Requires: php(language) >= 7.1.3 +Requires: php(language) >= 7.2 Requires: php-cli Requires: php-json Requires: php-libxml @@ -114,7 +116,7 @@ Requires: php-spl # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(bartlett/php-reflect) >= 4.4 with php-composer(bartlett/php-reflect) < 5) -Requires: (php-composer(bartlett/php-compatinfo-db) >= 2.0 with php-composer(bartlett/php-compatinfo-db) < 3) +Requires: (php-composer(bartlett/php-compatinfo-db) >= 3.3 with php-composer(bartlett/php-compatinfo-db) < 4) Requires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2) Requires: (php-composer(ramsey/uuid) >= 4.0 with php-composer(ramsey/uuid) < 5) Requires: (php-composer(symfony/config) >= 4.4 with php-composer(symfony/config) < 6) @@ -124,11 +126,11 @@ Requires: (php-composer(symfony/event-dispatcher) >= 4.4 with php-comp Requires: (php-composer(symfony/finder) >= 4.4 with php-composer(symfony/finder) < 6) Requires: (php-composer(symfony/serializer) >= 4.4 with php-composer(symfony/serializer) < 6) Requires: (php-composer(symfony/stopwatch) >= 4.4 with php-composer(symfony/stopwatch) < 6) -Requires: (php-composer(doctrine/collections) >= 1.4 with php-composer(doctrine/collections) < 2) +Requires: (php-composer(doctrine/collections) >= 1.4 with php-composer(doctrine/collections) < 2) # remirepo:14 %else Requires: php-bartlett-PHP-Reflect >= 4.4 -Requires: php-bartlett-php-compatinfo-db >= 1.23 +Requires: php-bartlett-php-compatinfo-db >= 3.3 Requires: php-PsrLog >= 1.0 Requires: php-ramsey-uuid >= 4.0 Requires: php-symfony4-config >= 4.4 @@ -237,11 +239,10 @@ require_once "%{buildroot}%{_datadir}/php/Bartlett/CompatInfo/autoload.php"; EOF ret=0 -for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do +for cmdarg in "php %{phpunit}" php73 php74 php80; do if which $cmdarg; then set $cmdarg - $1 ${2:-%{_bindir}/phpunit9} \ - --include-path %{buildroot}%{_datadir}/php $OPT --verbose || ret=1 + $1 ${2:-%{_bindir}/phpunit9} --verbose || ret=1 fi done exit $ret @@ -267,6 +268,11 @@ fi %changelog +* Thu Mar 11 2021 Remi Collet - 5.5.0-0 +- test build of upcoming 5.5.0 +- raise dependency on PHP 7.2 +- raise dependency on bartlett/php-compatinfo-db 3.3 + * Mon Feb 22 2021 Remi Collet - 5.4.4-1 - update to 5.4.4 (no change) -- cgit