summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-zendframework-zendpdf.spec45
1 files changed, 24 insertions, 21 deletions
diff --git a/php-zendframework-zendpdf.spec b/php-zendframework-zendpdf.spec
index 4effd3f..045ee9f 100644
--- a/php-zendframework-zendpdf.spec
+++ b/php-zendframework-zendpdf.spec
@@ -16,7 +16,7 @@
Name: php-%{gh_owner}-%{gh_project}
Version: 2.0.2
-Release: 4%{?dist}
+Release: 6%{?dist}
Summary: Zend Framework %{library} component
Group: Development/Libraries
@@ -38,19 +38,21 @@ BuildRequires: php-pcre
BuildRequires: php-spl
BuildRequires: php-zlib
BuildRequires: php-composer(phpunit/phpunit)
-BuildRequires: php-composer(%{gh_owner}/zend-memory) >= 2.0.0
-BuildRequires: php-composer(%{gh_owner}/zend-stdlib) >= 2.0.0
-# Autoloader
-BuildRequires: php-composer(%{gh_owner}/zend-loader)
+BuildRequires: php-autoloader(%{gh_owner}/zend-memory) >= 2.0.0
+BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.0.0
%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": ">=5.3.3",
# "zendframework/zend-memory": ">=2.0.0",
# "zendframework/zend-stdlib": ">=2.0.0"
Requires: php(language) >= 5.3.3
-Requires: php-composer(%{gh_owner}/zend-memory) >= 2.0.0
-Requires: php-composer(%{gh_owner}/zend-stdlib) >= 2.0.0
+Requires: php-autoloader(%{gh_owner}/zend-memory) >= 2.0.0
+Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 2.0.0
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# From phpcompatinfo report for version 1.0.1
Requires: php-ctype
Requires: php-date
@@ -62,6 +64,7 @@ Requires: php-spl
Requires: php-zlib
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
%description
@@ -73,7 +76,8 @@ Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
mv LICENSE.txt LICENSE
-# Generate autoloader for this framework extension
+%build
+: Generate autoloader for this framework extension - deprecated
cat << 'EOF' | tee autoload.php
<?php
Zend\Loader\AutoloaderFactory::factory(array(
@@ -83,12 +87,14 @@ Zend\Loader\AutoloaderFactory::factory(array(
))));
EOF
-# Redirect to framework autoloader
-ln -s ../Zend/autoload.php library/ZendPdf/autoload.php
-
-
-%build
-# Empty build section, nothing required
+: Create autoloader
+phpab --template fedora --output library/%{library}/autoload.php library/%{library}
+cat << 'EOF' | tee -a library/%{library}/autoload.php
+\Fedora\Autoloader\Dependencies::optional([
+ '%{php_home}/Zend/Memory/autoload.php',
+ '%{php_home}/Zend/Stdlib/autoload.php',
+]);
+EOF
%install
@@ -103,13 +109,7 @@ install -Dpm 644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.p
mkdir vendor
cat << EOF | tee vendor/autoload.php
<?php
-require_once '%{php_home}/Zend/autoload.php';
-Zend\\Loader\\AutoloaderFactory::factory(array(
- 'Zend\\Loader\\StandardAutoloader' => array(
- 'namespaces' => array(
- '%{library}' => '%{buildroot}%{php_home}/%{library}',
- 'ZendTest\\\\%{library}' => dirname(__DIR__).'/tests/ZendXmlTest'
-))));
+require_once '%{buildroot}%{php_home}/%{library}/autoload.php';
EOF
cd tests
@@ -135,6 +135,9 @@ exit $ret
%changelog
+* Wed Dec 6 2017 Remi Collet <remi@remirepo.net> - 2.0.2-6
+- switch from zend-loader to fedora/autoloader
+
* Fri Feb 24 2017 Remi Collet <remi@fedoraproject.org> - 2.0.2-4
- rewrite autoloader as framework extension