diff options
Diffstat (limited to 'php-guzzlehttp-psr7.spec')
-rw-r--r-- | php-guzzlehttp-psr7.spec | 87 |
1 files changed, 72 insertions, 15 deletions
diff --git a/php-guzzlehttp-psr7.spec b/php-guzzlehttp-psr7.spec index 660c05a..b5bc593 100644 --- a/php-guzzlehttp-psr7.spec +++ b/php-guzzlehttp-psr7.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-guzzlehttp-psr7 # -# Copyright (c) 2015-2017 Shawn Iwinski <shawn.iwinski@gmail.com> +# Copyright (c) 2015-2019 Shawn Iwinski <shawn.iwinski@gmail.com> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,8 @@ %global github_owner guzzle %global github_name psr7 -%global github_version 1.4.2 -%global github_commit f5b8a8512e2b58b0071a7280e39f14f72e05d87c +%global github_version 1.6.1 +%global github_commit 239400de7a173fe9901b9ac7c06497751f00727a %global composer_vendor guzzlehttp %global composer_project psr7 @@ -23,10 +23,29 @@ # "psr/http-message": "~1.0" %global psr_http_message_min_ver 1.0 %global psr_http_message_max_ver 2.0 +# "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" +%global ralouphie_getallheaders_min_ver 2.0.5 +%global ralouphie_getallheaders_max_ver 4.0 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} +# Range dependencies supported? +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global with_range_dependencies 1 +%else +%global with_range_dependencies 0 +%endif + +# PHPUnit +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global phpunit_require phpunit6 +%global phpunit_exec phpunit6 +%else +%global phpunit_require php-composer(phpunit/phpunit) +%global phpunit_exec phpunit +%endif + %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} @@ -34,7 +53,6 @@ Version: %{github_version} Release: 1%{?github_release}%{?dist} Summary: PSR-7 message implementation -Group: Development/Libraries License: MIT URL: https://github.com/%{github_owner}/%{github_name} @@ -48,24 +66,43 @@ BuildArch: noarch %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: php-zlib +BuildRequires: %{phpunit_require} +%if %{with_range_dependencies} +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(ralouphie/getallheaders) >= %{ralouphie_getallheaders_min_ver} with php-composer(ralouphie/getallheaders) < %{ralouphie_getallheaders_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} -## phpcompatinfo (computed from version 1.4.2) +BuildRequires: php-composer(ralouphie/getallheaders) < %{ralouphie_getallheaders_max_ver} +BuildRequires: php-composer(ralouphie/getallheaders) >= %{ralouphie_getallheaders_min_ver} +%endif +## phpcompatinfo (computed from version 1.6.1) +BuildRequires: php-filter BuildRequires: php-hash +BuildRequires: php-libxml BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl -BuildRequires: php-zlib +BuildRequires: php-xmlreader +BuildRequires: php-xmlwriter ## Autoloader BuildRequires: php-composer(fedora/autoloader) %endif # composer.json Requires: php(language) >= %{php_min_ver} +%if %{with_range_dependencies} +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(ralouphie/getallheaders) >= %{ralouphie_getallheaders_min_ver} with php-composer(ralouphie/getallheaders) < %{ralouphie_getallheaders_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} -# phpcompatinfo (computed from version 1.4.2) +Requires: php-composer(ralouphie/getallheaders) < %{ralouphie_getallheaders_max_ver} +Requires: php-composer(ralouphie/getallheaders) >= %{ralouphie_getallheaders_min_ver} +%endif +# phpcompatinfo (computed from version 1.6.1) +Requires: php-filter Requires: php-hash Requires: php-pcre Requires: php-spl @@ -80,6 +117,8 @@ Provides: php-composer(psr/http-message-implementation) = 1.0 PSR-7 message implementation, several stream decorators, and some helpful functionality like query string parsing. +Autoloader: %{phpdir}/GuzzleHttp/Psr7/autoload.php + %prep %setup -qn %{github_name}-%{github_commit} @@ -96,27 +135,40 @@ cat <<'AUTOLOAD' | tee src/autoload.php require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('GuzzleHttp\\Psr7\\', __DIR__); -require_once __DIR__.'/functions_include.php'; \Fedora\Autoloader\Dependencies::required([ + __DIR__.'/functions_include.php', '%{phpdir}/Psr/Http/Message/autoload.php', + '%{phpdir}/ralouphie-getallheaders/autoload.php', ]); AUTOLOAD %install -mkdir -p %{buildroot}%{phpdir}/GuzzleHttp/Psr7 -cp -rp src/* %{buildroot}%{phpdir}/GuzzleHttp/Psr7/ +mkdir -p %{buildroot}%{phpdir}/GuzzleHttp +cp -rp src %{buildroot}%{phpdir}/GuzzleHttp/Psr7 %check %if %{with_tests} +: Create tests bootstrap +cat <<'BOOTSTRAP' | tee bootstrap.php +<?php +require '%{buildroot}%{phpdir}/GuzzleHttp/Psr7/autoload.php'; + +\Fedora\Autoloader\Autoload::addPsr4('GuzzleHttp\\Tests\\Psr7\\', __DIR__.'/tests'); + +if (!class_exists('PHPUnit\\Framework\\Error\\Warning')) { + class_alias('PHPUnit_Framework_Error_Warning', 'PHPUnit\\Framework\\Error\\Warning'); +} +BOOTSTRAP + : Upstream tests RETURN_CODE=0 -for PHP_EXEC in php %{?rhel:php55} php56 php70 php71; do - if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then - $PHP_EXEC %{_bindir}/phpunit --verbose \ - --bootstrap %{buildroot}%{phpdir}/GuzzleHttp/Psr7/autoload.php \ +PHPUNIT=$(which %{phpunit_exec}) +for PHP_EXEC in "" %{?rhel:php55 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 @@ -136,6 +188,11 @@ exit $RETURN_CODE %changelog +* Tue Dec 17 2019 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.6.1-1 +- Update to 1.6.1 (RHBZ #1727190) +- Conditionally use range dependencies +- Conditionally use PHPUnit 6 + * Sat Apr 08 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.4.2-1 - Updated to 1.4.2 (RHBZ #1434198) - Don't use autoloader to load functions include |