From 323064013489986568b8fea1dddfa1b54eeae101 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 6 Oct 2020 15:27:03 +0200 Subject: update to 5.4.1 --- .gitignore | 7 ++ composer.json | 16 ++- fedora-review-check | 2 +- php-bartlett-PHP-CompatInfo-5.1.0-autoload.php | 18 --- php-bartlett-PHP-CompatInfo-5.3.0-rpm.patch | 80 ------------ php-bartlett-PHP-CompatInfo-5.4.0-rpm.patch | 55 ++++++++ php-bartlett-PHP-CompatInfo.spec | 166 ++++++++++++++++++------- 7 files changed, 189 insertions(+), 155 deletions(-) delete mode 100644 php-bartlett-PHP-CompatInfo-5.1.0-autoload.php delete mode 100644 php-bartlett-PHP-CompatInfo-5.3.0-rpm.patch create mode 100644 php-bartlett-PHP-CompatInfo-5.4.0-rpm.patch diff --git a/.gitignore b/.gitignore index d820c84..01f0400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.bz2 *.tar.gz +*.tar.xz +*.tar.xz.asc *.src.rpm +*/*rpm diff --git a/composer.json b/composer.json index 3531d70..8c27a61 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", + "php": "^7.1.3|^8.0", "ext-libxml": "*", "ext-pcre": "*", "ext-spl": "*", @@ -19,14 +19,12 @@ "ext-pdo_sqlite": "*", "bartlett/php-reflect": "^4.4", "bartlett/php-compatinfo-db": "^2.0", - "jean85/pretty-package-versions": "^1.5", - "psr/log": "^1.0" - }, - "require-dev": { - "monolog/monolog": "^1.10" - }, - "suggest": { - "doctrine/cache": "Allow caching results, since bartlett/php-reflect 2.2" + "doctrine/collections": "^1.4", + "composer/package-versions-deprecated": "^1.8", + "ramsey/uuid": "^3.9|^4.0", + "symfony/serializer": "^4.4|^5.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0" }, "authors": [ { diff --git a/fedora-review-check b/fedora-review-check index cc72fc4..25f5ef9 100755 --- a/fedora-review-check +++ b/fedora-review-check @@ -1,7 +1,7 @@ #!/bin/sh if [ $# -eq 2 ] -then exec /usr/bin/phpcompatinfo analyser:run $2 --output $1 --no-ansi +then exec /usr/bin/phpcompatinfo analyser:run $2 --no-ansi >$1 else echo "usage $0 logname dirname" exit 1 diff --git a/php-bartlett-PHP-CompatInfo-5.1.0-autoload.php b/php-bartlett-PHP-CompatInfo-5.1.0-autoload.php deleted file mode 100644 index 9d05d9f..0000000 --- a/php-bartlett-PHP-CompatInfo-5.1.0-autoload.php +++ /dev/null @@ -1,18 +0,0 @@ -setUseIncludePath(true); - - if (PHP_SAPI !== 'cli') { - return; -diff -up ./src/Bartlett/CompatInfo/Console/Application.php.rpm ./src/Bartlett/CompatInfo/Console/Application.php ---- ./src/Bartlett/CompatInfo/Console/Application.php.rpm 2020-07-07 10:49:03.000000000 +0200 -+++ ./src/Bartlett/CompatInfo/Console/Application.php 2020-07-07 15:10:37.214047839 +0200 -@@ -16,8 +16,6 @@ namespace Bartlett\CompatInfo\Console; - use Bartlett\CompatInfo\Util\Database; - use Bartlett\Reflect\Console\Application as BaseApplication; - --use Jean85\PrettyVersions; -- - use OutOfBoundsException; - - /** -@@ -48,12 +46,7 @@ class Application extends BaseApplicatio - - public function __construct() - { -- try { -- $version = PrettyVersions::getVersion('bartlett/php-compatinfo')->getPrettyVersion(); -- } catch (OutOfBoundsException $e) { -- $version = self::VERSION; -- } -- parent::__construct(self::NAME, $version); -+ parent::__construct(self::NAME, self::VERSION); - } - - /** diff --git a/php-bartlett-PHP-CompatInfo-5.4.0-rpm.patch b/php-bartlett-PHP-CompatInfo-5.4.0-rpm.patch new file mode 100644 index 0000000..6626bdf --- /dev/null +++ b/php-bartlett-PHP-CompatInfo-5.4.0-rpm.patch @@ -0,0 +1,55 @@ +diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo +--- ./bin/phpcompatinfo.rpm 2020-10-01 11:23:52.000000000 +0200 ++++ ./bin/phpcompatinfo 2020-10-02 12:29:00.346660651 +0200 +@@ -5,22 +5,13 @@ if (PHP_SAPI !== 'cli') { + return; + } + +-if (\Phar::running()) { +- $vendorDir = 'phar://phpcompatinfo.phar/vendor'; +-} else { +- $baseDir = dirname(__DIR__); +- $vendorDir = $baseDir . '/vendor'; +- +- if (!file_exists($vendorDir . '/autoload.php')) { +- $vendorDir = dirname(dirname($baseDir)); +- } +-} ++$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-10-02 12:05:49.767768616 +0200 ++++ ./src/Bartlett/CompatInfo/Console/Application.php 2020-10-02 12:10:02.129841590 +0200 +@@ -30,8 +30,6 @@ use Symfony\Component\DependencyInjectio + use Symfony\Component\EventDispatcher\EventDispatcher; + use Symfony\Component\EventDispatcher\EventDispatcherInterface ; + +-use PackageVersions\Versions; +- + use function substr_count; + + /** +@@ -77,14 +75,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.spec b/php-bartlett-PHP-CompatInfo.spec index 5fdf1a8..7a0a4d7 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 5b58fb55f2a759f6c134d1649d1e1df1b8cd5cf2 +%global gh_commit 3e79a1ac353774b0a3eedac8f0239dafd3e3eedb %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.3.0 +Version: 5.4.1 %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 @@ -38,12 +38,9 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # Script for fedora-review Source1: fedora-review-check -# RPM autoloader -Source2: %{name}-5.1.0-autoload.php - # Autoload and sqlite database path # avoid jean85/pretty-package-versions -Patch0: %{name}-5.3.0-rpm.patch +Patch0: %{name}-5.4.0-rpm.patch BuildArch: noarch BuildRequires: php(language) >= 7.1.3 @@ -52,29 +49,39 @@ BuildRequires: php(language) >= 7.1.3 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(psr/log) >= 1.0 with php-composer(psr/log) < 2) -BuildRequires: (php-composer(doctrine/cache) >= 1.3 with php-composer(doctrine/cache) < 2) -# remirepo:10 +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(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) +BuildRequires: (php-composer(symfony/console) >= 4.4 with php-composer(symfony/console) < 6) +BuildRequires: (php-composer(symfony/dependency-injection) >= 4.4 with php-composer(symfony/dependency-injection) < 6) +BuildRequires: (php-composer(symfony/event-dispatcher) >= 4.4 with php-composer(symfony/event-dispatcher) < 6) +BuildRequires: (php-composer(symfony/serializer) >= 4.4 with php-composer(symfony/serializer) < 6) +BuildRequires: (php-composer(symfony/stopwatch) >= 4.4 with php-composer(symfony/stopwatch) < 6) +BuildRequires: (php-composer(doctrine/collections) >= 1.4 with php-composer(doctrine/collections) < 2) +# remirepo:13 %else -BuildRequires: php-composer(bartlett/php-reflect) < 5 -BuildRequires: php-composer(bartlett/php-reflect) >= 4.4 -BuildRequires: php-composer(bartlett/php-compatinfo-db) < 3 -BuildRequires: php-composer(bartlett/php-compatinfo-db) >= 2.0 -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 +BuildRequires: php-bartlett-PHP-Reflect >= 4.4 +BuildRequires: php-bartlett-php-compatinfo-db >= 1.23 +BuildRequires: php-PsrLog >= 1.0 +BuildRequires: php-ramsey-uuid >= 4.0 +BuildRequires: php-symfony4-config >= 4.4 +BuildRequires: php-symfony4-console >= 4.4 +BuildRequires: php-symfony4-dependency-injection >= 4.4 +BuildRequires: php-symfony4-event-dispatcher >= 4.4 +BuildRequires: php-symfony4-serializer >= 4.4 +BuildRequires: php-symfony4-stopwatch >= 4.4 +BuildRequires: php-doctrine-collections >= 1.4 %endif %global phpunit %{_bindir}/phpunit8 BuildRequires: %{phpunit} # For our patch / autoloader -BuildRequires: php-composer(fedora/autoloader) +BuildRequires: php-fedora-autoloader-devel %endif # From composer.json, "require" -# "php": "^7.1.3", +# "php": "^7.1.3|^8.0", # "ext-libxml": "*", # "ext-pcre": "*", # "ext-spl": "*", @@ -83,8 +90,12 @@ BuildRequires: php-composer(fedora/autoloader) # "ext-pdo_sqlite": "*", # "bartlett/php-reflect": "^4.4", # "bartlett/php-compatinfo-db": "^2.0", -# "jean85/pretty-package-versions": "^1.5", -# "psr/log": "^1.0" +# "doctrine/collections": "^1.4", +# "composer/package-versions-deprecated": "^1.8", +# "ramsey/uuid": "^3.9|^4.0", +# "symfony/serializer": "^4.4|^5.0", +# "symfony/config": "^4.4|^5.0", +# "symfony/dependency-injection": "^4.4|^5.0" Requires: php(language) >= 7.1.3 Requires: php-cli Requires: php-json @@ -95,22 +106,30 @@ Requires: php-pdo_sqlite 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(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 +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(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) +Requires: (php-composer(symfony/console) >= 4.4 with php-composer(symfony/console) < 6) +Requires: (php-composer(symfony/dependency-injection) >= 4.4 with php-composer(symfony/dependency-injection) < 6) +Requires: (php-composer(symfony/event-dispatcher) >= 4.4 with php-composer(symfony/event-dispatcher) < 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) +# remirepo:10 %else -Requires: php-composer(bartlett/php-reflect) < 5 -Requires: php-composer(bartlett/php-reflect) >= 4.4 -Requires: php-composer(bartlett/php-compatinfo-db) < 3 -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 +Requires: php-bartlett-PHP-Reflect >= 4.4 +Requires: php-bartlett-php-compatinfo-db >= 1.23 +Requires: php-PsrLog >= 1.0 +Requires: php-ramsey-uuid >= 4.0 +Requires: php-symfony4-config >= 4.4 +Requires: php-symfony4-console >= 4.4 +Requires: php-symfony4-dependency-injection >= 4.4 +Requires: php-symfony4-event-dispatcher >= 4.4 +Requires: php-symfony4-serializer >= 4.4 +Requires: php-symfony4-stopwatch >= 4.4 +Requires: php-doctrine-collections >= 1.4 %endif # Required by autoloader Requires: php-composer(fedora/autoloader) @@ -132,15 +151,53 @@ Documentation: http://php5.laurent-laville.org/compatinfo/manual/current/en/ %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .rpm -cp %{SOURCE2} src/Bartlett/CompatInfo/autoload.php + +phpab \ + --template fedora \ + --output src/Bartlett/CompatInfo/autoload.php \ + src/Bartlett/CompatInfo +cat << 'EOF' | tee -a src/Bartlett/CompatInfo/autoload.php + +\Fedora\Autoloader\Dependencies::required([ + '%{_datadir}/php/Bartlett/Reflect/autoload.php', + '%{_datadir}/php/Bartlett/CompatInfoDb/autoload.php', + '%{_datadir}/php/Psr/Log/autoload.php', + '%{_datadir}/php/Ramsey/Uuid/autoload.php', + [ + '%{_datadir}/php/Symfony5/Component/Config/autoload.php', + '%{_datadir}/php/Symfony4/Component/Config/autoload.php', + ], [ + '%{_datadir}/php/Symfony5/Component/Console/autoload.php', + '%{_datadir}/php/Symfony4/Component/Console/autoload.php', + ], [ + '%{_datadir}/php/Symfony5/Component/DependencyInjection/autoload.php', + '%{_datadir}/php/Symfony4/Component/DependencyInjection/autoload.php', + ], [ + '%{_datadir}/php/Symfony5/Component/EventDispatcher/autoload.php', + '%{_datadir}/php/Symfony4/Component/EventDispatcher/autoload.php', + ], [ + '%{_datadir}/php/Symfony5/Component/Serializer/autoload.php', + '%{_datadir}/php/Symfony4/Component/Serializer/autoload.php', + ], [ + '%{_datadir}/php/Symfony5/Component/Stopwatch/autoload.php', + '%{_datadir}/php/Symfony4/Component/Stopwatch/autoload.php', + ], + '%{_datadir}/php/Doctrine/Common/Collections/autoload.php', +]); +EOF # Cleanup patched files find src -name \*rpm -delete -print +# fix path in configuration +sed -e 's:src/Bartlett/CompatInfo/::' -i config/set/*php +mv config src/Bartlett/CompatInfo/config +# for tests +ln -s src/Bartlett/CompatInfo/config config + # Check package version FILE=src/Bartlett/CompatInfo/Console/Application.php grep " VERSION" $FILE -sed -e '/VERSION/s/5.3.x-dev/%{version}/' -i $FILE grep %{version} $FILE @@ -153,7 +210,6 @@ mkdir -p %{buildroot}%{_datadir}/php cp -pr src/Bartlett %{buildroot}%{_datadir}/php/Bartlett install -D -p -m 755 bin/phpcompatinfo %{buildroot}%{_bindir}/phpcompatinfo -install -D -p -m 644 bin/phpcompatinfo.json.dist %{buildroot}%{_sysconfdir}/phpcompatinfo.json install -D -p -m 644 bin/phpcompatinfo.1 %{buildroot}%{_mandir}/man1/phpcompatinfo.1 install -D -p -m 755 %{SOURCE1} %{buildroot}%{_datadir}/%{name}/fedora-review-check @@ -162,15 +218,18 @@ install -D -p -m 755 %{SOURCE1} %{buildroot}%{_datadir}/%{name} %if %{with tests} %check mkdir vendor -ln -s %{buildroot}%{_datadir}/php/Bartlett/CompatInfo/autoload.php vendor/ - +cat << 'EOF' | tee vendor/autoload.php + - 5.4.1-1 +- update to 5.4.1 + +* Thu Oct 1 2020 Remi Collet - 5.4.0-1 +- update to 5.4.0 +- switch to phpunit9 +- add dependency on ramsey/uuid +- add dependency on symfony components: config, console, dependency-injection, + event-dispatcher, serializer and stopwatch +- add dependency on doctrine/collections +- drop dependency on doctrine/cache +- switch to classmap autoloader +- drop configuration file (no more supported) + * Wed Jul 8 2020 Remi Collet - 5.3.0-1 - update to 5.3.0 -- cgit