From 0432bbbc3be0499b86f055c3e437a72419e9d75f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 26 Jan 2021 17:19:34 +0100 Subject: add upstream patch for recent Symfony version switch to Symfony 3 (EL-7) or Symfony 4 switch to phpunit9 --- composer.spec | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) (limited to 'composer.spec') diff --git a/composer.spec b/composer.spec index 21ad68d..035db42 100644 --- a/composer.spec +++ b/composer.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for composer # -# Copyright (c) 2015-2020 Remi Collet +# Copyright (c) 2015-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -23,21 +23,23 @@ #global upstream_prever RC2 #global upstream_lower rc2 -%global symfony_prefix php-symfony -%global symfony_path %{_datadir}/php/Symfony -%global symfony_min 2.8 - # remirepo:1 -%if 0 -%global _phpunit %{_bindir}/phpunit -# remirepo:3 +%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8 +%global symfony_prefix php-symfony4 +%global symfony_path %{_datadir}/php/Symfony4 +%global symfony_min 4.4 +# remirepo:5 %else -%global _phpunit %{_bindir}/phpunit7 +%global symfony_prefix php-symfony3 +%global symfony_path %{_datadir}/php/Symfony3 +%global symfony_min 3.4.35 %endif +%global _phpunit %{_bindir}/phpunit9 + Name: composer Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: Dependency Manager for PHP License: MIT @@ -51,6 +53,8 @@ Source5: makesrc.sh # Use our autoloader, resources path, fix for tests Patch0: %{name}-rpm.patch +# Upstream for Symfony4 +Patch1: %{name}-sym4.patch BuildArch: noarch BuildRequires: php-cli @@ -183,7 +187,8 @@ Documentation: https://getcomposer.org/doc/ %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .rpm -find . -name \*.rpm -exec rm {} \; -print +find . -name \*.rpm -delete -print +%patch1 -p1 if grep -r '\.\./res'; then : Patch need to fixed @@ -254,10 +259,6 @@ if (version_compare(Composer::RUNTIME_API_VERSION, "%{run_version}")) { : Profile scripts mkdir -p %{buildroot}%{_sysconfdir}/profile.d install -m 644 %{SOURCE3} %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/ -# remirepo:3 -%if 0%{?rhel} == 6 -sed -e 's/euid/uid/' -i %{buildroot}%{_sysconfdir}/profile.d/composer.csh -%endif : Library mkdir -p %{buildroot}%{_datadir}/php @@ -285,15 +286,20 @@ rm -rf res : Run test suite export BUILDROOT=%{buildroot} -%if 0%{?rhel} == 6 -FILTER="--filter '^((?!(testIntegration|testArchiveCustomFileName|testArchiveTar)).)*$'" -%else FILTER="--filter '^((?!(testIntegration)).)*$'" -%endif + +# Adapt for phunit9 +find tests \ + -name \*.php \ + -exec sed -e '/function setUpBeforeClass(/s/$/:void/' \ + -e '/function tearDownAfterClass(/s/$/:void/' \ + -e '/function setUp(/s/$/:void/' \ + -e '/function tearDown(/s/$/:void/' \ + -i {} \; # testIntegration may hang on local build ret=0 -for cmd in php php72 php73 php74; do +for cmd in php php73 php74 php80; do if which $cmd; then $cmd -d memory_limit=1G %{_phpunit} \ $FILTER \ @@ -318,6 +324,11 @@ exit $ret %changelog +* Tue Jan 26 2021 Remi Collet - 2.0.8-2 +- add upstream patch for recent Symfony version +- switch to Symfony 3 (EL-7) or Symfony 4 +- switch to phpunit9 + * Fri Dec 4 2020 Remi Collet - 2.0.8-1 - update to 2.0.8 -- cgit