diff options
-rw-r--r-- | php-zendframework-zend-psr7bridge.spec | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/php-zendframework-zend-psr7bridge.spec b/php-zendframework-zend-psr7bridge.spec index d7b6f39..7377005 100644 --- a/php-zendframework-zend-psr7bridge.spec +++ b/php-zendframework-zend-psr7bridge.spec @@ -21,7 +21,7 @@ Name: php-%{gh_owner}-%{gh_project} Version: 0.2.2 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -38,16 +38,16 @@ BuildRequires: php-reflection BuildRequires: php-intl BuildRequires: php-pcre BuildRequires: php-spl -BuildRequires: php-composer(%{gh_owner}/zend-http) >= 2.5 +BuildRequires: php-autoloader(%{gh_owner}/zend-http) >= 2.5 BuildRequires: php-composer(psr/http-message) >= 1.0 -BuildRequires: php-composer(%{gh_owner}/zend-diactoros) >= 1.1 +BuildRequires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.1 # From composer, "require-dev": { # "phpunit/phpunit": "^4.7", # "squizlabs/php_codesniffer": "^2.3" BuildRequires: php-composer(phpunit/phpunit) >= 4.7 -# Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 %endif +# Autoloader +BuildRequires: php-fedora-autoloader-devel # From composer, "require": { # "php": ">=5.5", @@ -56,16 +56,19 @@ BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 # "zendframework/zend-diactoros": "^1.1" Requires: php(language) >= 5.5 %if ! %{bootstrap} -Requires: php-composer(%{gh_owner}/zend-http) >= 2.5 -Requires: php-composer(%{gh_owner}/zend-http) < 3 +Requires: php-autoloader(%{gh_owner}/zend-http) >= 2.5 +Requires: php-autoloader(%{gh_owner}/zend-http) < 3 Requires: php-composer(psr/http-message) >= 1.0 Requires: php-composer(psr/http-message) < 2 -Requires: php-composer(%{gh_owner}/zend-diactoros) >= 1.1 -Requires: php-composer(%{gh_owner}/zend-diactoros) < 2 +Requires: php-autoloader(%{gh_owner}/zend-diactoros) >= 1.1 +Requires: php-autoloader(%{gh_owner}/zend-diactoros) < 2 %endif +# Autoloader +Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 0.2.1 => Nothing Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} %description @@ -81,7 +84,15 @@ 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::required([ + '%{php_home}/Zend/Http/autoload.php', + '%{php_home}/Psr/Http/Message/autoload.php', + '%{php_home}/Zend/Diactoros/autoload.php', +]); +EOF %install @@ -94,14 +105,8 @@ 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 @@ -125,6 +130,9 @@ exit $ret %changelog +* Sat Dec 9 2017 Remi Collet <remi@remirepo.net> - 0.2.2-4 +- switch from zend-loader to fedora/autoloader + * Wed May 11 2016 Remi Collet <remi@fedoraproject.org> - 0.2.2-1 - update to 0.2.2 |