summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-24 07:52:08 +0100
committerRemi Collet <remi@remirepo.net>2017-11-24 07:52:08 +0100
commitfee6c2f78150bd5fd9fabb9eb580c67a027f9863 (patch)
treec47892f2a29560ba8f552e4323392171f98c4d1c
parent411de63ccc25a4ffbfc3bf181cd4a1b2b27eb63c (diff)
switch from zend-loader to fedora/autoloader
-rw-r--r--php-zendframework-zend-serializer.spec42
1 files changed, 26 insertions, 16 deletions
diff --git a/php-zendframework-zend-serializer.spec b/php-zendframework-zend-serializer.spec
index b35b5de..e3f5fb8 100644
--- a/php-zendframework-zend-serializer.spec
+++ b/php-zendframework-zend-serializer.spec
@@ -21,7 +21,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.8.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -43,19 +43,19 @@ BuildRequires: php-libxml
BuildRequires: php-pcre
BuildRequires: php-simplexml
BuildRequires: php-spl
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.7
-BuildRequires: php-composer(%{gh_owner}/zend-json) >= 2.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.7
+BuildRequires: php-autoloader(%{gh_owner}/zend-json) >= 2.5
# From composer, "require-dev": {
# "zendframework/zend-math": "^2.6",
# "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
# "phpunit/phpunit": "^5.5",
# "zendframework/zend-coding-standard": "~1.0.0",
# "doctrine/instantiator": "1.0.*"
-BuildRequires: php-composer(%{gh_owner}/zend-math) >= 2.6
-BuildRequires: php-composer(%{gh_owner}/zend-servicemanager) >= 2.7.5
+BuildRequires: php-autoloader(%{gh_owner}/zend-math) >= 2.6
+BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 2.7.5
BuildRequires: php-composer(phpunit/phpunit) >= 5.5
# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5
+BuildRequires: php-fedora-autoloader-devel
%endif
# From composer, "require": {
@@ -84,10 +84,13 @@ Requires: php-libxml
Requires: php-pcre
Requires: php-simplexml
Requires: php-spl
+# 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
@@ -105,7 +108,17 @@ mv LICENSE.md LICENSE
%build
-# Empty build section, nothing required
+phpab --template fedora --output src/autoload.php src
+cat << 'EOF' | tee -a src/autoload.php
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/Zend/Stdlib/autoload.php',
+ '%{php_home}/Zend/Json/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Math/autoload.php',
+ '%{php_home}/Zend/ServiceManager/autoload.php',
+]);
+EOF
%install
@@ -118,20 +131,14 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library}
mkdir vendor
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
ret=0
for cmd in php php56 php70 php71 php72; do
if which $cmd; then
- $cmd %{_bindir}/phpunit || ret=1
+ $cmd %{_bindir}/phpunit --verbose || ret=1
fi
done
exit $ret
@@ -149,6 +156,9 @@ exit $ret
%changelog
+* Thu Nov 23 2017 Remi Collet <remi@remirepo.net> - 2.8.1-2
+- switch from zend-loader to fedora/autoloader
+
* Tue Nov 21 2017 Remi Collet <remi@remirepo.net> - 2.8.1-1
- Update to 2.8.1