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.spec304
1 files changed, 112 insertions, 192 deletions
diff --git a/php-bartlett-PHP-CompatInfo.spec b/php-bartlett-PHP-CompatInfo.spec
index 362aa93..4a64e1f 100644
--- a/php-bartlett-PHP-CompatInfo.spec
+++ b/php-bartlett-PHP-CompatInfo.spec
@@ -11,15 +11,13 @@
%undefine __brp_mangle_shebangs
%{!?php_version: %global php_version %(php -r 'echo PHP_VERSION;' 2>/dev/null)}
-%global gh_commit e3b01295c0c46c3b751ef4a01dc41ad696815bc6
+%global gh_commit 511c6a65379f57b107b8a09d0e9089039bcfb860
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20151005
%global gh_owner llaville
%global gh_project php-compatinfo
-#global prever RC2
-%bcond_without tests
-%global upstream_version 5.5.4
+%global upstream_version 6.0.0
#global upstream_prever RC1
Name: php-bartlett-PHP-CompatInfo
@@ -27,120 +25,100 @@ Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
Release: 1%{?dist}
Summary: Find out version and the extensions required for a piece of code to run
-License: BSD
-URL: http://php5.laurent-laville.org/compatinfo/
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}%{?prever}-%{gh_short}.tar.gz
-
+License: BSD and MIT
+URL: https://llaville.github.io/php-compatinfo/
+Source0: %{name}-%{version}-%{gh_short}.tgz
# Script for fedora-review
Source1: fedora-review-check
+# Generate the archive will all dependencies
+Source9: makesrc.sh
-# Autoload and config path
-# avoid jean85/pretty-package-versions
-Patch0: %{name}-5.5.4-rpm.patch
+# Relocate the database
+Patch0: %{name}-6.0.0-rpm.patch
BuildArch: noarch
-BuildRequires: php(language) >= 7.2
-%if %{with tests}
-# to run test suite
+BuildRequires: php(language) >= 7.4
+BuildRequires: php-cli
+BuildRequires: php-dom
+BuildRequires: php-json
+BuildRequires: php-libxml
+BuildRequires: php-pcre
+BuildRequires: php-phar
+BuildRequires: php-pdo
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.6 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)
-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/finder) >= 4.4 with php-composer(symfony/finder) < 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:14
-%else
-BuildRequires: php-bartlett-PHP-Reflect >= 4.4
-BuildRequires: php-bartlett-php-compatinfo-db >= 3.6
-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-finder >= 4.4
-BuildRequires: php-symfony4-serializer >= 4.4
-BuildRequires: php-symfony4-stopwatch >= 4.4
-BuildRequires: php-doctrine-collections >= 1.4
-%endif
-%global phpunit %{_bindir}/phpunit9
-BuildRequires: %{phpunit}
-# For our patch / autoloader
-BuildRequires: php-fedora-autoloader-devel
-%endif
-
-# From composer.json, "require"
-# "php": "^7.2|^8.0",
-# "ext-libxml": "*",
-# "ext-pcre": "*",
-# "ext-spl": "*",
-# "ext-json": "*",
-# "ext-pdo": "*",
-# "ext-pdo_sqlite": "*",
-# "bartlett/php-reflect": "^4.4",
-# "bartlett/php-compatinfo-db": "^3.6",
-# "doctrine/collections": "^1.4",
-# "composer/package-versions-deprecated": "^1.8",
-# "psr/log": "^1.0",
-# "ramsey/uuid": "^3.9|^4.0",
-# "symfony/config": "^4.4|^5.0",
-# "symfony/console": "^4.4|^5.0",
-# "symfony/event-dispatcher": "^4.4|^5.0",
-# "symfony/finder": "^4.4|^5.0",
-# "symfony/dependency-injection": "^4.4|^5.0",
-# "symfony/serializer": "^4.4|^5.0",
-# "symfony/stopwatch": "^4.4|^5.0"
-Requires: php(language) >= 7.2
+BuildRequires: php-simplexml
+BuildRequires: php-spl
+BuildRequires: php-xmlreader
+
+Requires: php(language) >= 7.4
Requires: php-cli
+Requires: php-dom
Requires: php-json
Requires: php-libxml
Requires: php-pcre
+Requires: php-phar
Requires: php-pdo
Requires: php-pdo_sqlite
+Requires: php-simplexml
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.6 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)
-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/finder) >= 4.4 with php-composer(symfony/finder) < 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:14
-%else
-Requires: php-bartlett-PHP-Reflect >= 4.4
-Requires: php-bartlett-php-compatinfo-db >= 3.6
-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-finder >= 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)
-
-Provides: phpcompatinfo = %{version}
-Provides: php-composer(bartlett/php-compatinfo) = %{version}
+Requires: php-xmlreader
+
+# Bundled libraries
+Provides: bundled(php-bartlett-php-compatinfo-db) = 3.15.0
+Provides: bundled(php-brick-math) = 0.9.3
+Provides: bundled(php-composer-package-versions-deprecated) = 1.11.99.4
+Provides: bundled(php-composer-semver) = 3.2.6
+Provides: bundled(php-doctrine-annotations) = 1.13.2
+Provides: bundled(php-doctrine-cache) = 2.1.1
+Provides: bundled(php-doctrine-collections) = 1.6.8
+Provides: bundled(php-doctrine-common) = 3.2.0
+Provides: bundled(php-doctrine-dbal) = 3.2.0
+Provides: bundled(php-doctrine-deprecations) = v0.5.3
+Provides: bundled(php-doctrine-event-manager) = 1.1.1
+Provides: bundled(php-doctrine-inflector) = 2.0.4
+Provides: bundled(php-doctrine-instantiator) = 1.4.0
+Provides: bundled(php-doctrine-lexer) = 1.2.1
+Provides: bundled(php-doctrine-orm) = 2.10.3
+Provides: bundled(php-doctrine-persistence) = 2.2.3
+Provides: bundled(php-nikic-php-parser) = v4.13.2
+Provides: bundled(php-psr-cache) = 2.0.0
+Provides: bundled(php-psr-container) = 1.1.2
+Provides: bundled(php-psr-event-dispatcher) = 1.0.0
+Provides: bundled(php-psr-log) = 1.1.4
+Provides: bundled(php-ramsey-collection) = 1.2.2
+Provides: bundled(php-ramsey-uuid) = 4.2.3
+Provides: bundled(php-symfony-amqp-messenger) = v5.4.0
+Provides: bundled(php-symfony-cache) = v5.4.0
+Provides: bundled(php-symfony-cache-contracts) = v2.5.0
+Provides: bundled(php-symfony-config) = v5.4.0
+Provides: bundled(php-symfony-console) = v5.4.1
+Provides: bundled(php-symfony-dependency-injection) = v5.4.1
+Provides: bundled(php-symfony-deprecation-contracts) = v3.0.0
+Provides: bundled(php-symfony-doctrine-messenger) = v6.0.1
+Provides: bundled(php-symfony-event-dispatcher) = v5.4.0
+Provides: bundled(php-symfony-event-dispatcher-contracts) = v3.0.0
+Provides: bundled(php-symfony-filesystem) = v6.0.0
+Provides: bundled(php-symfony-finder) = v5.4.0
+Provides: bundled(php-symfony-messenger) = v5.4.0
+Provides: bundled(php-symfony-polyfill-ctype) = v1.23.0
+Provides: bundled(php-symfony-polyfill-intl-grapheme) = v1.23.1
+Provides: bundled(php-symfony-polyfill-intl-normalizer) = v1.23.0
+Provides: bundled(php-symfony-polyfill-mbstring) = v1.23.1
+Provides: bundled(php-symfony-polyfill-php72) = v1.23.0
+Provides: bundled(php-symfony-polyfill-php73) = v1.23.0
+Provides: bundled(php-symfony-polyfill-php80) = v1.23.1
+Provides: bundled(php-symfony-polyfill-php81) = v1.23.0
+Provides: bundled(php-symfony-process) = v5.4.0
+Provides: bundled(php-symfony-redis-messenger) = v6.0.1
+Provides: bundled(php-symfony-requirements-checker) = v2.0.1
+Provides: bundled(php-symfony-serializer) = v5.4.0
+Provides: bundled(php-symfony-service-contracts) = v2.4.1
+Provides: bundled(php-symfony-stopwatch) = v5.4.0
+Provides: bundled(php-symfony-string) = v6.0.1
+Provides: bundled(php-symfony-var-exporter) = v6.0.0
+
+Provides: phpcompatinfo = %{version}
+Provides: php-composer(bartlett/php-compatinfo) = %{version}
%description
@@ -154,116 +132,58 @@ Documentation: http://php5.laurent-laville.org/compatinfo/manual/current/en/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-
%patch0 -p1 -b .rpm
-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/Finder/autoload.php',
- '%{_datadir}/php/Symfony4/Component/Finder/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
-
-# Check package version
-FILE=src/Bartlett/CompatInfo/Console/Application.php
-#sed -e 's/5.5.1/#{version}/' -i $FILE
-grep " VERSION" $FILE
-grep %{version} $FILE
-
+# Gather all license files and cleanup tests
+mv vendor/composer/LICENSE composer_LICENSE
+for vendor in $(ls vendor)
+do
+ for proj in $(ls vendor/$vendor)
+ do
+ [ -d vendor/$vendor/$proj/tests ] && rm -r vendor/$vendor/$proj/tests
+ [ -f vendor/$vendor/$proj/LICENSE ] && mv vendor/$vendor/$proj/LICENSE ${vendor}_${proj}_LICENSE
+ done
+done
+rm -r tests
%build
# Nothing
%install
-mkdir -p %{buildroot}%{_datadir}/php
-cp -pr src/Bartlett %{buildroot}%{_datadir}/php/Bartlett
+mkdir -p %{buildroot}%{_datadir}
+cp -pr . %{buildroot}%{_datadir}/%{name}
+rm %{buildroot}%{_datadir}/%{name}/*LICENSE
-install -D -p -m 755 bin/phpcompatinfo %{buildroot}%{_bindir}/phpcompatinfo
-install -D -p -m 644 bin/phpcompatinfo.1 %{buildroot}%{_mandir}/man1/phpcompatinfo.1
+mkdir -p %{buildroot}%{_bindir}
+ln -s ../share/%{name}/bin/phpcompatinfo %{buildroot}%{_bindir}/phpcompatinfo
-install -D -p -m 755 %{SOURCE1} %{buildroot}%{_datadir}/%{name}/fedora-review-check
+mkdir -p %{buildroot}%{_mandir}/man1
+mv %{buildroot}%{_datadir}/%{name}/bin/phpcompatinfo.1 \
+ %{buildroot}%{_mandir}/man1/phpcompatinfo.1
+install -D -p -m 755 %{SOURCE1} %{buildroot}%{_datadir}/%{name}/fedora-review-check
-%if %{with tests}
-%check
-mkdir config
-cat << 'EOF' | tee config/bootstrap.php
-<?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}" php74 php80 php81; do
- if which $cmdarg; then
- set $cmdarg
- $1 ${2:-%{_bindir}/phpunit9} --verbose || ret=1
- fi
-done
-exit $ret
-%endif
-
-%post
-if [ -x %{_bindir}/pear ]; then
- %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
- bartlett.laurent-laville.org/PHP_CompatInfo >/dev/null || :
-fi
+%check
+%{buildroot}%{_bindir}/phpcompatinfo --version || grep %{version}
%files
# remirepo:1
%{!?_licensedir:%global license %%doc}
-%license LICENSE
-%doc composer.json README.*
+%license *LICENSE
+%doc README.*
%{_bindir}/phpcompatinfo
-%{_datadir}/php/Bartlett/CompatInfo
-%{_mandir}/man1/phpcompatinfo.1*
%{_datadir}/%{name}
+%{_mandir}/man1/phpcompatinfo.1*
%changelog
+* Mon Dec 13 2021 R7emi Collet <remi@remirepo.net> - 6.0.0-1
+- update to 6.0.0
+- use all PHP bundled libraries instead of system ones
+
* Fri Dec 10 2021 Remi Collet <remi@remirepo.net> - 5.5.4-1
- update to 5.5.4
- raise dependency on bartlett/php-compatinfo-db 3.6