summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-10-30 12:50:02 +0100
committerRemi Collet <remi@remirepo.net>2017-10-30 12:50:02 +0100
commit1db554f953c350598c1d9554bc3b6c2da1801f32 (patch)
tree8646c92e8a7871881fc871f1fd4ae974d74684e8
parent3f899e50beb3d2e918a421398742cf5a26429889 (diff)
fix FTBFS from Koschei, add patch for tests from https://github.com/zetacomponents/Base/pull/8
-rw-r--r--.gitignore8
-rw-r--r--php-zetacomponents-base-pr8.patch62
-rw-r--r--php-zetacomponents-base.spec26
3 files changed, 86 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9aa8c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/php-zetacomponents-base-pr8.patch b/php-zetacomponents-base-pr8.patch
new file mode 100644
index 0000000..d0c8d1c
--- /dev/null
+++ b/php-zetacomponents-base-pr8.patch
@@ -0,0 +1,62 @@
+From 850e8287b035fa8b13bd5ab563eacaf1ee2ec1b5 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 30 Oct 2017 12:27:03 +0100
+Subject: [PATCH] object is a reserved keywork in PHP 7.2
+
+---
+ tests/base_test.php | 4 ++--
+ tests/test_repository/autoload_files/object_autoload.php | 5 -----
+ tests/test_repository/autoload_files/objet_autoload.php | 5 +++++
+ tests/test_repository/object/object.php | 3 ++-
+ 4 files changed, 9 insertions(+), 8 deletions(-)
+ delete mode 100644 tests/test_repository/autoload_files/object_autoload.php
+ create mode 100644 tests/test_repository/autoload_files/objet_autoload.php
+
+diff --git a/tests/base_test.php b/tests/base_test.php
+index 9ab3821..ce410bb 100644
+--- a/tests/base_test.php
++++ b/tests/base_test.php
+@@ -424,8 +424,8 @@ public function testBaseAddAndGetAutoloadDirs4()
+ public function testNoPrefixAutoload()
+ {
+ ezcBase::addClassRepository( __DIR__ . '/test_repository', __DIR__ . '/test_repository/autoload_files' );
+- ezc_autoload( 'Object' );
+- if ( !class_exists( 'Object' ) )
++ ezc_autoload( 'Objet' );
++ if ( !class_exists( 'Objet' ) )
+ {
+ $this->fail( "Autoload does not handle classes with no prefix" );
+ }
+diff --git a/tests/test_repository/autoload_files/object_autoload.php b/tests/test_repository/autoload_files/object_autoload.php
+deleted file mode 100644
+index 5e3dc90..0000000
+--- a/tests/test_repository/autoload_files/object_autoload.php
++++ /dev/null
+@@ -1,5 +0,0 @@
+-<?php
+-return array(
+- 'Object' => 'object/object.php',
+-);
+-?>
+diff --git a/tests/test_repository/autoload_files/objet_autoload.php b/tests/test_repository/autoload_files/objet_autoload.php
+new file mode 100644
+index 0000000..1e81bb0
+--- /dev/null
++++ b/tests/test_repository/autoload_files/objet_autoload.php
+@@ -0,0 +1,5 @@
++<?php
++return array(
++ 'Objet' => 'object/object.php',
++);
++?>
+diff --git a/tests/test_repository/object/object.php b/tests/test_repository/object/object.php
+index 3b46ba6..6c39fcd 100644
+--- a/tests/test_repository/object/object.php
++++ b/tests/test_repository/object/object.php
+@@ -1,4 +1,5 @@
+ <?php
+-class Object{
++class Objet{
++// Objet is not a typo, Object is a reserved keywork in 7.2+
+ }
+ ?>
diff --git a/php-zetacomponents-base.spec b/php-zetacomponents-base.spec
index 4225826..ec5ddc9 100644
--- a/php-zetacomponents-base.spec
+++ b/php-zetacomponents-base.spec
@@ -17,7 +17,7 @@
Name: php-%{gh_owner}-%{cname}
Version: 1.9
-Release: 2%{?dist}
+Release: 6%{?dist}
Summary: Zeta Base Component
Group: Development/Libraries
@@ -29,8 +29,9 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
Patch0: %{name}-layout.patch
# Upstream
Patch1: %{name}-upstream.patch
+# For PHP 7.2
+Patch2: %{name}-pr8.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: %{_bindir}/phpab
%if %{with_tests}
@@ -61,6 +62,7 @@ autoload support.
%patch0 -p0
%patch1 -p1
+%patch2 -p1
%build
@@ -71,7 +73,6 @@ autoload support.
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{ezcdir}/autoload
: The library
@@ -96,18 +97,19 @@ require '$PWD/src/autoloader.php';
EOF
: Run test test suite
-%{_bindir}/phpunit
+ret=0
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit || 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* CREDITS
%doc ChangeLog
@@ -120,9 +122,13 @@ rm -rf %{buildroot}
%changelog
+* Mon Oct 30 2017 Remi Collet <remi@fedoraproject.org> - 1.9-6
+- fix FTBFS from Koschei, add patch for tests from
+ https://github.com/zetacomponents/Base/pull/8
+
* Thu Jun 4 2015 Remi Collet <remi@fedoraproject.org> - 1.9-2
- add upstream patch for LICENSE file
* Wed Jun 3 2015 Remi Collet <remi@fedoraproject.org> - 1.9-1
- initial package
-- open https://github.com/zetacomponents/UnitTest/issues/4 License \ No newline at end of file
+- open https://github.com/zetacomponents/UnitTest/issues/4 License