summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--50.patch41
-rw-r--r--php-zendframework-zend-feed.spec41
2 files changed, 55 insertions, 27 deletions
diff --git a/50.patch b/50.patch
new file mode 100644
index 0000000..a1c5100
--- /dev/null
+++ b/50.patch
@@ -0,0 +1,41 @@
+From e50e94da5e23a9d33ef3959c4d1239eec2b1a907 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 24 Oct 2017 12:40:39 +0200
+Subject: [PATCH] fix warning 'Parameter must be an array or an object that
+ implements Countable' (PHP 7.2)
+
+---
+ src/PubSubHubbub/Model/Subscription.php | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/PubSubHubbub/Model/Subscription.php b/src/PubSubHubbub/Model/Subscription.php
+index 97333ffe..9780b6a8 100644
+--- a/src/PubSubHubbub/Model/Subscription.php
++++ b/src/PubSubHubbub/Model/Subscription.php
+@@ -71,7 +71,7 @@ public function getSubscription($key)
+ .' of "' . $key . '" must be a non-empty string');
+ }
+ $result = $this->db->select(['id' => $key]);
+- if (count($result)) {
++ if ($result && count($result)) {
+ return $result->current()->getArrayCopy();
+ }
+ return false;
+@@ -91,7 +91,7 @@ public function hasSubscription($key)
+ .' of "' . $key . '" must be a non-empty string');
+ }
+ $result = $this->db->select(['id' => $key]);
+- if (count($result)) {
++ if ($result && count($result)) {
+ return true;
+ }
+ return false;
+@@ -106,7 +106,7 @@ public function hasSubscription($key)
+ public function deleteSubscription($key)
+ {
+ $result = $this->db->select(['id' => $key]);
+- if (count($result)) {
++ if ($result && count($result)) {
+ $this->db->delete(
+ ['id' => $key]
+ );
diff --git a/php-zendframework-zend-feed.spec b/php-zendframework-zend-feed.spec
index 077bc2c..a3e9259 100644
--- a/php-zendframework-zend-feed.spec
+++ b/php-zendframework-zend-feed.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.8.0
-Release: 2%{?dist}
+Release: 4%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -30,7 +30,8 @@ URL: https://zendframework.github.io/%{gh_project}/
Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+Patch0: https://patch-diff.githubusercontent.com/raw/zendframework/zend-feed/pull/50.patch
+
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -125,6 +126,7 @@ Documentation: https://zendframework.github.io/%{gh_project}/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+%patch0 -p1
mv LICENSE.md LICENSE
@@ -140,8 +142,6 @@ EOF
%install
-rm -rf %{buildroot}
-
mkdir -p %{buildroot}%{php_home}/Zend/
cp -pr src %{buildroot}%{php_home}/Zend/%{library}
@@ -164,38 +164,21 @@ Zend\Loader\AutoloaderFactory::factory(array(
))));
require_once '%{php_home}/Zend/autoload.php';
EOF
-%if 0%{?rhel} == 5
-# sqlite is too old
-rm test/PubSubHubbub/Model/SubscriptionTest.php
-%endif
-# remirepo:11
-run=0
ret=0
-if which php56; then
- php56 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit6 || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{phpunit} --verbose
-# remirepo:2
-fi
+for cmdarg in "php %{phpunit}" "php56 %{_bindir}/phpunit" php70 php71 php72; do
+ if which $cmdarg; then
+ set $cmdarg
+ $1 -d memory_limit=1G ${2:-%{_bindir}/phpunit6} --verbose || ret=1
+ fi
+done
exit $ret
%else
: Test suite disabled
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -205,6 +188,10 @@ rm -rf %{buildroot}
%changelog
+* Tue Oct 24 2017 Remi Collet <remi@remirepo.net> - 2.8.0-4
+- fix FTBFS from Koschei, add patch for PHP 7.2 from
+ https://github.com/zendframework/zend-feed/pull/50
+
* Mon Apr 3 2017 Remi Collet <remi@remirepo.net> - 2.8.0-2
- change dependency on psr/http-message to required