summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-cache.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-10-31 18:32:48 +0100
committerRemi Collet <remi@remirepo.net>2017-10-31 18:32:48 +0100
commited975827086e6587f072aa5638d77c4c987e92b1 (patch)
treee85cb8bbaa82a9176cafc3253b064e2a8a763ab2 /php-zendframework-zend-cache.spec
parentcc8e245e7bfea8ff3fc931e324fe0fc0842924fb (diff)
fix FTBFS from Koschei, add upstream patch for PHP 7.2
Diffstat (limited to 'php-zendframework-zend-cache.spec')
-rw-r--r--php-zendframework-zend-cache.spec51
1 files changed, 28 insertions, 23 deletions
diff --git a/php-zendframework-zend-cache.spec b/php-zendframework-zend-cache.spec
index 1ceda54..80f9ff2 100644
--- a/php-zendframework-zend-cache.spec
+++ b/php-zendframework-zend-cache.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.7.2
-Release: 1%{?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://github.com/zendframework/zend-cache/commit/d967c0d39c48a79c3c37ff84d8658240038f4d78.patch
+
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -121,26 +122,40 @@ Documentation: https://zendframework.github.io/%{gh_project}/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+# EL-6 patch don't allow rename
+mkdir src/PatternPluginManager
+mv src/PatternPluginManager.php src/PatternPluginManager/PatternPluginManagerV2Polyfill.php
+%patch0 -p1
mv LICENSE.md LICENSE
+: Create dependency autoloader
+mv autoload/*.php src
+
+cat << 'EOF' | tee autoload.php
+<?php
+require_once __DIR__ . '/%{library}/patternPluginManagerPolyfill.php';
+EOF
+
%build
# Empty build section, nothing required
%install
-rm -rf %{buildroot}
-
mkdir -p %{buildroot}%{php_home}/Zend/
cp -pr src %{buildroot}%{php_home}/Zend/%{library}
+install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php
+
%check
%if %{with_tests}
mkdir vendor
cat << EOF | tee vendor/autoload.php
<?php
+define('RPM_BUILDROOT', '%{buildroot}%{php_home}/Zend');
+
require_once '%{php_home}/Zend/Loader/AutoloaderFactory.php';
Zend\Loader\AutoloaderFactory::factory(array(
'Zend\Loader\StandardAutoloader' => array(
@@ -151,41 +166,31 @@ Zend\Loader\AutoloaderFactory::factory(array(
require_once '%{php_home}/Zend/autoload.php';
EOF
-# remirepo:11
-run=0
ret=0
-if which php56; then
- php56 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --verbose
-# remirepo:2
-fi
+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
%doc *.md
%doc composer.json
%{php_home}/Zend/%{library}
+%{php_home}/Zend/%{library}-autoload.php
%changelog
+* Tue Oct 31 2017 Remi Collet <remi@fedoraproject.org> - 2.7.2-4
+- fix FTBFS from Koschei, add upstream patch for PHP 7.2
+
* Fri Dec 16 2016 Remi Collet <remi@fedoraproject.org> - 2.7.2-1
- update to 2.7.2