From a5e8c7be0f57b24ff3e34831332579104898678a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 17 Jun 2019 15:42:43 +0200 Subject: v2.0.0 from Fedora --- php-di-invoker.spec | 64 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 26 deletions(-) (limited to 'php-di-invoker.spec') diff --git a/php-di-invoker.spec b/php-di-invoker.spec index 0a46ab8..2a1d4dd 100644 --- a/php-di-invoker.spec +++ b/php-di-invoker.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-di-invoker # -# Copyright (c) 2016-2017 Shawn Iwinski +# Copyright (c) 2016-2019 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -12,15 +12,15 @@ %global github_owner PHP-DI %global github_name Invoker -%global github_version 1.3.3 -%global github_commit 1f4ca63b9abc66109e53b255e465d0ddb5c2e3f7 +%global github_version 2.0.0 +%global github_commit 540c27c86f663e20fe39a24cd72fa76cdb21d41a %global composer_vendor php-di %global composer_project invoker -# "container-interop/container-interop": "~1.1" -%global container_interop_min_ver 1.1 -%global container_interop_max_ver 2.0 +# "psr/container": "~1.0" +%global psr_container_min_ver 1.0 +%global psr_container_max_ver 2.0 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} @@ -29,10 +29,9 @@ Name: %{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 3%{?github_release}%{?dist} +Release: 1%{?github_release}%{?dist} Summary: Generic and extensible callable invoker -Group: Development/Libraries License: MIT URL: https://github.com/%{github_owner}/%{github_name} @@ -45,9 +44,14 @@ BuildArch: noarch # Tests %if %{with_tests} ## composer.json -BuildRequires: php-composer(container-interop/container-interop) >= %{container_interop_min_ver} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(psr/container) >= %{psr_container_min_ver} with php-composer(psr/container) < %{psr_container_max_ver}) +%else +BuildRequires: php-composer(psr/container) < %{psr_container_max_ver} +BuildRequires: php-composer(psr/container) >= %{psr_container_min_ver} +%endif BuildRequires: php-composer(phpunit/phpunit) -## phpcompatinfo (computed from version 1.3.3) +## phpcompatinfo (computed from version 2.0.0) BuildRequires: php(language) >= 5.3.0 BuildRequires: php-reflection ## Autoloader @@ -55,16 +59,20 @@ BuildRequires: php-composer(fedora/autoloader) %endif # composer.json -Requires: php-composer(container-interop/container-interop) >= %{container_interop_min_ver} -Requires: php-composer(container-interop/container-interop) < %{container_interop_max_ver} -# phpcompatinfo (computed from version 1.3.3) +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(psr/container) >= %{psr_container_min_ver} with php-composer(psr/container) < %{psr_container_max_ver}) +%else +Requires: php-composer(psr/container) >= %{psr_container_min_ver} +Requires: php-composer(psr/container) < %{psr_container_max_ver} +%endif +# phpcompatinfo (computed from version 2.0.0) Requires: php(language) >= 5.3.0 Requires: php-reflection # Autoloader Requires: php-composer(fedora/autoloader) # php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT} -Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release} +Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release} # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -85,16 +93,14 @@ cat <<'AUTOLOAD' | tee src/autoload.php /** * Autoloader for %{name} and its' dependencies * (created by %{name}-%{version}-%{release}). - * */ - require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('Invoker\\', __DIR__); -// Required dependency -require_once '%{phpdir}/Interop/Container/autoload.php'; - +\Fedora\Autoloader\Dependencies::required([ + '%{phpdir}/Psr/Container/autoload.php', +]); AUTOLOAD @@ -112,14 +118,16 @@ require_once '%{buildroot}%{phpdir}/Invoker/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('Invoker\\Test\\', __DIR__.'/tests'); BOOTSTRAP -: Run tests -ret=0 -for cmd in php php56 php70 php71 php72; do - if which $cmd; then - $cmd %{_bindir}/phpunit --verbose --bootstrap bootstrap.php || ret=1 - fi +: Upstream tests +RETURN_CODE=0 +PHPUNIT=$(which phpunit) +for PHP_EXEC in "" %{?rhel:php55} php56 php70 php71 php72 php73 php74; do + if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then + $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \ + || RETURN_CODE=1 + fi done -exit $ret +exit $RETURN_CODE %else : Tests skipped %endif @@ -134,6 +142,10 @@ exit $ret %changelog +* Sun May 26 2019 Shawn Iwinski - 2.0.0-1 +- Update to 2.0.0 (RHBZ #1434817) +- Add range version dependencies for Fedora >= 27 || RHEL >= 8 + * Wed May 10 2017 Valentin Collet - 1.3.3-3 - Switch to fedora/autoloader -- cgit