summaryrefslogtreecommitdiffstats
path: root/php-ocramius-proxy-manager.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-08-29 12:36:20 +0200
committerRemi Collet <remi@remirepo.net>2019-08-29 12:36:20 +0200
commitee41f93e213a05cf590f4408f10accffeaf47478 (patch)
tree3f9a43f74ca636c0e9068de6bd8ef174dc9f3254 /php-ocramius-proxy-manager.spec
parent03381435e3ba8e72086795f571e42fe4618f640e (diff)
- update to 2.2.2
- use zendframework component autoloaders instead of framework one
Diffstat (limited to 'php-ocramius-proxy-manager.spec')
-rw-r--r--php-ocramius-proxy-manager.spec78
1 files changed, 50 insertions, 28 deletions
diff --git a/php-ocramius-proxy-manager.spec b/php-ocramius-proxy-manager.spec
index 623697b..3d6520f 100644
--- a/php-ocramius-proxy-manager.spec
+++ b/php-ocramius-proxy-manager.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-ocramius-proxy-manager
#
-# Copyright (c) 2015-2016 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2015-2019 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,8 +12,8 @@
%global github_owner Ocramius
%global github_name ProxyManager
-%global github_version 2.2.0
-%global github_commit 81d53b2878f1d1c40ad27270e64b51798485dfc5
+%global github_version 2.2.2
+%global github_commit 14b137b06b0f911944132df9d51e445a35920ab1
%global github_short %(c=%{github_commit}; echo ${c:0:7})
%global composer_vendor ocramius
@@ -35,7 +35,6 @@ Version: %{github_version}
Release: 1%{?github_release}%{?dist}
Summary: OOP proxy wrappers utilities
-Group: Development/Libraries
License: MIT
URL: http://ocramius.github.io/ProxyManager/
Source0: %{name}-%{github_version}-%{github_short}.tgz
@@ -48,14 +47,19 @@ Patch0: %{name}-rpm.patch
BuildArch: noarch
# Autoloader
-BuildRequires: %{_bindir}/phpab
+BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
# Tests
## composer.json
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)
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-autoloader(zendframework/zend-code) >= %{zf_min_ver} with php-autoloader(zendframework/zend-code) < %{zf_max_ver})
+# remirepo:4
+%else
+BuildRequires: php-autoloader(zendframework/zend-code) >= %{zf_min_ver}
+BuildRequires: php-autoloader(zendframework/zend-code) < %{zf_max_ver}
+%endif
BuildRequires: php-composer(ocramius/generated-hydrator) >= 2
## phpcompatinfo (computed from version 2.2.0)
BuildRequires: php-pcre
@@ -66,22 +70,28 @@ BuildRequires: phpunit6 >= 6.4.3
# composer.json
Requires: php(language) >= %{php_min_ver}
-Requires: php-composer(zendframework/zend-code) >= %{zf_min_ver}
-Requires: php-composer(zendframework/zend-code) < %{zf_max_ver}
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-autoloader(zendframework/zend-code) >= %{zf_min_ver} with php-autoloader(zendframework/zend-code) < %{zf_max_ver})
+# remirepo:4
+%else
+Requires: php-autoloader(zendframework/zend-code) >= %{zf_min_ver}
+Requires: php-autoloader(zendframework/zend-code) < %{zf_max_ver}
+%endif
# phpcompatinfo (computed from version 2.2.0)
Requires: php-pcre
Requires: php-reflection
Requires: php-spl
# Autoloader
-Requires: php-composer(zendframework/zend-loader)
+Requires: php-composer(fedora/autoloader)
# Weak dependencies
%if 0%{?fedora} >= 21
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)
+Suggests: php-autoloader(zendframework/zend-json)
+Suggests: php-autoloader(zendframework/zend-soap)
+Suggests: php-autoloader(zendframework/zend-stdlib)
+Suggests: php-autoloader(zendframework/zend-xmlrpc)
%endif
# For autoloader
Conflicts: php-ocramius-generated-hydrator < 2
@@ -109,21 +119,20 @@ grep ' return' src/ProxyManager/Version.php
%build
: Generate autoloader
-%{_bindir}/phpab --output src/ProxyManager/autoload.php src/ProxyManager
+%{_bindir}/phpab --template fedora --output src/ProxyManager/autoload.php src/ProxyManager
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;
- }
-}
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/Zend/Code/autoload.php',
+]);
+\Fedora\Autoloader\Dependencies::optional([
+ '%{phpdir}/GeneratedHydrator/autoload.php',
+ '%{phpdir}/Zend/Json/autoload.php',
+ '%{phpdir}/Zend/Soap/autoload.php',
+ '%{phpdir}/Zend/Stdlib/autoload.php',
+ '%{phpdir}/Zend/XmlRpc/autoload.php',
+]);
AUTOLOAD
@@ -142,13 +151,22 @@ require_once '%{buildroot}%{phpdir}/ProxyManager/autoload.php';
EOF
: Run tests
-%{_bindir}/phpunit6 --verbose
+# TODO 7.4
+RETURN_CODE=0
+for PHP_EXEC in php php72 php73; do
+ if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC %{_bindir}/phpunit6 --verbose \
+ || RETURN_CODE=1
+ fi
+done
+exit $RETURN_CODE
%else
: Tests skipped
%endif
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -157,6 +175,10 @@ EOF
%changelog
+* Thu Aug 29 2019 Remi Collet <remi@remirepo.net> - 2.2.2-1
+- update to 2.2.2
+- use zendframework component autoloaders instead of framework one
+
* Fri Nov 17 2017 Remi Collet <remi@remirepo.net> - 2.2.0-1
- Update to 2.2.0
- raise dependency on PHP 7.2