summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json5
-rw-r--r--php-bartlett-PHP-CompatInfo-5.5-rpm.patch105
-rw-r--r--php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch85
-rw-r--r--php-bartlett-PHP-CompatInfo.spec41
4 files changed, 127 insertions, 109 deletions
diff --git a/composer.json b/composer.json
index 7d2e089..ff46137 100644
--- a/composer.json
+++ b/composer.json
@@ -18,7 +18,7 @@
"ext-pdo": "*",
"ext-pdo_sqlite": "*",
"bartlett/php-reflect": "^4.4",
- "bartlett/php-compatinfo-db": "^3.3",
+ "bartlett/php-compatinfo-db": "^3.4",
"doctrine/collections": "^1.4",
"composer/package-versions-deprecated": "^1.8",
"psr/log": "^1.0",
@@ -60,8 +60,7 @@
"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"
+ "export DATABASE_URL=sqlite:///${HOME}/.cache/bartlett/compatinfo-db.sqlite"
],
"post-install-cmd": [
"@setup-database",
diff --git a/php-bartlett-PHP-CompatInfo-5.5-rpm.patch b/php-bartlett-PHP-CompatInfo-5.5-rpm.patch
new file mode 100644
index 0000000..f84d1bb
--- /dev/null
+++ b/php-bartlett-PHP-CompatInfo-5.5-rpm.patch
@@ -0,0 +1,105 @@
+diff -up ./bin/phpcompatinfo.rpm ./bin/phpcompatinfo
+--- ./bin/phpcompatinfo.rpm 2021-03-15 08:24:33.926051485 +0100
++++ ./bin/phpcompatinfo 2021-03-15 08:27:12.457422097 +0100
+@@ -8,12 +8,12 @@ if (PHP_SAPI !== 'cli') {
+
+ gc_disable(); // performance boost
+
+-require_once dirname(__DIR__) . '/config/bootstrap.php';
++require_once '/usr/share/php/Bartlett/CompatInfo/config/bootstrap.php';
+
+ use Bartlett\CompatInfo\Console\ApplicationInterface;
+
+ /** @var \Symfony\Component\DependencyInjection\ContainerBuilder $container */
+-$container = require dirname(__DIR__) . '/config/container.php';
++$container = require '/usr/share/php/Bartlett/CompatInfo/config/container.php';
+
+ $app = $container->get(ApplicationInterface::class);
+ $app->setContainer($container);
+diff -up ./config/bootstrap.php.rpm ./config/bootstrap.php
+--- ./config/bootstrap.php.rpm 2021-03-15 08:25:20.386867027 +0100
++++ ./config/bootstrap.php 2021-03-15 08:26:06.587683611 +0100
+@@ -6,6 +6,8 @@ if (\Phar::running()) {
+ ];
+ } else {
+ $possibleAutoloadPaths = [
++ // RPM
++ __DIR__ . '/../autoload.php',
+ // local dev repository
+ __DIR__ . '/../vendor/autoload.php',
+ // dependency
+diff -up ./config/set/default.php.rpm ./config/set/default.php
+--- ./config/set/default.php.rpm 2021-03-13 11:18:56.000000000 +0100
++++ ./config/set/default.php 2021-03-15 08:24:33.926051485 +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 -up ./src/Bartlett/CompatInfo/Console/Application.php.rpm ./src/Bartlett/CompatInfo/Console/Application.php
+--- ./src/Bartlett/CompatInfo/Console/Application.php.rpm 2021-03-13 11:18:56.000000000 +0100
++++ ./src/Bartlett/CompatInfo/Console/Application.php 2021-03-15 08:24:33.926051485 +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 ./tests/Reference/ParameterTest.php.rpm ./tests/Reference/ParameterTest.php
+--- ./tests/Reference/ParameterTest.php.rpm 2021-03-15 08:33:56.677816772 +0100
++++ ./tests/Reference/ParameterTest.php 2021-03-15 08:35:06.718538322 +0100
+@@ -42,7 +42,7 @@ final class ParameterTest extends SniffT
+ */
+ public function functionProvider()
+ {
+- $container = require __DIR__ . '/../../config/container.php';
++ $container = require '@BUILDPATH@/config/container.php';
+ $repository = $container->get(FunctionRepository::class);
+ $functions = [];
+ foreach ($repository->getAll() as $function) {
+diff -up ./tests/Sniffs/SniffTestCase.php.rpm ./tests/Sniffs/SniffTestCase.php
+--- ./tests/Sniffs/SniffTestCase.php.rpm 2021-03-15 08:33:50.789840180 +0100
++++ ./tests/Sniffs/SniffTestCase.php 2021-03-15 08:34:48.304611521 +0100
+@@ -21,7 +21,7 @@ abstract class SniffTestCase extends Tes
+
+ self::$fixtures .= 'sniffs' . DIRECTORY_SEPARATOR;
+
+- $container = require __DIR__ . '/../../config/container.php';
++ $container = require '@BUILDPATH@/config/container.php';
+ self::$sniffs = $container->get(SniffCollection::class);
+ }
+ }
+diff -up ./tests/TestCase.php.rpm ./tests/TestCase.php
+--- ./tests/TestCase.php.rpm 2021-03-15 08:33:45.726860307 +0100
++++ ./tests/TestCase.php 2021-03-15 08:34:30.666681640 +0100
+@@ -38,7 +38,7 @@ abstract class TestCase extends \PHPUnit
+ // request for a Bartlett\CompatInfo\Api\Analyser
+ self::$api = $client->api('analyser');
+
+- $container = require __DIR__ . '/../config/container.php';
++ $container = require '@BUILDPATH@/config/container.php';
+ self::$references = $container->get(ReferenceCollectionInterface::class);
+ }
+
diff --git a/php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch b/php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch
deleted file mode 100644
index db16a0c..0000000
--- a/php-bartlett-PHP-CompatInfo-5.5.0-rpm.patch
+++ /dev/null
@@ -1,85 +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 -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 a8c5f88..b743d56 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 eee33868bcfb662d55eb7164b9bb749619c8b9d6
+%global gh_commit 38294902ae898ae4d29b300a516474330670f33f
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20151005
%global gh_owner llaville
@@ -19,18 +19,12 @@
#global prever RC2
%bcond_without tests
-%global upstream_version 5.5.0
+%global upstream_version 5.5.1
#global upstream_prever RC1
-%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-%global sym_prefix php-symfony3
-%else
-%global sym_prefix php-symfony
-%endif
-
Name: php-bartlett-PHP-CompatInfo
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 0%{?dist}
+Release: 1%{?dist}
Summary: Find out version and the extensions required for a piece of code to run
License: BSD
@@ -40,9 +34,9 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
# Script for fedora-review
Source1: fedora-review-check
-# Autoload and sqlite database path
+# Autoload and config path
# avoid jean85/pretty-package-versions
-Patch0: %{name}-5.5.0-rpm.patch
+Patch0: %{name}-5.5-rpm.patch
BuildArch: noarch
BuildRequires: php(language) >= 7.2
@@ -52,7 +46,7 @@ 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) >= 3.3 with php-composer(bartlett/php-compatinfo-db) < 4)
+BuildRequires: (php-composer(bartlett/php-compatinfo-db) >= 3.4 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)
@@ -66,7 +60,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 >= 3.3
+BuildRequires: php-bartlett-php-compatinfo-db >= 3.4
BuildRequires: php-PsrLog >= 1.0
BuildRequires: php-ramsey-uuid >= 4.0
BuildRequires: php-symfony4-config >= 4.4
@@ -93,7 +87,7 @@ BuildRequires: php-fedora-autoloader-devel
# "ext-pdo": "*",
# "ext-pdo_sqlite": "*",
# "bartlett/php-reflect": "^4.4",
-# "bartlett/php-compatinfo-db": "^3.3",
+# "bartlett/php-compatinfo-db": "^3.4",
# "doctrine/collections": "^1.4",
# "composer/package-versions-deprecated": "^1.8",
# "psr/log": "^1.0",
@@ -116,7 +110,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) >= 3.3 with php-composer(bartlett/php-compatinfo-db) < 4)
+Requires: (php-composer(bartlett/php-compatinfo-db) >= 3.4 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)
@@ -130,7 +124,7 @@ Requires: (php-composer(doctrine/collections) >= 1.4 with php-comp
# remirepo:14
%else
Requires: php-bartlett-PHP-Reflect >= 4.4
-Requires: php-bartlett-php-compatinfo-db >= 3.3
+Requires: php-bartlett-php-compatinfo-db >= 3.4
Requires: php-PsrLog >= 1.0
Requires: php-ramsey-uuid >= 4.0
Requires: php-symfony4-config >= 4.4
@@ -206,8 +200,6 @@ 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
@@ -231,13 +223,16 @@ install -D -p -m 755 %{SOURCE1} %{buildroot}%{_datadir}/%{name}
%if %{with tests}
%check
-mkdir vendor
-cat << 'EOF' | tee vendor/autoload.php
+mkdir config
+cat << 'EOF' | tee config/bootstrap.php
<?php
-require_once "%{buildroot}%{_datadir}/php/Bartlett/CompatInfo/autoload.php";
+require_once "%{buildroot}%{_datadir}/php/Bartlett/CompatInfo/config/bootstrap.php";
\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\Tests\\CompatInfo\\', dirname(__DIR__) . '/tests');
EOF
+sed -e 's:@BUILDPATH@:%{buildroot}%{_datadir}/php/Bartlett/CompatInfo:' \
+ -i tests/TestCase.php tests/Sniffs/SniffTestCase.php tests/Reference/ParameterTest.php
+
ret=0
for cmdarg in "php %{phpunit}" php73 php74 php80; do
if which $cmdarg; then
@@ -268,6 +263,10 @@ fi
%changelog
+* Mon Mar 15 2021 Remi Collet <remi@remirepo.net> - 5.5.1-1
+- update to 5.5.1
+- raise dependency on bartlett/php-compatinfo-db 3.4
+
* Thu Mar 11 2021 Remi Collet <remi@remirepo.net> - 5.5.0-0
- test build of upcoming 5.5.0
- raise dependency on PHP 7.2