summaryrefslogtreecommitdiffstats
path: root/php-bartlett-php-compatinfo-db.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-01-04 09:21:12 +0100
committerRemi Collet <remi@remirepo.net>2019-01-04 09:21:12 +0100
commita75febd64858a98fd72b63206cd0d6822da50a35 (patch)
tree7f89fc5b4ba5a75fccb76fdbcbc9bd30427568d6 /php-bartlett-php-compatinfo-db.spec
parentd4eecf050c75fa9dcc087f1fc341a2462f1cdc83 (diff)
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
Diffstat (limited to 'php-bartlett-php-compatinfo-db.spec')
-rw-r--r--php-bartlett-php-compatinfo-db.spec152
1 files changed, 110 insertions, 42 deletions
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
+<?php
+/**
+ * Autoloader %{name} and its dependencies
+ */
+
+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/Symfony4/Component/Console/autoload.php',
+ '%{_datadir}/php/Symfony3/Component/Console/autoload.php',
+ ],
+ '%{_datadir}/php/League/Tactician/autoload.php',
+ '%{_datadir}/php/ZendDiagnostics/autoload.php',
+));
+EOF
# Use package version
-sed -e 's/@VERSION@/%{version}/' -i data/handleDB.php
+sed -e 's/@VERSION@/%{upstream_version}%{?upstream_prever}/' -i src/Presentation/Console/Application.php
# Cleanup patched files
find src -name \*rpm -delete -print
@@ -131,7 +181,7 @@ find src -name \*rpm -delete -print
%build
: Ensure current version is known by reference
OPT=$(php -r '
- require "src/%{ns_vendor}/%{ns_project}/autoload.php";
+ require "src/autoload.php";
switch (PHP_MAJOR_VERSION . PHP_MINOR_VERSION) {
case "54":
@@ -152,6 +202,9 @@ OPT=$(php -r '
case "72":
$max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_7_2;
break;
+ case "73":
+ $max = Bartlett\CompatInfoDb\ExtensionFactory::LATEST_PHP_7_3;
+ break;
default:
exit(0);
}
@@ -164,35 +217,41 @@ OPT=$(php -r '
}
')
if [ -n "$OPT" ]; then
- sed -e "$OPT" -i src/Bartlett/CompatInfoDb/ExtensionFactory.php
+ sed -e "$OPT" -i src/ExtensionFactory.php
fi
-grep " LATEST" src/Bartlett/CompatInfoDb/ExtensionFactory.php
+grep " LATEST" src/ExtensionFactory.php
+
+: Create command using local sources
+sed -e "s:%{_datadir}/php/%{ns_vendor}/%{ns_project}:$PWD/src:" bin/compatinfo-db >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
+<?php
+require_once '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\Tests\\CompatInfoDb\\', __DIR__);
+EOF
+
%{_bindir}/phpunit \
--include-path %{buildroot}%{_datadir}/php \
-d memory_limit=1G
@@ -204,12 +263,21 @@ fi
%license LICENSE
%doc composer.json
%doc *.md
+%{_bindir}/%{name}
%dir %{_datadir}/php/%{ns_vendor}
%{_datadir}/php/%{ns_vendor}/%{ns_project}
%{_datadir}/%{name}
%changelog
+* Thu Jan 3 2019 Remi Collet <remi@remirepo.net> - 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 <remi@remirepo.net> - 1.39.0-1
- update to 1.39.0