summaryrefslogtreecommitdiffstats
path: root/php-di-invoker.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-06-17 15:42:43 +0200
committerRemi Collet <remi@remirepo.net>2019-06-17 15:42:43 +0200
commita5e8c7be0f57b24ff3e34831332579104898678a (patch)
treef03d6ddc27e7a5d1209d11c1184ba73b527f7fc0 /php-di-invoker.spec
parent46297d447b787f8ae35c1da68d2cb433d28beea5 (diff)
v2.0.0 from Fedora
Diffstat (limited to 'php-di-invoker.spec')
-rw-r--r--php-di-invoker.spec64
1 files changed, 38 insertions, 26 deletions
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 <shawn@iwin.ski>
+# Copyright (c) 2016-2019 Shawn Iwinski <shawn@iwin.ski>
#
# 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 <shawn@iwin.ski> - 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 <valentin@famillecollet.com> - 1.3.3-3
- Switch to fedora/autoloader