summaryrefslogtreecommitdiffstats
path: root/php-laminas-diactoros2.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-01-22 16:55:03 +0100
committerRemi Collet <remi@remirepo.net>2020-01-22 16:55:03 +0100
commitccdc145b40fd4348eceeaf216e7d3f5f53fc9743 (patch)
tree20433f56eecd40762b445fe2c44e4e4cbcdd180f /php-laminas-diactoros2.spec
parent9c333de9a253daf8405a1abb4333d0961e382bdb (diff)
update to 2.2.2
rename to php-laminas-diactoros2 install to /usr/share/php/Laminas/Diactoros2 raise dependency on PHP 7.1 add dependency on psr/http-factory switch to phpunit7
Diffstat (limited to 'php-laminas-diactoros2.spec')
-rw-r--r--php-laminas-diactoros2.spec118
1 files changed, 71 insertions, 47 deletions
diff --git a/php-laminas-diactoros2.spec b/php-laminas-diactoros2.spec
index 4b71c84..3165b15 100644
--- a/php-laminas-diactoros2.spec
+++ b/php-laminas-diactoros2.spec
@@ -11,33 +11,35 @@
%global gh_owner laminas
%global gh_project laminas-diactoros
%global zf_name zend-diactoros
-%global gh_commit 56a9aca1f89231763d24d2ae13531b97fa5f4029
+%global gh_commit 95178c4751d737cdf9ab0a9f70a42754ac860e7b
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global php_home %{_datadir}/php
%global namespace Laminas
%global library Diactoros
+%global major 2
+
%global gh_psr7_owner php-http
%global gh_psr7_name psr7-integration-tests
-%global gh_psr7_version 0
-%global gh_psr7_commit 5dfefb2da33ca24ae20c971b725c9a6fe7403008
+%global gh_psr7_version 1.0.0
+%global gh_psr7_commit c3bb79ca4a276df57364ff45bf2f619f769ded4a
%global gh_psr7_short %(c=%{gh_psr7_commit}; echo ${c:0:7})
-# "php": "^5.6 || ^7.0"
-%global php_min_ver 5.6
-# "psr/http-message": "^1.0"
-%global psr_http_message_min_ver 1.0
-%global psr_http_message_max_ver 2.0
+%global gh_factory_owner http-interop
+%global gh_factory_name http-factory-tests
+%global gh_factory_version 0.5.0
+%global gh_factory_commit 3c6c62052daeb67ca7dc3e1ea1b72c0f0cc19070
+%global gh_factory_short %(c=%{gh_factory_commit}; echo ${c:0:7})
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
%{!?phpdir: %global phpdir %{_datadir}/php}
-Name: php-%{gh_project}
-Version: 1.8.7p1
-Release: 2%{?gh_release}%{?dist}
-Summary: PSR HTTP Message implementations
+Name: php-%{gh_project}%{major}
+Version: 2.2.2
+Release: 1%{?gh_release}%{?dist}
+Summary: PSR HTTP Message implementations v%{major}
License: BSD
URL: https://github.com/%{gh_owner}/%{gh_project}
@@ -46,33 +48,43 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
# Run makesrc.sh to create full source.
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
-# Temporarily bundled, no release, only used for tests
+# Temporarily bundled, only used for tests
Source2: %{gh_psr7_owner}-%{gh_psr7_name}-%{gh_psr7_version}-%{gh_psr7_short}.tgz
Source3: %{gh_psr7_owner}-%{gh_psr7_name}-get-source.sh
+# Temporarily bundled, only used for tests
+Source4: php-%{gh_factory_owner}-%{gh_factory_name}-%{gh_factory_version}-%{gh_factory_short}.tgz
+Source5: php-%{gh_factory_owner}-%{gh_factory_name}-get-source.sh
BuildArch: noarch
# Tests
%if %{with_tests}
## composer.json
-BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php(language) >= 7.1
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2)
-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(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 2)
+BuildRequires: (php-composer(psr/http-factory) >= 1.0 with php-composer(psr/http-factory) < 2)
# remirepo:4
%else
BuildRequires: php-laminas-zendframework-bridge
BuildRequires: php-psr-http-message
+BuildRequires: php-psr-http-factory
%endif
-%global phpunit %{_bindir}/phpunit6
-BuildRequires: %{phpunit}
+# "require-dev": {
+# "ext-curl": "*",
+# "ext-dom": "*",
+# "ext-libxml": "*",
+# "http-interop/http-factory-tests": "^0.5.0",
+# "laminas/laminas-coding-standard": "~1.0.0",
+# "php-http/psr7-integration-tests": "dev-master",
+# "phpunit/phpunit": "^7.5.18"
+# },
+%global phpunit %{_bindir}/phpunit7
+BuildRequires: phpunit7 >= 7.5.18
BuildRequires: php-dom
BuildRequires: php-libxml
-## phpcompatinfo (computed from version 1.8.7p1)
-### NOTE: curl, gd, gmp, and shmop are all optional for
-### LaminasTest\Diactoros\StreamTest::getResourceFor67()
-### (test/StreamTest.php) but the first one found wins
-### so only curl is chosen as a requirement here.
+## phpcompatinfo (computed from version 2.2.2)
BuildRequires: php-curl
BuildRequires: php-dom
BuildRequires: php-json
@@ -86,31 +98,37 @@ BuildRequires: php-spl
BuildRequires: php-fedora-autoloader-devel
# composer.json
-Requires: php(language) >= %{php_min_ver}
+# "require": {
+# "php": "^7.1",
+# "laminas/laminas-zendframework-bridge": "^1.0",
+# "psr/http-factory": "^1.0",
+# "psr/http-message": "^1.0"
+Requires: php(language) >= 7.1
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2)
-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(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 2)
+Requires: (php-composer(psr/http-factory) >= 1.0 with php-composer(psr/http-factory) < 2)
# remirepo:4
%else
Requires: php-laminas-zendframework-bridge
Requires: php-psr-http-message
+Requires: php-psr-http-factory
%endif
-# phpcompatinfo (computed from version 1.8.7p1)
+# phpcompatinfo (computed from version 2.2.2)
Requires: php-json
Requires: php-pcre
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
-# Composer
# Compatibily ensure by the bridge
-Obsoletes: php-zendframework-%{zf_name} < 1.8.7p1
-Provides: php-zendframework-%{zf_name} = %{version}
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
Provides: php-composer(zendframework/%{zf_name}) = %{version}
Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
Provides: php-autoloader(zendframework/%{zf_name}) = %{version}
+
+Provides: php-composer(psr/http-factory-implementation) = 1.0
Provides: php-composer(psr/http-message-implementation) = 1.0
@@ -121,16 +139,17 @@ http.Server [2].
Documentation: https://docs.laminas.dev/%{gh_project}/
-Autoloader: %{phpdir}/%{namespace}/Diactoros/autoload.php
+Autoloader: %{phpdir}/%{namespace}/%{library}%{major}/autoload.php
[1] http://www.php-fig.org/psr/psr-7/
[2] http://nodejs.org/api/http.html
%prep
-%setup -qn %{gh_project}-%{gh_commit} -a2
+%setup -qn %{gh_project}-%{gh_commit} -a2 -a4
mv %{gh_psr7_name}-%{gh_psr7_commit} psr7
+mv %{gh_factory_name}-%{gh_factory_commit} factory
mv LICENSE.md LICENSE
@@ -140,6 +159,7 @@ phpab --template fedora --output src/autoload.php src
cat <<'AUTOLOAD' | tee -a src/autoload.php
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Psr/Http/Message/autoload.php',
+ '%{phpdir}/Psr/Http/Message/http-factory-autoload.php',
__DIR__.'/functions/create_uploaded_file.php',
__DIR__.'/functions/marshal_headers_from_sapi.php',
__DIR__.'/functions/marshal_method_from_sapi.php',
@@ -154,7 +174,7 @@ AUTOLOAD
cat << 'EOF' | tee zf.php
<?php
require_once '%{php_home}/Fedora/Autoloader/autoload.php';
-$dir = dirname(dirname(__DIR__)) . '/%{namespace}/%{library}';
+$dir = dirname(dirname(__DIR__)) . '/%{namespace}/%{library}%{major}';
\Fedora\Autoloader\Dependencies::required([
'%{php_home}/%{namespace}/ZendFrameworkBridge/autoload.php',
$dir . '/autoload.php',
@@ -173,11 +193,11 @@ EOF
%install
: Laminas library
mkdir -p %{buildroot}%{php_home}/%{namespace}/
-cp -pr src %{buildroot}%{php_home}/%{namespace}/%{library}
+cp -pr src %{buildroot}%{php_home}/%{namespace}/%{library}%{major}
: Zend equiv
-mkdir -p %{buildroot}%{php_home}/Zend/%{library}
-cp -pr zf.php %{buildroot}%{php_home}/Zend/%{library}/autoload.php
+mkdir -p %{buildroot}%{php_home}/Zend/%{library}%{major}
+cp -pr zf.php %{buildroot}%{php_home}/Zend/%{library}%{major}/autoload.php
%check
@@ -186,32 +206,28 @@ cp -pr zf.php %{buildroot}%{php_home}/Zend/%{library}/autoload.php
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
-require_once '%{buildroot}%{phpdir}/%{namespace}/Diactoros/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('%{namespace}Test\\Diactoros\\', __DIR__.'/test');
+require_once '%{buildroot}%{phpdir}/%{namespace}/%{library}%{major}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('%{namespace}Test\\%{library}\\', __DIR__.'/test');
\Fedora\Autoloader\Autoload::addPsr4('Http\\Psr7Test\\', __DIR__.'/psr7/src');
-
-\Fedora\Autoloader\Dependencies::required(array(
- __DIR__.'/test/TestAsset/Functions.php',
- __DIR__.'/test/TestAsset/SapiResponse.php',
-));
+\Fedora\Autoloader\Autoload::addPsr4('Interop\\Http\\Factory\\', __DIR__.'/factory/test');
BOOTSTRAP
: Upstream tests
-# Skip testReasonPhraseDefaultsAgainstIana requiring network access
+# Skip tests requiring network access
RETURN_CODE=0
for CMDARG in "php %{phpunit}" php72 php73 php74; do
if which $CMDARG; then
set $CMDARG
- $1 ${2:-%{_bindir}/phpunit6} \
+ $1 ${2:-%{_bindir}/phpunit7} \
--bootstrap bootstrap.php \
- --filter '^((?!(testReasonPhraseDefaultsAgainstIana)).)*$' \
+ --filter '^((?!(testReasonPhraseDefaultsAgainstIana|testIsNotSeekable|testIsNotWritable|testIsNotReadable|testRewindNotSeekable)).)*$' \
--verbose || RETURN_CODE=1
fi
done
: check compat autoloader
php -r '
-require "%{buildroot}%{php_home}/Zend/%{library}/autoload.php";
+require "%{buildroot}%{php_home}/Zend/%{library}%{major}/autoload.php";
exit (class_exists("\\Zend\\%{library}\\Request") ? 0 : 1);
'
@@ -227,11 +243,19 @@ exit $RETURN_CODE
%license LICENSE
%doc *.md
%doc composer.json
-%{php_home}/Zend/%{library}
-%{php_home}/%{namespace}/%{library}
+%{php_home}/Zend/%{library}%{major}
+%{php_home}/%{namespace}/%{library}%{major}
%changelog
+* Wed Jan 22 2020 Remi Collet <remi@remirepo.net> - 2.2.2-1
+- update to 2.2.2
+- rename to php-laminas-diactoros2
+- install to /usr/share/php/Laminas/Diactoros2
+- raise dependency on PHP 7.1
+- add dependency on psr/http-factory
+- switch to phpunit7
+
* Fri Jan 17 2020 Remi Collet <remi@remirepo.net> - 1.8.7p1-2
- cleanup