summaryrefslogtreecommitdiffstats
path: root/php-aura-di.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-aura-di.spec')
-rw-r--r--php-aura-di.spec37
1 files changed, 30 insertions, 7 deletions
diff --git a/php-aura-di.spec b/php-aura-di.spec
index 636fe57..f7047e9 100644
--- a/php-aura-di.spec
+++ b/php-aura-di.spec
@@ -1,11 +1,14 @@
# remirepo/Fedora spec file for php-aura-di
#
-# Copyright (c) 2015-2017 Remi Collet
+# Copyright (c) 2015-2021 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
+
+%bcond_without tests
+
%global bootstrap 0
%global gh_commit f676b38a0d1c3b0d7897b0a082f4811eb8b08faa
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
@@ -16,11 +19,10 @@
%global ns_owner Aura
%global ns_project Di
%global php_home %{_datadir}/php
-%global with_tests 0%{!?_without_tests:1}
Name: php-%{pk_owner}-%{pk_project}
Version: 3.4.0
-Release: 1%{?dist}
+Release: 9%{?dist}
Summary: A serializable dependency injection container
Group: Development/Libraries
@@ -28,12 +30,21 @@ License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
+# Minimal patch for PHP 8
+Patch0: %{name}-php8.patch
+
BuildArch: noarch
BuildRequires: php-composer(fedora/autoloader)
# Tests
-%if %{with_tests}
+%if %{with tests}
BuildRequires: php(language) >= 5.5.0
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(container-interop/container-interop) >= 1.0 with php-composer(container-interop/container-interop) < 2)
+# remirepo:4
+%else
+BuildRequires: php-composer(container-interop/container-interop) < 2
BuildRequires: php-composer(container-interop/container-interop) >= 1.0
+%endif
BuildRequires: php-reflection
BuildRequires: php-spl
BuildRequires: php-composer(phpunit/phpunit)
@@ -47,8 +58,14 @@ BuildRequires: php-composer(phpunit/phpunit)
# "php": ">=5.5.0"
# "container-interop/container-interop": "~1.0"
Requires: php(language) >= 5.5.0
-Requires: php-composer(container-interop/container-interop) >= 1.0
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(container-interop/container-interop) >= 1.0 with php-composer(container-interop/container-interop) < 2)
+# remirepo:4
+%else
Requires: php-composer(container-interop/container-interop) < 2
+Requires: php-composer(container-interop/container-interop) >= 1.0
+%endif
# From phpcompatinfo report for version 3.2.0
Requires: php-reflection
Requires: php-spl
@@ -69,6 +86,7 @@ Autoloader: %{php_home}/%{ns_owner}/%{ns_project}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+%patch0 -p1
%build
@@ -90,7 +108,7 @@ cp -pr src %{buildroot}%{php_home}/%{ns_owner}/%{ns_project}
%check
-%if %{with_tests}
+%if %{with tests}
: Ignore test using not available dependency
rm tests/ContainerTest.php
@@ -102,7 +120,7 @@ require '%{buildroot}/%{php_home}/%{ns_owner}/%{ns_project}/autoload.php';
EOF
ret=0
-for cmd in php php56 php70 php71 php72; do
+for cmd in php php73 php74 php80; do
if which $cmd; then
$cmd %{_bindir}/phpunit --verbose || ret=1
fi
@@ -114,6 +132,7 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -123,6 +142,10 @@ exit $ret
%changelog
+* Wed Mar 31 2021 Remi Collet <remi@remirepo.net> - 3.4.0-9
+- add minimal fix for PHP 8
+- use range dependencies
+
* Tue Aug 8 2017 Remi Collet <remi@remirepo.net> - 3.4.0-1
- Update to 3.4.0