summaryrefslogtreecommitdiffstats
path: root/php-zendframework-zend-escaper.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-zendframework-zend-escaper.spec')
-rw-r--r--php-zendframework-zend-escaper.spec52
1 files changed, 17 insertions, 35 deletions
diff --git a/php-zendframework-zend-escaper.spec b/php-zendframework-zend-escaper.spec
index 91f0449..b9ab949 100644
--- a/php-zendframework-zend-escaper.spec
+++ b/php-zendframework-zend-escaper.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.5.2
-Release: 1%{?dist}
+Release: 4%{?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}
@@ -45,7 +44,7 @@ BuildRequires: php-spl
# "phpunit/PHPUnit": "~4.0"
BuildRequires: php-composer(phpunit/phpunit) >= 4.0
# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
+BuildRequires: php-fedora-autoloader-devel
%endif
# From composer, "require": {
@@ -58,11 +57,12 @@ Requires: php-mbstring
Requires: php-pcre
Requires: php-spl
# Autoloader
-Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5
+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
@@ -83,12 +83,10 @@ mv LICENSE.md LICENSE
%build
-# Empty build section, nothing required
+phpab --template fedora --output src/autoload.php src
%install
-rm -rf %{buildroot}
-
mkdir -p %{buildroot}%{php_home}/Zend/
cp -pr src %{buildroot}%{php_home}/Zend/%{library}
@@ -96,53 +94,37 @@ 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
-# remirepo:11
-run=0
ret=0
-if which php56; then
- php56 %{_bindir}/phpunit --include-path=%{buildroot}%{php_home} || ret=1
- run=1
-fi
-if which php71; then
- php70 %{_bindir}/phpunit --include-path=%{buildroot}%{php_home} || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --include-path=%{buildroot}%{php_home} --verbose
-# remirepo:2
-fi
+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
%doc composer.json
+%dir %{php_home}/Zend
%{php_home}/Zend/%{library}
%changelog
+* Thu Nov 23 2017 Remi Collet <remi@remirepo.net> - 2.5.2-4
+- switch from zend-loader to fedora/autoloader
+
* Fri Jul 1 2016 Remi Collet <remi@fedoraproject.org> - 2.5.2-1
- update to 2.5.2
- raise dependency on PHP 5.5