summaryrefslogtreecommitdiffstats
path: root/php-symfony-psr-http-message-bridge.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-symfony-psr-http-message-bridge.spec')
-rw-r--r--php-symfony-psr-http-message-bridge.spec62
1 files changed, 42 insertions, 20 deletions
diff --git a/php-symfony-psr-http-message-bridge.spec b/php-symfony-psr-http-message-bridge.spec
index aed1ecc..d8ab02f 100644
--- a/php-symfony-psr-http-message-bridge.spec
+++ b/php-symfony-psr-http-message-bridge.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-symfony-psr-http-message-bridge
#
-# Copyright (c) 2015-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2015-2018 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,8 +12,8 @@
%global github_owner symfony
%global github_name psr-http-message-bridge
-%global github_version 1.0.0
-%global github_commit 66085f246d3893cbdbcec5f5ad15ac60546cf0de
+%global github_version 1.0.2
+%global github_commit c2b757934f2d9681a287e662efbc27c41fe8ef86
%global composer_vendor symfony
%global composer_project psr-http-message-bridge
@@ -23,10 +23,14 @@
# "psr/http-message": "~1.0"
%global psr_http_message_min_ver 1.0
%global psr_http_message_max_ver 2.0
-# "symfony/http-foundation": "~2.3|~3.0"
+# "symfony/http-foundation": "~2.3|~3.0|~4.0"
# NOTE: Min version not 2.3 because autoloader required
%global symfony_min_ver %{?el6:2.3.31}%{!?el6:2.7.1}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+%global symfony_max_ver 5.0
+%else
%global symfony_max_ver 4.0
+%endif
%global with_zend_diactoros 0%{!?el6:1}
@@ -37,7 +41,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 3%{?github_release}%{?dist}
+Release: 2%{?github_release}%{?dist}
Summary: Symfony PSR HTTP message bridge
Group: Development/Libraries
@@ -45,10 +49,6 @@ License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
-# Fix test suite with !el6 and zendframework/zend-diactoros
-# https://github.com/symfony/psr-http-message-bridge/pull/31
-Patch0: %{name}-upstream-pull-31.patch
-
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -58,11 +58,15 @@ BuildRequires: php-composer(zendframework/zend-diactoros)
BuildRequires: php-composer(phpunit/phpunit)
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(psr/http-message) >= %{psr_http_message_min_ver} with php-composer(psr/http-message) < %{psr_http_message_max_ver})
+BuildRequires: (php-composer(symfony/http-foundation) >= %{symfony_min_ver} with php-composer(symfony/http-foundation) < %{symfony_max_ver})
+%else
BuildRequires: php-composer(psr/http-message) < %{psr_http_message_max_ver}
BuildRequires: php-composer(psr/http-message) >= %{psr_http_message_min_ver}
BuildRequires: php-composer(symfony/http-foundation) < %{symfony_max_ver}
-BuildRequires: php-composer(symfony/http-foundation) >= %{symfony_min_ver}
-## phpcompatinfo (computed from version 1.0.0)
+%endif
+## phpcompatinfo (computed from version 1.0.2)
BuildRequires: php-date
BuildRequires: php-reflection
BuildRequires: php-spl
@@ -72,11 +76,15 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(psr/http-message) >= %{psr_http_message_min_ver} with php-composer(psr/http-message) < %{psr_http_message_max_ver})
+Requires: (php-composer(symfony/http-foundation) >= %{symfony_min_ver} with php-composer(symfony/http-foundation) < %{symfony_max_ver})
+%else
Requires: php-composer(psr/http-message) < %{psr_http_message_max_ver}
Requires: php-composer(psr/http-message) >= %{psr_http_message_min_ver}
Requires: php-composer(symfony/http-foundation) < %{symfony_max_ver}
-Requires: php-composer(symfony/http-foundation) >= %{symfony_min_ver}
-# phpcompatinfo (computed from version 1.0.0)
+%endif
+# phpcompatinfo (computed from version 1.0.2)
Requires: php-date
Requires: php-spl
# Autoloader
@@ -102,10 +110,6 @@ Autoloader: %{phpdir}/Symfony/Bridge/PsrHttpMessage/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
-%if 0%{!?el6:1}
-%patch0 -p1
-%endif
-
%build
: Create autoloader
@@ -122,6 +126,7 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Psr/Http/Message/autoload.php',
array(
+ '%{phpdir}/Symfony4/Component/HttpFoundation/autoload.php',
'%{phpdir}/Symfony3/Component/HttpFoundation/autoload.php',
'%{phpdir}/Symfony/Component/HttpFoundation/autoload.php',
),
@@ -145,13 +150,21 @@ cp -rp *.php Factory Tests %{buildroot}%{phpdir}/Symfony/Bridge/PsrHttpMessage/
%check
%if %{with_tests}
+: Create tests bootstrap
+cat <<'BOOTSTRAP' | tee -a bootstrap.php
+<?php
+require_once '%{buildroot}%{phpdir}/Symfony/Bridge/PsrHttpMessage/autoload.php';
+if (!class_exists('PHPUnit\\Framework\\TestCase')) {
+ class_alias('PHPUnit_Framework_TestCase', 'PHPUnit\\Framework\\TestCase');
+}
+BOOTSTRAP
+
: Upstream tests
RETURN_CODE=0
PHPUNIT=$(which phpunit)
-for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do
+for PHP_EXEC in "" %{?rhel:php54 php55 php56 php70} php71 php72; do
if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
- $PHP_EXEC $PHPUNIT --verbose \
- --bootstrap %{buildroot}%{phpdir}/Symfony/Bridge/PsrHttpMessage/autoload.php \
+ $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \
|| RETURN_CODE=1
fi
done
@@ -171,6 +184,15 @@ exit $RETURN_CODE
%changelog
+* Sun Apr 22 2018 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.2-2
+- Fix el6 tests
+
+* Sun Apr 22 2018 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.2-1
+- Update to 1.0.2 (RHBZ #1528620)
+- Add range version dependencies for Fedora >= 27 || RHEL >= 8
+- Add composer.json to repo
+- Remove tests' patch
+
* Thu Sep 21 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.0-3
- Allow Symfony 3
- Modify tests