summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json13
-rw-r--r--php-bartlett-php-compatinfo-db-2.16-rpm.patch (renamed from php-bartlett-php-compatinfo-db-2.0-rpm.patch)49
-rw-r--r--php-bartlett-php-compatinfo-db.spec39
3 files changed, 58 insertions, 43 deletions
diff --git a/composer.json b/composer.json
index c3510c7..4014013 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
},
"require": {
"php": "^7.1",
- "composer/semver": "^1.0",
+ "composer/semver": "^1.0|^2.0|^3.0",
"ext-curl": "*",
"ext-intl": "*",
"ext-libxml": "*",
@@ -21,22 +21,13 @@
"ext-json": "*",
"ext-pdo_sqlite": "*",
"symfony/console": "^4.4|^5.0",
- "jean85/pretty-package-versions": "~1.3",
+ "composer/package-versions-deprecated": "^1.8",
"league/tactician": "^1.0",
"laminas/laminas-diagnostics": "^1.3"
},
"require-dev": {
- "psr/log": "^1.0",
- "monolog/monolog": "^1.10",
- "bartlett/phpunit-loggertestlistener": "^2.0",
"phpunit/php-timer": "^2.0"
},
- "suggest": {
- "symfony/console": "Allow to rebuild the Reference CompatInfo Database",
- "psr/log": "Allow logging events with the LogPlugin",
- "monolog/monolog": "Allow logging events with the LogPlugin",
- "bartlett/phpunit-loggertestlistener": "Allow logging unit tests to your favorite PSR-3 logger interface"
- },
"authors": [
{
"name": "Laurent Laville",
diff --git a/php-bartlett-php-compatinfo-db-2.0-rpm.patch b/php-bartlett-php-compatinfo-db-2.16-rpm.patch
index 57a29db..f9a67e1 100644
--- a/php-bartlett-php-compatinfo-db-2.0-rpm.patch
+++ b/php-bartlett-php-compatinfo-db-2.16-rpm.patch
@@ -1,6 +1,6 @@
diff -up ./bin/compatinfo-db.rpm ./bin/compatinfo-db
---- ./bin/compatinfo-db.rpm 2020-05-10 13:26:48.000000000 +0200
-+++ ./bin/compatinfo-db 2020-05-11 08:25:46.977559291 +0200
+--- ./bin/compatinfo-db.rpm 2020-07-11 10:24:45.000000000 +0200
++++ ./bin/compatinfo-db 2020-07-13 11:22:01.041329662 +0200
@@ -7,10 +7,7 @@ declare(strict_types=1);
gc_disable(); // performance boost
@@ -14,8 +14,8 @@ diff -up ./bin/compatinfo-db.rpm ./bin/compatinfo-db
$isAutoloadFound = false;
diff -up ./src/DatabaseFactory.php.rpm ./src/DatabaseFactory.php
---- ./src/DatabaseFactory.php.rpm 2020-05-10 13:26:48.000000000 +0200
-+++ ./src/DatabaseFactory.php 2020-05-11 08:25:46.977559291 +0200
+--- ./src/DatabaseFactory.php.rpm 2020-07-11 10:24:45.000000000 +0200
++++ ./src/DatabaseFactory.php 2020-07-13 11:22:01.041329662 +0200
@@ -35,14 +35,13 @@ class DatabaseFactory
private static function getSqliteDsn() : array
@@ -60,16 +60,43 @@ diff -up ./src/DatabaseFactory.php.rpm ./src/DatabaseFactory.php
\ Pas de fin de ligne à la fin du fichier
+}
diff -up ./src/Presentation/Console/Application.php.rpm ./src/Presentation/Console/Application.php
---- ./src/Presentation/Console/Application.php.rpm 2020-05-11 08:25:46.977559291 +0200
-+++ ./src/Presentation/Console/Application.php 2020-05-11 08:27:10.705045605 +0200
-@@ -38,11 +38,7 @@ class Application extends \Symfony\Compo
+--- ./src/Presentation/Console/Application.php.rpm 2020-07-13 11:22:01.041329662 +0200
++++ ./src/Presentation/Console/Application.php 2020-07-13 11:32:58.975441852 +0200
+@@ -13,8 +13,6 @@ use Bartlett\CompatInfoDb\Presentation\C
+ use Bartlett\CompatInfoDb\Presentation\Console\Command\ReleaseCommand;
+ use Bartlett\CompatInfoDb\Presentation\Console\Command\ShowCommand;
- public function __construct(ContainerInterface $container)
+-use PackageVersions\Versions;
+-
+ use Psr\Container\ContainerInterface;
+
+ use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
+@@ -30,7 +28,7 @@ use PDO;
+ class Application extends \Symfony\Component\Console\Application
+ {
+ public const NAME = 'Database handler for CompatInfo';
+- public const VERSION = '2.x-dev';
++ public const VERSION = '@VERSION@';
+
+ /** @var string */
+ private $baseDir;
+@@ -40,20 +38,7 @@ class Application extends \Symfony\Compo
+
+ public function __construct(ContainerInterface $container, string $version = 'UNKNOWN')
{
-- try {
-- $version = \Jean85\PrettyVersions::getVersion('bartlett/php-compatinfo-db')->getPrettyVersion();
-- } catch (\OutOfBoundsException $e) {
+- if ('UNKNOWN' === $version) {
+- // composer or git outside world strategy
- $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-db');
+- list($ver, ) = explode('@', $version);
+-
+- if (strpos($ver, 'dev') === false) {
+- $version = $ver;
+- }
- }
+ $version = self::VERSION;
parent::__construct(self::NAME, $version);
diff --git a/php-bartlett-php-compatinfo-db.spec b/php-bartlett-php-compatinfo-db.spec
index 697d3ca..d253edf 100644
--- a/php-bartlett-php-compatinfo-db.spec
+++ b/php-bartlett-php-compatinfo-db.spec
@@ -7,12 +7,12 @@
# Please, preserve the changelog entries
#
# See https://github.com/llaville/php-compatinfo-db/releases
-%global gh_commit ff90705541e86c81b99053449b8b98841f0d4163
+%global gh_commit 878baf3857fcb01129963c510ac95a1fe0d3e54f
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20151031
%global gh_owner llaville
%global gh_project php-compatinfo-db
-%global upstream_version 2.15.0
+%global upstream_version 2.16.0
#global upstream_prever RC1
# Namespace
%global ns_vendor Bartlett
@@ -40,8 +40,8 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
# Fix autoloader path
# Fix sqlite database path
-# Fix version and avoir jean85/pretty-package-versions (relying on composer.lock)
-Patch0: %{name}-2.0-rpm.patch
+# Fix version and avoir composer/package-versions-deprecated (relying on composer.lock)
+Patch0: %{name}-2.16-rpm.patch
# CURL_SSLVERSION constants have been backported
Patch1: %{name}-curltls.patch
@@ -52,14 +52,13 @@ BuildArch: noarch
BuildRequires: php(language) >= 7.1
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(composer/semver) >= 1.0 with php-composer(composer/semver) < 2)
+BuildRequires: (php-composer(composer/semver) >= 3.0 with php-composer(composer/semver) < 4)
BuildRequires: (php-composer(symfony/console) >= 4.4 with php-composer(symfony/console) < 6)
BuildRequires: (php-composer(league/tactician) >= 1.0 with php-composer(league/tactician) < 2)
BuildRequires: (php-composer(laminas/laminas-diagnostics) >= 1.3 with php-composer(laminas/laminas-diagnostics) < 2)
-# remirepo:9
+# remirepo:8
%else
-BuildRequires: php-composer(composer/semver) < 2
-BuildRequires: php-composer(composer/semver) >= 1.0
+BuildRequires: php-composer-semver3
BuildRequires: php-symfony-console4 >= 4.4
BuildRequires: php-composer(league/tactician) < 2
BuildRequires: php-composer(league/tactician) >= 1.0
@@ -79,9 +78,6 @@ BuildRequires: php-pdo_sqlite
# For our patch / autoloader
BuildRequires: php-composer(fedora/autoloader)
# From composer.json, "require-dev": {
-# "psr/log": "^1.0",
-# "monolog/monolog": "^1.10",
-# "bartlett/phpunit-loggertestlistener": "^2.0",
# "phpunit/php-timer": "^2.0"
BuildRequires: php-cli
%if %{with tests}
@@ -90,7 +86,7 @@ BuildRequires: php-composer(phpunit/phpunit)
# From composer.json, "require"
# "php": "^7.1",
-# "composer/semver": "^1.0",
+# "composer/semver": "^1.0|^2.0|^3.0",
# "ext-curl": "*",
# "ext-intl": "*",
# "ext-libxml": "*",
@@ -100,19 +96,19 @@ BuildRequires: php-composer(phpunit/phpunit)
# "ext-json": "*",
# "ext-pdo_sqlite": "*",
# "symfony/console": "^4.4||^5.0",
-# "jean85/pretty-package-versions": "^1.3",
+# "composer/package-versions-deprecated": "^1.8",
# "league/tactician": "^1.0",
# "laminas/laminas-diagnostics": "^1.3"
Requires: php(language) >= 7.1
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(composer/semver) >= 1.0 with php-composer(composer/semver) < 2)
+Requires: (php-composer(composer/semver) >= 3.0 with php-composer(composer/semver) < 4)
Requires: (php-composer(symfony/console) >= 4.4 with php-composer(symfony/console) < 6)
Requires: (php-composer(league/tactician) >= 1.0 with php-composer(league/tactician) < 2)
Requires: (php-composer(laminas/laminas-diagnostics) >= 1.3 with php-composer(laminas/laminas-diagnostics) < 2)
-# remirepo:9
+# remirepo:8
%else
-Requires: php-composer(composer/semver) < 2
+Requires: php-composer-semver3
Requires: php-composer(composer/semver) >= 1.0
Requires: php-symfony-console4 >= 4.4
Requires: php-composer(league/tactician) < 2
@@ -149,10 +145,6 @@ Conflicts: php-bartlett-PHP-CompatInfo < 5
%patch0 -p1 -b .rpm
%patch1 -p0 -b .curltls
-# fix reported version
-sed -e '/VERSION/s/2.14.0/%{version}/' -i src/Presentation/Console/Application.php
-grep "%{version}" src/Presentation/Console/Application.php
-
cat << 'EOF' | tee src/autoload.php
<?php
/**
@@ -163,7 +155,7 @@ require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\CompatInfoDb\\', __DIR__);
\Fedora\Autoloader\Dependencies::required(array(
- '%{_datadir}/php/Composer/Semver/autoload.php',
+ '%{_datadir}/php/Composer/Semver3/autoload.php',
[
'%{_datadir}/php/Symfony5/Component/Console/autoload.php',
'%{_datadir}/php/Symfony4/Component/Console/autoload.php',
@@ -175,6 +167,7 @@ EOF
# Use package version
sed -e 's/@VERSION@/%{upstream_version}%{?upstream_prever}/' -i src/Presentation/Console/Application.php
+grep "%{version}" src/Presentation/Console/Application.php
# Cleanup patched files
find src -name \*rpm -delete -print
@@ -280,6 +273,10 @@ exit $ret
%changelog
+* Mon Jul 13 2020 Remi Collet <remi@remirepo.net> - 2.16.0-1
+- update to 2.16.0
+- switch to composer/semver 3
+
* Tue Jun 30 2020 Remi Collet <remi@remirepo.net> - 2.15.0-1
- update to 2.15.0