diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-10-19 12:01:38 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-10-19 12:01:38 +0200 |
commit | dc146dc4c55a2a87af91b2d002f58056be29b9f8 (patch) | |
tree | 302af03001fdcaa1cc9ab8d6dd61688cfc41522d | |
parent | c73bf93a6ca507733856ff3c9ac851ad7b4fea55 (diff) |
php-ocramius-proxy-managev: synced with fedora change
-rw-r--r-- | php-ocramius-proxy-manager-dev.spec | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/php-ocramius-proxy-manager-dev.spec b/php-ocramius-proxy-manager-dev.spec index 076ca67..5c8acef 100644 --- a/php-ocramius-proxy-manager-dev.spec +++ b/php-ocramius-proxy-manager-dev.spec @@ -1,8 +1,8 @@ # remirepo spec file for php-ocramius-proxy-manager from Fedora: # -# RPM spec file for php-ocramius-proxy-manager +# Fedora spec file for php-ocramius-proxy-manager # -# Copyright (c) 2015 Shawn Iwinski <shawn.iwinski@gmail.com> +# Copyright (c) 2015-2016 Shawn Iwinski <shawn.iwinski@gmail.com> # # License: MIT # http://opensource.org/licenses/MIT @@ -26,13 +26,13 @@ %global zf_max_ver 4 # Build using "--without tests" to disable tests -%global with_tests %{?_without_tests:0}%{!?_without_tests:1} +%global with_tests 0%{!?_without_tests:1} %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 1%{?github_release}%{?dist} +Release: 2%{?github_release}%{?dist} Summary: OOP proxy wrappers utilities Group: Development/Libraries @@ -48,24 +48,25 @@ Patch0: %{name}-rpm.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch -# Autoload generation +# Autoloader BuildRequires: %{_bindir}/phpab %if %{with_tests} # Tests ## composer.json -BuildRequires: %{_bindir}/phpunit +BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(zendframework/zend-code) >= %{zf_min_ver} +BuildRequires: php-composer(zendframework/zend-code) < %{zf_max_ver} BuildRequires: php-composer(zendframework/zend-loader) +BuildRequires: php-composer(ocramius/generated-hydrator) >= 2 ## phpcompatinfo (computed from version 2.0.0) BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl -# Autoloader -BuildRequires: php-composer(phpunit/phpunit) >= 5.3.4 +BuildRequires: php-composer(phpunit/phpunit) >= 5.3.4 %endif # composer.json -Requires: php(language) >= %{php_min_ver} +Requires: php(language) >= %{php_min_ver} Requires: php-composer(zendframework/zend-code) >= %{zf_min_ver} Requires: php-composer(zendframework/zend-code) < %{zf_max_ver} # phpcompatinfo (computed from version 2.0.0) @@ -74,15 +75,22 @@ Requires: php-reflection Requires: php-spl # Autoloader Requires: php-composer(zendframework/zend-loader) + +# Weak dependencies %if 0%{?fedora} >= 21 -Suggests: php-composer(zendframework/zend-xmlrpc) +Suggests: php-composer(ocramius/generated-hydrator) Suggests: php-composer(zendframework/zend-json) Suggests: php-composer(zendframework/zend-soap) +Suggests: php-composer(zendframework/zend-stdlib) +Suggests: php-composer(zendframework/zend-xmlrpc) %endif +# For autoloader +Conflicts: php-ocramius-generated-hydrator < 2 # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} + %description This library aims at providing abstraction for generating various kinds of proxy classes. @@ -103,10 +111,21 @@ grep ' return' src/ProxyManager/Version.php %build : Generate autoloader %{_bindir}/phpab --output src/ProxyManager/autoload.php src/ProxyManager -cat << 'EOF' | tee -a src/ProxyManager/autoload.php -// For dependencies -require_once '%{phpdir}/Zend/autoload.php'; -EOF + +cat <<'AUTOLOAD' | tee -a src/ProxyManager/autoload.php + +// Dependencies (autoloader => required) +foreach (array( + // Required + '%{phpdir}/Zend/autoload.php' => true, + // Optional + '%{phpdir}/GeneratedHydrator/autoload.php' => false, +) as $dependencyAutoloader => $required) { + if ($required || file_exists($dependencyAutoloader)) { + require_once $dependencyAutoloader; + } +} +AUTOLOAD %install @@ -145,6 +164,10 @@ rm -rf %{buildroot} %changelog +* Wed Oct 19 2016 Remi Collet <remi@fedoraproject.org> - 2.0.3-2 +- Add weak dependencies +- Use dependencies' autoloaders + * Fri Jul 1 2016 Remi Collet <remi@fedoraproject.org> - 2.0.3-1 - update to 2.0.3 - raise dependency on zendframework/zend-code 3.0.4 |