From 74c0cdd49966c8f333dce9cf62db0fef60f23ca4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 26 Jan 2021 18:02:43 +0100 Subject: update to 2.13.0 raise dependency on PHP 7.3 add patch for PHP 8 from https://github.com/laminas/laminas-mail/pull/134 switch to phpunit9 --- .gitignore | 2 ++ 134.patch | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ composer.json | 6 +++--- php-laminas-mail.spec | 40 ++++++++++++++++++++++++---------------- 4 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 134.patch diff --git a/.gitignore b/.gitignore index 1ab5c4f..01f0400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ +clog package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc diff --git a/134.patch b/134.patch new file mode 100644 index 0000000..db8475d --- /dev/null +++ b/134.patch @@ -0,0 +1,51 @@ +From b5e38613811824a6d1b3d1993f37de422087ac6f Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 26 Jan 2021 17:42:09 +0100 +Subject: [PATCH 1/2] fix TypeError: fclose(): supplied resource is not a valid + stream resource + +--- + src/Storage/Mbox.php | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/Storage/Mbox.php b/src/Storage/Mbox.php +index 3e48a6c6..52f6bcfe 100644 +--- a/src/Storage/Mbox.php ++++ b/src/Storage/Mbox.php +@@ -308,7 +308,9 @@ protected function openMboxFile($filename) + public function close() + { + ErrorHandler::start(E_WARNING); +- fclose($this->fh); ++ if (is_resource($this->fh)) { ++ fclose($this->fh); ++ } + ErrorHandler::stop(); + $this->positions = []; + } + +From fd62569b1065b85eadad627e0556376e1696da97 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 26 Jan 2021 17:54:35 +0100 +Subject: [PATCH 2/2] clean uneeded stuff + +--- + src/Storage/Mbox.php | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/Storage/Mbox.php b/src/Storage/Mbox.php +index 52f6bcfe..c8f16d6e 100644 +--- a/src/Storage/Mbox.php ++++ b/src/Storage/Mbox.php +@@ -307,11 +307,9 @@ protected function openMboxFile($filename) + */ + public function close() + { +- ErrorHandler::start(E_WARNING); + if (is_resource($this->fh)) { + fclose($this->fh); + } +- ErrorHandler::stop(); + $this->positions = []; + } + diff --git a/composer.json b/composer.json index d43eba1..aa5ded6 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ } }, "require": { - "php": "^7.1", + "php": "^7.3 || ~8.0.0", "ext-iconv": "*", "laminas/laminas-loader": "^2.5", "laminas/laminas-mime": "^2.5", @@ -36,10 +36,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-config": "^2.6", + "laminas/laminas-config": "^3.4", "laminas/laminas-crypt": "^2.6 || ^3.0", "laminas/laminas-servicemanager": "^3.2.1", - "phpunit/phpunit": "^7.5.20" + "phpunit/phpunit": "^9.3" }, "suggest": { "laminas/laminas-crypt": "Crammd5 support in SMTP Auth", diff --git a/php-laminas-mail.spec b/php-laminas-mail.spec index 193a6e1..e25228a 100644 --- a/php-laminas-mail.spec +++ b/php-laminas-mail.spec @@ -8,7 +8,7 @@ # %bcond_without tests -%global gh_commit ed5b36a0deef4ffafe6138c2ae9cafcffafab856 +%global gh_commit a259ddb091618bdcbfb1540e0fe4671a823c342b %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner laminas %global gh_project laminas-mail @@ -18,7 +18,7 @@ %global library Mail Name: php-%{gh_project} -Version: 2.12.5 +Version: 2.13.0 Release: 1%{?dist} Summary: %{namespace} Framework %{library} component @@ -27,10 +27,12 @@ URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh +Patch0: https://patch-diff.githubusercontent.com/raw/laminas/laminas-mail/pull/134.patch + BuildArch: noarch # Tests %if %{with tests} -BuildRequires: php(language) >= 7.1 +BuildRequires: php(language) >= 7.3 BuildRequires: php-ctype BuildRequires: php-date BuildRequires: php-iconv @@ -46,11 +48,11 @@ BuildRequires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 BuildRequires: (php-composer(true/punycode) >= 2.1 with php-composer(true/punycode) < 3) # From composer, "require-dev": { # "laminas/laminas-coding-standard": "~1.0.0", -# "laminas/laminas-config": "^2.6", +# "laminas/laminas-config": "^3.4", # "laminas/laminas-crypt": "^2.6 || ^3.0", # "laminas/laminas-servicemanager": "^3.2.1", -# "phpunit/phpunit": "^7.5.20" -BuildRequires: (php-autoloader(%{gh_owner}/laminas-config) >= 2.6 with php-autoloader(%{gh_owner}/laminas-config) < 3) +# "phpunit/phpunit": "^9.3" +BuildRequires: (php-autoloader(%{gh_owner}/laminas-config) >= 3.4 with php-autoloader(%{gh_owner}/laminas-config) < 4) BuildRequires: (php-autoloader(%{gh_owner}/laminas-crypt) >= 3.0 with php-autoloader(%{gh_owner}/laminas-crypt) < 4) BuildRequires: (php-autoloader(%{gh_owner}/laminas-servicemanager) >= 3.2.1 with php-autoloader(%{gh_owner}/laminas-servicemanager) < 4) # remirepo:11 @@ -61,18 +63,18 @@ BuildRequires: php-laminas-stdlib BuildRequires: php-laminas-validator BuildRequires: php-laminas-zendframework-bridge BuildRequires: php-true-punycode -BuildRequires: php-laminas-config +BuildRequires: php-laminas-config3 BuildRequires: php-laminas-crypt BuildRequires: php-laminas-servicemanager %endif -BuildRequires: phpunit7 >= 7.5.20 -%global phpunit %{_bindir}/phpunit7 +BuildRequires: phpunit9 >= 9.3 +%global phpunit %{_bindir}/phpunit9 %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # From composer, "require": { -# "php": "^7.1", +# "php": "^7.3 || ~8.0.0", # "ext-iconv": "*", # "laminas/laminas-loader": "^2.5", # "laminas/laminas-mime": "^2.5", @@ -80,7 +82,7 @@ BuildRequires: php-fedora-autoloader-devel # "laminas/laminas-validator": "^2.10.2", # "laminas/laminas-zendframework-bridge": "^1.0", # "true/punycode": "^2.1" -Requires: php(language) >= 7.1 +Requires: php(language) >= 7.3 Requires: php-iconv # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 @@ -138,6 +140,7 @@ Documentation: https://docs.laminas.dev/%{gh_project}/ %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 mv LICENSE.md LICENSE @@ -186,7 +189,7 @@ cat << 'EOF' | tee vendor/autoload.php - 2.13.0-1 +- update to 2.13.0 +- raise dependency on PHP 7.3 +- add patch for PHP 8 from + https://github.com/laminas/laminas-mail/pull/134 +- switch to phpunit9 + * Wed Jan 6 2021 Remi Collet - 2.12.5-1 - update to 2.12.5 -- cgit