summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-debug.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-zendframework-zend-debug.spec')
-rw-r--r--php-zendframework-zend-debug.spec58
1 files changed, 28 insertions, 30 deletions
diff --git a/php-zendframework-zend-debug.spec b/php-zendframework-zend-debug.spec
index cd03e0c..4fecf41 100644
--- a/php-zendframework-zend-debug.spec
+++ b/php-zendframework-zend-debug.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.5.1
-Release: 1%{?dist}
+Release: 5%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -30,7 +30,6 @@ URL: https://zendframework.github.io/%{gh_project}/
Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -40,11 +39,11 @@ BuildRequires: php-pcre
# "zendframework/zend-escaper": "2.*",
# "fabpot/php-cs-fixer": "1.7.*",
# "phpunit/PHPUnit": "~4.0"
-BuildRequires: php-composer(%{gh_owner}/zend-escaper) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-escaper) >= 2.5
BuildRequires: php-composer(phpunit/phpunit) >= 4.0
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": ">=5.3.23"
@@ -55,17 +54,18 @@ Requires: php(language) >= 5.3.23
# "zendframework/zend-escaper": "To support escaped output"
%if 0%{?fedora} >= 21
Suggests: php-pecl(xdebug)
-Suggests: php-composer(%{gh_owner}/zend-escaper)
+Suggests: php-autoloader(%{gh_owner}/zend-escaper)
%endif
-# Autoloader
-Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5
%endif
# From phpcompatinfo report for version 2.5.2
Requires: php-pcre
+# Autoloader
+Requires: php-composer(fedora/autoloader)
Obsoletes: php-ZendFramework2-%{library} < 2.5
Provides: php-ZendFramework2-%{library} = %{version}
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -85,12 +85,16 @@ mv LICENSE.md LICENSE
%build
-# Empty build section, nothing required
+: Create autoloader
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Escaper/autoload.php',
+]);
+EOF
%install
-rm -rf %{buildroot}
-
mkdir -p %{buildroot}%{php_home}/Zend/
cp -pr src %{buildroot}%{php_home}/Zend/%{library}
@@ -98,34 +102,25 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library}
%check
%if %{with_tests}
mkdir vendor
-cat << EOF | tee vendor/autoload.php
+cat << 'EOF' | tee vendor/autoload.php
<?php
-require_once '%{php_home}/Zend/Loader/AutoloaderFactory.php';
-Zend\\Loader\\AutoloaderFactory::factory(array(
- 'Zend\\Loader\\StandardAutoloader' => array(
- 'namespaces' => array(
- 'ZendTest\\\\%{library}' => dirname(__DIR__).'/test/',
- 'Zend\\\\%{library}' => '%{buildroot}%{php_home}/Zend/%{library}'
-))));
-require_once '%{php_home}/Zend/autoload.php';
+require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
EOF
-%{_bindir}/phpunit --include-path=%{buildroot}%{php_home}
-
-if which php70; then
- php70 %{_bindir}/phpunit --include-path=%{buildroot}%{php_home}
-fi
+ret=0
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit --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
@@ -134,5 +129,8 @@ rm -rf %{buildroot}
%changelog
+* Tue Dec 5 2017 Remi Collet <remi@remirepo.net> - 2.5.1-5
+- switch from zend-loader to fedora/autoloader
+
* Tue Aug 4 2015 Remi Collet <remi@fedoraproject.org> - 2.5.1-1
- initial package