summaryrefslogtreecommitdiffstats
path: root/php-bartlett-PHP-CompatInfo.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-bartlett-PHP-CompatInfo.spec')
-rw-r--r--php-bartlett-PHP-CompatInfo.spec166
1 files changed, 119 insertions, 47 deletions
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
+<?php
+require_once "%{buildroot}%{_datadir}/php/Bartlett/CompatInfo/autoload.php";
+\Fedora\Autoloader\Autoload::addPsr4('Bartlett\\Tests\\CompatInfo\\', dirname(__DIR__) . '/tests');
+EOF
ret=0
-for cmdarg in "php %{phpunit}" php72 php73 php74 php80; do
+for cmdarg in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do
if which $cmdarg; then
set $cmdarg
- $1 ${2:-%{_bindir}/phpunit8} \
- --include-path %{buildroot}%{_datadir}/php --verbose || ret=1
+ $1 ${2:-%{_bindir}/phpunit9} \
+ --include-path %{buildroot}%{_datadir}/php $OPT --verbose || ret=1
fi
done
exit $ret
@@ -189,7 +248,6 @@ fi
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json README.*
-%config(noreplace) %{_sysconfdir}/phpcompatinfo.json
%{_bindir}/phpcompatinfo
%{_datadir}/php/Bartlett/CompatInfo
%{_mandir}/man1/phpcompatinfo.1*
@@ -197,6 +255,20 @@ fi
%changelog
+* Tue Oct 6 2020 Remi Collet <remi@remirepo.net> - 5.4.1-1
+- update to 5.4.1
+
+* Thu Oct 1 2020 Remi Collet <remi@remirepo.net> - 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 <remi@remirepo.net> - 5.3.0-1
- update to 5.3.0