From a75febd64858a98fd72b63206cd0d6822da50a35 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 4 Jan 2019 09:21:12 +0100 Subject: update to 2.0.0RC1 bump dependency on PHP 7.1 add dependency on symfony/console 3 or 4 add dependency on league/tactician add dependency on zendframework/zenddiagnostics add php-bartlett-php-compatinfo-db command --- accda679038e2e4239229521f643758b02557105.patch | 50 +++++++ composer.json | 15 ++- php-bartlett-php-compatinfo-db-1.19.0-rpm.patch | 63 --------- php-bartlett-php-compatinfo-db-1.2.0-autoload.php | 12 -- php-bartlett-php-compatinfo-db-2.0-rpm.patch | 78 +++++++++++ php-bartlett-php-compatinfo-db.spec | 152 ++++++++++++++++------ 6 files changed, 247 insertions(+), 123 deletions(-) create mode 100644 accda679038e2e4239229521f643758b02557105.patch delete mode 100644 php-bartlett-php-compatinfo-db-1.19.0-rpm.patch delete mode 100644 php-bartlett-php-compatinfo-db-1.2.0-autoload.php create mode 100644 php-bartlett-php-compatinfo-db-2.0-rpm.patch diff --git a/accda679038e2e4239229521f643758b02557105.patch b/accda679038e2e4239229521f643758b02557105.patch new file mode 100644 index 0000000..b66081f --- /dev/null +++ b/accda679038e2e4239229521f643758b02557105.patch @@ -0,0 +1,50 @@ +From accda679038e2e4239229521f643758b02557105 Mon Sep 17 00:00:00 2001 +From: Laurent Laville +Date: Wed, 2 Jan 2019 22:41:27 +0100 +Subject: [PATCH] update Amqp ref to version 1.9.4 (stable) + +--- + CHANGELOG.md | 1 + + data/references/Amqp.iniEntries.json | 8 ++++++++ + data/references/Amqp.releases.json | 9 +++++++++ + 3 files changed, 18 insertions(+) + +diff --git a/data/references/Amqp.iniEntries.json b/data/references/Amqp.iniEntries.json +index 192a8a3..c9a2113 100644 +--- a/data/references/Amqp.iniEntries.json ++++ b/data/references/Amqp.iniEntries.json +@@ -142,5 +142,13 @@ + "ext_max": "", + "php_min": "5.3.0", + "php_max": "" ++ }, ++ { ++ "ext_name_fk": 1, ++ "name": "amqp.sasl_method", ++ "ext_min": "1.9.4", ++ "ext_max": "", ++ "php_min": "5.3.0", ++ "php_max": "" + } + ] +\ No newline at end of file +diff --git a/data/references/Amqp.releases.json b/data/references/Amqp.releases.json +index da7c9cc..b6438ba 100644 +--- a/data/references/Amqp.releases.json ++++ b/data/references/Amqp.releases.json +@@ -358,5 +358,14 @@ + "ext_max": "", + "php_min": "5.3.0", + "php_max": "" ++ }, ++ { ++ "ext_name_fk": 1, ++ "rel_version": "1.9.4", ++ "rel_date": "2019-01-02", ++ "rel_state": "stable", ++ "ext_max": "", ++ "php_min": "5.3.0", ++ "php_max": "" + } + ] +\ No newline at end of file diff --git a/composer.json b/composer.json index ee478e1..b8bbc5b 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "issues": "https://github.com/llaville/php-compatinfo-db/issues" }, "require": { - "php": "^5.5|^7.0", + "php": "^7.1", "composer/semver": "^1.0", "ext-curl": "*", "ext-intl": "*", @@ -19,14 +19,17 @@ "ext-pcre": "*", "ext-spl": "*", "ext-json": "*", - "ext-pdo_sqlite": "*" + "ext-pdo_sqlite": "*", + "symfony/console": "^3.0||^4.0", + "jean85/pretty-package-versions": "^1.2", + "league/tactician": "^1.0", + "zendframework/zenddiagnostics": "^1.3" }, "require-dev": { - "symfony/console": "^2.5||^3.0||^4.0", "psr/log": "^1.0", "monolog/monolog": "^1.10", - "bartlett/phpunit-loggertestlistener": "^1.7", - "phpunit/php-timer": "^1.0||^2.0" + "bartlett/phpunit-loggertestlistener": "2.0.0RC1", + "phpunit/php-timer": "^2.0" }, "suggest": { "symfony/console": "Allow to rebuild the Reference CompatInfo Database", @@ -49,7 +52,7 @@ ], "autoload": { "psr-4": { - "Bartlett\\CompatInfoDb\\": "src/Bartlett/CompatInfoDb" + "Bartlett\\CompatInfoDb\\": "src/" } }, "autoload-dev": { diff --git a/php-bartlett-php-compatinfo-db-1.19.0-rpm.patch b/php-bartlett-php-compatinfo-db-1.19.0-rpm.patch deleted file mode 100644 index 4aca8b8..0000000 --- a/php-bartlett-php-compatinfo-db-1.19.0-rpm.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -up ./data/handleDB.php.rpm ./data/handleDB.php ---- ./data/handleDB.php.rpm 2017-07-17 13:41:26.000000000 +0200 -+++ ./data/handleDB.php 2017-07-17 20:24:00.271263969 +0200 -@@ -12,7 +12,8 @@ - * @since Release 1.0.0alpha1 of PHP_CompatInfo_Db - */ - --require_once dirname(__DIR__) . '/vendor/autoload.php'; -+require_once '/usr/share/php/Symfony3/Component/autoload.php'; -+require_once dirname(__DIR__) . '/src/Bartlett/CompatInfoDb/autoload.php'; - require_once __DIR__ . '/ReferenceCollection.php'; - - use Bartlett\CompatInfoDb\ExtensionFactory; -diff -up ./src/Bartlett/CompatInfoDb/Environment.php.rpm ./src/Bartlett/CompatInfoDb/Environment.php ---- ./src/Bartlett/CompatInfoDb/Environment.php.rpm 2017-07-17 20:24:00.271263969 +0200 -+++ ./src/Bartlett/CompatInfoDb/Environment.php 2017-07-17 20:31:52.645050200 +0200 -@@ -39,28 +39,13 @@ class Environment - { - $database = 'compatinfo.sqlite'; - -- if (PATH_SEPARATOR == ';') { -- // windows -- $userHome = getenv('USERPROFILE'); -+ if (($db = getenv('BARTLETT_COMPATINFO_DB')) && file_exists($db)) { -+ $tempDir = dirname($db); -+ } else if (file_exists($db = '/usr/share/php-bartlett-php-compatinfo-db/' . $database)) { -+ $tempDir = dirname($db); - } else { -- // unix -- $userHome = getenv('HOME'); -- } -- $tempDir = $userHome . '/.bartlett'; -- -- if (!file_exists($tempDir)) { -- mkdir($tempDir); -- } -- $source = dirname(dirname(dirname(__DIR__))) . '/data/' . $database; -- $dest = $tempDir . '/' . $database; -- -- if (!file_exists($dest) -- || sha1_file($source) !== sha1_file($dest) -- ) { -- // install DB only if necessary (missing or modified) -- copy($source, $dest); -- } -- -+ $tempDir = dirname(dirname(dirname(__DIR__))) . '/data'; -+ } - $pdo = new PDO('sqlite:' . $tempDir . '/' . $database); - return $pdo; - } -diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php ---- ./tests/bootstrap.php.rpm 2017-07-17 13:41:26.000000000 +0200 -+++ ./tests/bootstrap.php 2017-07-17 20:24:00.272263975 +0200 -@@ -1,6 +1,7 @@ - 'pdo_sqlite', +@@ -58,19 +57,6 @@ class DatabaseFactory + { + $dbParams = self::getSqliteDsn(); + +- if (!file_exists(static::$tempDir)) { +- mkdir(static::$tempDir); +- } +- $source = dirname(__DIR__) . '/data/' . static::$database; +- $dest = static::$tempDir . '/' . static::$database; +- +- if (!file_exists($dest) +- || sha1_file($source) !== sha1_file($dest) +- ) { +- // install DB only if necessary (missing or modified) +- copy($source, $dest); +- } +- + return new PDO($dbParams['url']); + } +-} +\ 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 2018-12-31 15:15:21.000000000 +0100 ++++ ./src/Presentation/Console/Application.php 2019-01-04 08:23:55.040657137 +0100 +@@ -47,12 +47,7 @@ class Application extends \Symfony\Compo + + public function __construct(string $name = 'UNKNOWN') + { +- try { +- $version = \Jean85\PrettyVersions::getVersion('bartlett/php-compatinfo-db')->getPrettyVersion(); +- } catch (\OutOfBoundsException $e) { +- $version = 'UNKNOWN'; +- } +- parent::__construct($name, $version); ++ parent::__construct($name, '@VERSION@'); + + $this->baseDir = dirname(dirname(dirname(__DIR__))); + } diff --git a/php-bartlett-php-compatinfo-db.spec b/php-bartlett-php-compatinfo-db.spec index 3735b6a..5a9cb4a 100644 --- a/php-bartlett-php-compatinfo-db.spec +++ b/php-bartlett-php-compatinfo-db.spec @@ -7,12 +7,13 @@ # Please, preserve the changelog entries # # See https://github.com/llaville/php-compatinfo-db/releases -%global gh_commit c2a634ee1003bdb225effd52b9203e2a84dcdd24 +%global gh_commit 85d25a5c230cc2285b8a548021ff6b5ae28e985e %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 prever alpha1 +%global upstream_version 2.0.0 +%global upstream_prever RC1 # Namespace %global ns_vendor Bartlett %global ns_project CompatInfoDb @@ -27,32 +28,46 @@ %endif Name: php-%{c_vendor}-%{c_project} -Version: 1.39.0 +Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} %global specrel 1 Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Reference Database to be used with php-compatinfo library License: BSD URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}%{?prever}-%{gh_short}.tar.gz +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz -# Autoloader for RPM -Source1: %{name}-1.2.0-autoload.php - -# Autoload and sqlite database path -Patch0: %{name}-1.19.0-rpm.patch +# 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 # CURL_SSLVERSION constants have been backported Patch1: %{name}-curltls.patch +# Upstream +Patch2: https://github.com/llaville/php-compatinfo-db/commit/accda679038e2e4239229521f643758b02557105.patch BuildArch: noarch # Needed to build the database from sources -BuildRequires: php(language) >= 5.5 +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) >= 1.0 with php-composer(composer/semver) < 2) +BuildRequires: (php-composer(symfony/console) >= 3.0 with php-composer(symfony/console) < 5) +BuildRequires: (php-composer(league/tactician) >= 1.0 with php-composer(league/tactician) < 2) +BuildRequires: (php-composer(zendframework/zenddiagnostics) >= 1.3 with php-composer(zendframework/zenddiagnostics) < 2) +# remirepo:10 %else -BuildRequires: php-composer(composer/semver) < 2 -BuildRequires: php-composer(composer/semver) >= 1.0 +BuildRequires: php-composer(composer/semver) < 2 +BuildRequires: php-composer(composer/semver) >= 1.0 +BuildRequires: php-composer(symfony/console) < 5 +BuildRequires: php-composer(symfony/console) >= 3.0 +BuildRequires: php-composer(league/tactician) < 2 +BuildRequires: php-composer(league/tactician) >= 1.0 +BuildRequires: php-composer(zendframework/zenddiagnostics) < 2 +BuildRequires: php-composer(zendframework/zenddiagnostics) >= 1.3 %endif +BuildRequires: php-pdo +BuildRequires: php-reflection BuildRequires: php-curl BuildRequires: php-intl BuildRequires: php-libxml @@ -64,19 +79,17 @@ BuildRequires: php-pdo_sqlite # For our patch / autoloader BuildRequires: php-composer(fedora/autoloader) # From composer.json, "require-dev": { -# "symfony/console": "^2.5||^3.0||^4.0", # "psr/log": "^1.0", # "monolog/monolog": "^1.10", -# "bartlett/phpunit-loggertestlistener": "^1.5" -# "phpunit/php-timer": "^1.0||^2.0" +# "bartlett/phpunit-loggertestlistener": "2.0.0RC1", +# "phpunit/php-timer": "^2.0" BuildRequires: php-cli -BuildRequires: php-symfony3-console %if %{with_tests} BuildRequires: php-composer(phpunit/phpunit) %endif # From composer.json, "require" -# "php": "^5.5|^7.0", +# "php": "^7.1", # "composer/semver": "^1.0", # "ext-curl": "*", # "ext-intl": "*", @@ -85,21 +98,39 @@ BuildRequires: php-composer(phpunit/phpunit) # "ext-pcre": "*", # "ext-spl": "*", # "ext-json": "*", -# "ext-pdo_sqlite": "*" -Requires: php(language) >= 5.5 +# "ext-pdo_sqlite": "*", +# "symfony/console": "^3.0||^4.0", +# "jean85/pretty-package-versions": "^1.2", +# "league/tactician": "^1.0", +# "zendframework/zenddiagnostics": "^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) >= 1.0 with php-composer(composer/semver) < 2) +Requires: (php-composer(symfony/console) >= 3.0 with php-composer(symfony/console) < 5) +Requires: (php-composer(league/tactician) >= 1.0 with php-composer(league/tactician) < 2) +Requires: (php-composer(zendframework/zenddiagnostics) >= 1.3 with php-composer(zendframework/zenddiagnostics) < 2) +# remirepo:10 %else -Requires: php-composer(composer/semver) < 2 -Requires: php-composer(composer/semver) >= 1.0 +Requires: php-composer(composer/semver) < 2 +Requires: php-composer(composer/semver) >= 1.0 +Requires: php-composer(symfony/console) < 5 +Requires: php-composer(symfony/console) >= 3.0 +Requires: php-composer(league/tactician) < 2 +Requires: php-composer(league/tactician) >= 1.0 +Requires: php-composer(zendframework/zenddiagnostics) < 2 +Requires: php-composer(zendframework/zenddiagnostics) >= 1.3 %endif +Requires: php-pdo +Requires: php-reflection Requires: php-curl +Requires: php-date Requires: php-intl +Requires: php-json Requires: php-libxml Requires: php-openssl Requires: php-pcre Requires: php-spl -Requires: php-json Requires: php-pdo_sqlite # Required by autoloader Requires: php-composer(fedora/autoloader) @@ -118,11 +149,30 @@ Conflicts: php-bartlett-PHP-CompatInfo < 5 %patch0 -p1 -b .rpm %patch1 -p0 -b .curltls - -cp %{SOURCE1} src/%{ns_vendor}/%{ns_project}/autoload.php +%patch2 -p1 -b .up + +cat << 'EOF' | tee src/autoload.php +compatinfo-db + +: Diag +%{_bindir}/php -d date.timezone=Europe/Paris compatinfo-db bartlett:diagnose : Fix references database -%{_bindir}/php -d date.timezone=Europe/Paris data/handleDB.php db:release:php +%{_bindir}/php -d date.timezone=Europe/Paris compatinfo-db bartlett:db:release:php : Generate the references database -%{_bindir}/php -d date.timezone=Europe/Paris data/handleDB.php db:init +%{_bindir}/php -d date.timezone=Europe/Paris compatinfo-db bartlett:db:init %install -mkdir -p %{buildroot}%{_datadir}/php -cp -pr src/%{ns_vendor} %{buildroot}%{_datadir}/php/%{ns_vendor} +mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor} +cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project} -install -D -p -m 644 data/compatinfo.sqlite %{buildroot}%{_datadir}/%{name}/compatinfo.sqlite +install -D -p -m 644 data/compatinfo.sqlite %{buildroot}%{_datadir}/%{name}/compatinfo.sqlite +install -D -p -m 755 bin/compatinfo-db %{buildroot}%{_bindir}/%{name} %if %{with_tests} %check export BARTLETT_COMPATINFO_DB=%{buildroot}%{_datadir}/%{name}/compatinfo.sqlite -# remirepo:6 -VER=$(php -r "echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;") -if [ $VER -lt 72 ]; then - # because of polyfill - rm tests/Reference/Extension/CoreExtensionTest.php - rm tests/Reference/Extension/StandardExtensionTest.php -fi +cat << 'EOF' | tee tests/bootstrap.php + - 2.0.0~RC1-1 +- update to 2.0.0RC1 +- bump dependency on PHP 7.1 +- add dependency on symfony/console 3 or 4 +- add dependency on league/tactician +- add dependency on zendframework/zenddiagnostics +- add php-bartlett-php-compatinfo-db command + * Tue Dec 18 2018 Remi Collet - 1.39.0-1 - update to 1.39.0 -- cgit