From 523701f3e9ece4be7e8c0aa3ae62b5cebed6f58d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 24 Feb 2017 12:34:57 +0100 Subject: php-zendframework-zendservice-recaptcha: rewrite autoloader --- ...endframework-zendservice-recaptcha-autoload.php | 16 ------------ php-zendframework-zendservice-recaptcha.spec | 29 +++++++++++++++++++--- 2 files changed, 25 insertions(+), 20 deletions(-) delete mode 100644 php-zendframework-zendservice-recaptcha-autoload.php diff --git a/php-zendframework-zendservice-recaptcha-autoload.php b/php-zendframework-zendservice-recaptcha-autoload.php deleted file mode 100644 index 65a608b..0000000 --- a/php-zendframework-zendservice-recaptcha-autoload.php +++ /dev/null @@ -1,16 +0,0 @@ - array( - 'fallback_autoloader' => true, - 'autoregister_zf' => true, - 'namespaces' => array( - 'ZendService' => dirname(__DIR__) -)))); diff --git a/php-zendframework-zendservice-recaptcha.spec b/php-zendframework-zendservice-recaptcha.spec index 379b0df..97ea72a 100644 --- a/php-zendframework-zendservice-recaptcha.spec +++ b/php-zendframework-zendservice-recaptcha.spec @@ -18,7 +18,7 @@ Name: php-%{gh_owner}-%{pk_project} Version: 3.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries @@ -26,7 +26,6 @@ License: BSD URL: https://framework.zend.com/ Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh -Source2: %{name}-autoload.php BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch @@ -77,6 +76,19 @@ Provides: php-composer(%{gh_owner}/%{pk_project}) = %{version} mv LICENSE.md LICENSE +# Generate autoloader for this framework extension +cat << 'EOF' | tee autoload.php + array( + 'namespaces' => array( + '%{namespace}\\%{library}' => dirname(__DIR__) . '/%{namespace}/%{library}', +)))); +EOF + +# Redirect to framework autoloader +ln -s ../../Zend/autoload.php src/autoload.php + %build # Empty build section, nothing required @@ -88,7 +100,7 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{php_home}/%{namespace} cp -pr src %{buildroot}%{php_home}/%{namespace}/%{library} -install -pm 644 %{SOURCE2} %{buildroot}%{php_home}/%{namespace}/%{library}/autoload.php +install -Dpm 644 autoload.php %{buildroot}%{php_home}/Zend/%{namespace}-%{library}-autoload.php %check @@ -96,7 +108,12 @@ install -pm 644 %{SOURCE2} %{buildroot}%{php_home}/%{namespace}/%{library}/auto mkdir vendor cat << EOF | tee vendor/autoload.php array( + 'namespaces' => array( + '%{namespace}\\%{library}' => '%{buildroot}%{php_home}/%{namespace}/%{library}', +)))); EOF # remirepo:11 run=0 @@ -131,9 +148,13 @@ rm -rf %{buildroot} %doc composer.json %dir %{php_home}/%{namespace} %{php_home}/%{namespace}/%{library} + %{php_home}/Zend/%{namespace}-%{library}-autoload.php %changelog +* Fri Feb 24 2017 Remi Collet - 3.0.0-2 +- rewrite autoloader as framework extension + * Mon Feb 20 2017 Remi Collet - 3.0.0-1 - update to 3.0.0 -- cgit