diff options
Diffstat (limited to 'composer.spec')
-rw-r--r-- | composer.spec | 134 |
1 files changed, 92 insertions, 42 deletions
diff --git a/composer.spec b/composer.spec index 4d788f6..3b12ae5 100644 --- a/composer.spec +++ b/composer.spec @@ -10,23 +10,37 @@ # For compatibility with SCL %undefine __brp_mangle_shebangs -%global gh_commit 956608ea4f7de9e58c53dfb019d85ae62b193c39 +%global gh_commit fa90c099e9c402bcf83fa83d3276d160cf9986fe %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_branch 1.0-dev +%global gh_branch 2.0-dev %global gh_owner composer %global gh_project composer %global with_tests %{?_without_tests:0}%{!?_without_tests:1} -%global api_version 1.1.0 -%global run_version 1.0.0 +%global api_version 2.0.0 +%global run_version 2.0.0 -%global upstream_version 1.10.7 -#global upstream_prever RC +%global upstream_version 2.0.0 +%global upstream_prever alpha1 -%if 0 -# see https://forum.remirepo.net/viewtopic.php?id=3677 -%global symfony_prefix php-symfony3 +%if 0%{?fedora} >= 32 || 0%{?rhel} >=8 +%global symfony_prefix php-symfony4 +%global symfony_path %{_datadir}/php/Symfony4 +%global symfony_min 4.4 +%global _phpunit %{_bindir}/phpunit7 %else +# remirepo:1 +%if 0 %global symfony_prefix php-symfony +%global symfony_path %{_datadir}/php/Symfony +%global symfony_min 2.8 +%global _phpunit %{_bindir}/phpunit +# remirepo:6 +%else +%global symfony_prefix php-symfony3 +%global symfony_path %{_datadir}/php/Symfony3 +%global symfony_min 3.4 +%global _phpunit %{_bindir}/phpunit7 +%endif %endif Name: composer @@ -37,8 +51,6 @@ Summary: Dependency Manager for PHP License: MIT URL: https://getcomposer.org/ Source0: %{gh_project}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tgz -Source1: %{name}-autoload.php -Source2: %{name}-bootstrap.php # Profile scripts Source3: %{name}.sh Source4: %{name}.csh @@ -53,77 +65,82 @@ BuildRequires: php-cli %if %{with_tests} %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(composer/ca-bundle) >= 1.0 with php-composer(composer/ca-bundle) < 2) -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(composer/spdx-licenses) >= 1.2 with php-composer(composer/spdx-licenses) < 2) BuildRequires: (php-composer(composer/xdebug-handler) >= 1.1 with php-composer(composer/xdebug-handler) < 2) BuildRequires: (php-composer(seld/jsonlint) >= 1.4 with php-composer(seld/jsonlint) < 2) BuildRequires: (php-composer(seld/phar-utils) >= 1.0 with php-composer(seld/phar-utils) < 2) BuildRequires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2) BuildRequires: (php-composer(justinrainbow/json-schema) >= 5.2.10 with php-composer(justinrainbow/json-schema) < 6) +BuildRequires: (php-composer(react/promise) >= 2.7 with php-composer(react/promise) < 3) %else BuildRequires: php-composer-ca-bundle -BuildRequires: php-composer-semver +BuildRequires: php-composer-semver3 BuildRequires: php-composer-spdx-licenses >= 1.2 BuildRequires: php-composer-xdebug-handler >= 1.1 BuildRequires: php-jsonlint >= 1.4 BuildRequires: php-seld-phar-utils BuildRequires: php-PsrLog BuildRequires: php-justinrainbow-json-schema5 >= 5.2.10 +BuildRequires: php-react-promise >= 2.7 %endif -BuildRequires: %{symfony_prefix}-console -BuildRequires: %{symfony_prefix}-finder -BuildRequires: %{symfony_prefix}-filesystem -BuildRequires: %{symfony_prefix}-process +BuildRequires: %{symfony_prefix}-console >= %{symfony_min} +BuildRequires: %{symfony_prefix}-finder >= %{symfony_min} +BuildRequires: %{symfony_prefix}-filesystem >= %{symfony_min} +BuildRequires: %{symfony_prefix}-process >= %{symfony_min} BuildRequires: php-zip # From composer.json, "require-dev": { -# "symfony/phpunit-bridge": "^3.4", +# "symfony/phpunit-bridge": "^4.2 || ^5.0", # "phpspec/prophecy": "^1.10" -BuildRequires: phpunit +BuildRequires: %{_phpunit} # For autoloader -BuildRequires: php-composer(fedora/autoloader) >= 0.1.2 -BuildRequires: php-seld-phar-utils >= 1.0.1 -BuildRequires: php-PsrLog >= 1.0.0-8 +BuildRequires: php-fedora-autoloader-devel +BuildRequires: php-seld-phar-utils >= 1.1 +BuildRequires: php-PsrLog >= 1.1 %endif # From composer.json, "require": { # "php": "^5.3.2 || ^7.0", # "composer/ca-bundle": "^1.0", -# "composer/semver": "^1.0", +# "composer/semver": "^3.0", # "composer/spdx-licenses": "^1.2", # "composer/xdebug-handler": "^1.1", # "justinrainbow/json-schema": "^5.2.10", # "psr/log": "^1.0" # "seld/jsonlint": "~1.4", # "seld/phar-utils": "^1.0", -# "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", -# "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", -# "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", -# "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0", +# "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", +# "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", +# "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", +# "symfony/process": "^^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", +# "react/promise": "^1.2 || ^2.7" Requires: php(language) >= 5.3.2 Requires: php-cli %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(composer/ca-bundle) >= 1.0 with php-composer(composer/ca-bundle) < 2) -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(composer/spdx-licenses) >= 1.2 with php-composer(composer/spdx-licenses) < 2) Requires: (php-composer(composer/xdebug-handler) >= 1.1 with php-composer(composer/xdebug-handler) < 2) Requires: (php-composer(seld/jsonlint) >= 1.4 with php-composer(seld/jsonlint) < 2) Requires: (php-composer(seld/phar-utils) >= 1.0 with php-composer(seld/phar-utils) < 2) Requires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2) Requires: (php-composer(justinrainbow/json-schema) >= 5.2.10 with php-composer(justinrainbow/json-schema) < 6) +Requires: (php-composer(react/promise) >= 2.7 with php-composer(react/promise) < 3) %else Requires: php-composer-ca-bundle -Requires: php-composer-semver +Requires: php-composer-semver3 Requires: php-composer-spdx-licenses >= 1.2 Requires: php-composer-xdebug-handler >= 1.1 Requires: php-jsonlint >= 1.4 Requires: php-seld-phar-utils Requires: php-PsrLog Requires: php-justinrainbow-json-schema5 >= 5.2.10 +Requires: php-react-promise >= 2.7 %endif -Requires: %{symfony_prefix}-console -Requires: %{symfony_prefix}-finder -Requires: %{symfony_prefix}-process -Requires: %{symfony_prefix}-filesystem +Requires: %{symfony_prefix}-console >= %{symfony_min} +Requires: %{symfony_prefix}-finder >= %{symfony_min} +Requires: %{symfony_prefix}-process >= %{symfony_min} +Requires: %{symfony_prefix}-filesystem >= %{symfony_min} # From composer.json, suggest # "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", # "ext-zip": "Enabling the zip extension allows you to unzip archives", @@ -133,12 +150,12 @@ Requires: php-zip Requires: php-zlib # For our autoloader Requires: php-composer(fedora/autoloader) -Requires: php-seld-phar-utils >= 1.0.1 -Requires: php-PsrLog >= 1.0.0-8 -# From phpcompatinfo +Requires: php-seld-phar-utils >= 1.1 +Requires: php-PsrLog >= 1.1 +# From phpcompatinfo for version 2.0.0 +Requires: php-ctype Requires: php-curl Requires: php-date -Requires: php-dom Requires: php-filter Requires: php-hash Requires: php-iconv @@ -146,10 +163,11 @@ Requires: php-intl Requires: php-json Requires: php-libxml Requires: php-mbstring +Requires: php-pcntl Requires: php-pcre Requires: php-phar +Requires: php-posix Requires: php-reflection -Requires: php-simplexml Requires: php-spl Requires: php-tokenizer Requires: php-xsl @@ -180,10 +198,35 @@ if grep -r '\.\./res'; then exit 1 fi -cp -p %{SOURCE1} src/Composer/autoload.php -cp -p %{SOURCE2} tests/bootstrap.php +phpab --template fedora --output src/Composer/autoload.php src/Composer +cat << 'EOF' | tee -a src/Composer/autoload.php + +\Fedora\Autoloader\Dependencies::required([ + '%{symfony_path}/Component/Console/autoload.php', + '%{symfony_path}/Component/Finder/autoload.php', + '%{symfony_path}/Component/Process/autoload.php', + '%{symfony_path}/Component/Filesystem/autoload.php', + '%{_datadir}/php/Seld/JsonLint/autoload.php', + '%{_datadir}/php/Seld/PharUtils/autoload.php', + '%{_datadir}/php/Composer/CaBundle/autoload.php', + '%{_datadir}/php/Composer/Spdx/autoload.php', + '%{_datadir}/php/Composer/Semver3/autoload.php', + '%{_datadir}/php/Composer/XdebugHandler/autoload.php', + '%{_datadir}/php/Psr/Log/autoload.php', + '%{_datadir}/php/JsonSchema5/autoload.php', + '%{_datadir}/php/React/Promise/autoload.php', +]); +EOF + +cat << 'EOF' | tee tests/bootstrap.php +<?php +require 'Composer/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr0('Composer\\Test\\', __DIR__ . '/'); +EOF + rm src/bootstrap.php + : fix reported version %if 0%{?gh_date} DATE=%{gh_date} @@ -206,7 +249,7 @@ if (version_compare(Plugin\PluginInterface::PLUGIN_API_VERSION, "%{api_version}" exit(1); } if (version_compare(Composer::RUNTIME_API_VERSION, "%{run_version}")) { - printf("Plugin API version is %s, expected %s\n", Composer::RUNTIME_API_VERSION, "%{run_version}"); + printf("Runtime API version is %s, expected %s\n", Composer::RUNTIME_API_VERSION, "%{run_version}"); exit(1); }' @@ -254,7 +297,7 @@ export BUILDROOT=%{buildroot} ret=0 for cmd in php php72 php73 php74; do if which $cmd; then - $cmd -d memory_limit=1G %{_bindir}/phpunit \ + $cmd -d memory_limit=1G %{_phpunit} \ --filter '^((?!(testIntegration)).)*$' \ --include-path %{buildroot}%{_datadir}/php || ret=1 fi @@ -277,6 +320,13 @@ exit $ret %changelog +* Wed Jun 3 2020 Remi Collet <remi@remirepo.net> - 2.0.0~alpha1-1 +- update to 2.0.0-alpha1 +- switch to Symfony 4 +- switch to phpunit7 +- raise dependency on composer/semver 3 +- add dependency on react/promise 2.7 + * Wed Jun 3 2020 Remi Collet <remi@remirepo.net> - 1.10.7-1 - update to 1.10.7 - raise dependency on justinrainbow/json-schema 5.2.10 |