summaryrefslogtreecommitdiffstats
path: root/php-laminas-console.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-01-10 09:16:41 +0100
committerRemi Collet <remi@remirepo.net>2020-01-10 09:16:41 +0100
commit6747f80bf74287ad12a80e5e118b6c49a51c8f91 (patch)
tree1f1982c82c1382563c2b5c05a3cb3e74af43a295 /php-laminas-console.spec
parentabfceb747316e4b7e0a0e7e3abc841975574a10e (diff)
switch to Laminas
Diffstat (limited to 'php-laminas-console.spec')
-rw-r--r--php-laminas-console.spec128
1 files changed, 80 insertions, 48 deletions
diff --git a/php-laminas-console.spec b/php-laminas-console.spec
index ba3c3bb..857b576 100644
--- a/php-laminas-console.spec
+++ b/php-laminas-console.spec
@@ -1,4 +1,4 @@
-# remirepo/Fedora spec file for php-zendframework-zend-console
+# remirepo/Fedora spec file for php-laminas-console
#
# Copyright (c) 2015-2020 Remi Collet
# License: CC-BY-SA
@@ -7,11 +7,13 @@
# Please, preserve the changelog entries
#
%global bootstrap 0
-%global gh_commit 95817ae78f73c48026972e350a2ecc31c6d9f9ae
+%global gh_commit 478a6ceac3e31fb38d6314088abda8b239ee23a5
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
-%global gh_owner zendframework
-%global gh_project zend-console
+%global gh_owner laminas
+%global gh_project laminas-console
+%global zf_name zend-console
%global php_home %{_datadir}/php
+%global namespace Laminas
%global library Console
%if %{bootstrap}
%global with_tests 0%{?_with_tests:1}
@@ -19,13 +21,13 @@
%global with_tests 0%{!?_without_tests:1}
%endif
-Name: php-%{gh_owner}-%{gh_project}
+Name: php-%{gh_project}
Version: 2.8.0
Release: 1%{?dist}
-Summary: Zend Framework %{library} component
+Summary: %{namespace} Framework %{library} component
License: BSD
-URL: https://zendframework.github.io/%{gh_project}/
+URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
@@ -41,49 +43,49 @@ BuildRequires: php-spl
BuildRequires: php-xml
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/zend-stdlib) < 4)
+BuildRequires: (php-autoloader(%{gh_owner}/laminas-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/laminas-stdlib) < 4)
+BuildRequires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2)
# From composer, "require-dev": {
-# "phpunit/phpunit": "^5.7.23 || ^6.4.3",
-# "zendframework/zend-coding-standard": "~1.0.0",
-# "zendframework/zend-filter": "^2.7.2",
-# "zendframework/zend-json": "^2.6 || ^3.0",
-# "zendframework/zend-validator": "^2.10.1"
-BuildRequires: (php-autoloader(%{gh_owner}/zend-filter) >= 2.7.2 with php-autoloader(%{gh_owner}/zend-filter) < 3)
-BuildRequires: (php-autoloader(%{gh_owner}/zend-json) >= 2.6 with php-autoloader(%{gh_owner}/zend-json) < 4)
-BuildRequires: (php-autoloader(%{gh_owner}/zend-validator) >= 2.10.1 with php-autoloader(%{gh_owner}/zend-validator) < 3)
-# remirepo:10
+# "laminas/laminas-coding-standard": "~1.0.0",
+# "laminas/laminas-filter": "^2.7.2",
+# "laminas/laminas-json": "^2.6 || ^3.0",
+# "laminas/laminas-validator": "^2.10.1",
+# "phpunit/phpunit": "^5.7.23 || ^6.4.3"
+BuildRequires: (php-autoloader(%{gh_owner}/laminas-filter) >= 2.7.2 with php-autoloader(%{gh_owner}/laminas-filter) < 3)
+BuildRequires: (php-autoloader(%{gh_owner}/laminas-json) >= 2.6 with php-autoloader(%{gh_owner}/laminas-json) < 4)
+BuildRequires: (php-autoloader(%{gh_owner}/laminas-validator) >= 2.10.1 with php-autoloader(%{gh_owner}/laminas-validator) < 3)
+# remirepo:7
%else
-BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) < 4
-BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1
-BuildRequires: php-autoloader(%{gh_owner}/zend-filter) < 3
-BuildRequires: php-autoloader(%{gh_owner}/zend-filter) >= 2.7.2
-BuildRequires: php-autoloader(%{gh_owner}/zend-json) < 4
-BuildRequires: php-autoloader(%{gh_owner}/zend-json) >= 2.6
-BuildRequires: php-autoloader(%{gh_owner}/zend-validator) < 3
-BuildRequires: php-autoloader(%{gh_owner}/zend-validator) >= 2.10.1
+BuildRequires: php-laminas-stdlib
+BuildRequires: php-laminas-filter
+BuildRequires: php-laminas-json
+BuildRequires: php-laminas-validator
+BuildRequires: php-laminas-zendframework-bridge
%endif
-BuildRequires: phpunit6 >= 6.4.3
+BuildRequires: phpunit6 >= 6.4.3
%endif
# Autoloader
BuildRequires: php-fedora-autoloader-devel
# From composer, "require": {
# "php": "^5.6 || ^7.0",
-# "zendframework/zend-stdlib": "^3.2.1"
+# "laminas/laminas-stdlib": "^3.2.1",
+# "laminas/laminas-zendframework-bridge": "^1.0"
Requires: php(language) >= 5.6
%if ! %{bootstrap}
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/zend-stdlib) < 4)
+Requires: (php-autoloader(%{gh_owner}/laminas-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/laminas-stdlib) < 4)
+Requires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2)
# From composer, "suggest": {
-# "zendframework/zend-validator": "To support DefaultRouteMatcher usage",
-# "zendframework/zend-filter": "To support DefaultRouteMatcher usage"
-Suggests: php-autoloader(%{gh_owner}/zend-validator)
-Suggests: php-autoloader(%{gh_owner}/zend-filter)
+# "laminas/laminas-filter": "To support DefaultRouteMatcher usage",
+# "laminas/laminas-validator": "To support DefaultRouteMatcher usage"
+Suggests: php-autoloader(%{gh_owner}/laminas-validator)
+Suggests: php-autoloader(%{gh_owner}/laminas-filter)
# remirepo:4
%else
-Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4
-Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1
+Requires: php-laminas-stdlib
+Requires: php-laminas-zendframework-bridge
%endif
%endif
# Autoloader
@@ -96,16 +98,20 @@ Requires: php-reflection
Requires: php-spl
Requires: php-xml
-Obsoletes: php-ZendFramework2-%{library} < 2.5
-Provides: php-ZendFramework2-%{library} = %{version}
-Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+# Compatibily ensure by the bridge
+Obsoletes: php-zendframework-%{zf_name} < 2.8.0-99
+Provides: php-zendframework-%{zf_name} = %{version}-99
+Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-composer(zendframework/%{zf_name}) = %{version}
Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
+Provides: php-autoloader(zendframework/%{zf_name}) = %{version}
%description
-Zend\Console is a component to design and implement console applications in PHP.
+%{namespace}\Console is a component to design and implement console
+applications in PHP.
-Documentation: https://zendframework.github.io/%{gh_project}/
+Documentation: https://docs.laminas.dev/%{gh_project}/
%prep
@@ -118,18 +124,32 @@ mv LICENSE.md LICENSE
phpab --template fedora --output src/autoload.php src
cat << 'EOF' | tee -a src/autoload.php
\Fedora\Autoloader\Dependencies::required([
- '%{php_home}/Zend/Stdlib/autoload.php',
+ '%{php_home}/%{namespace}/Stdlib/autoload.php',
]);
\Fedora\Autoloader\Dependencies::optional([
- '%{php_home}/Zend/Validator/autoload.php',
- '%{php_home}/Zend/Filter/autoload.php',
+ '%{php_home}/%{namespace}/Validator/autoload.php',
+ '%{php_home}/%{namespace}/Filter/autoload.php',
+]);
+EOF
+
+cat << 'EOF' | tee zf.php
+<?php
+require_once '%{php_home}/Fedora/Autoloader/autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{php_home}/%{namespace}/ZendFrameworkBridge/autoload.php',
+ dirname(dirname(__DIR__)) . '/%{namespace}/%{library}/autoload.php',
]);
EOF
%install
-mkdir -p %{buildroot}%{php_home}/Zend/
-cp -pr src %{buildroot}%{php_home}/Zend/%{library}
+: Laminas library
+mkdir -p %{buildroot}%{php_home}/%{namespace}/
+cp -pr src %{buildroot}%{php_home}/%{namespace}/%{library}
+
+: Zend equiv
+mkdir -p %{buildroot}%{php_home}/Zend/%{library}
+cp -pr zf.php %{buildroot}%{php_home}/Zend/%{library}/autoload.php
%check
@@ -137,15 +157,22 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library}
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
-require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
+require_once '%{buildroot}%{php_home}/%{namespace}/%{library}/autoload.php';
\Fedora\Autoloader\Dependencies::required([
- '%{php_home}/Zend/Json/autoload.php',
+ '%{php_home}/%{namespace}/Json/autoload.php',
]);
-\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
+\Fedora\Autoloader\Autoload::addPsr4('%{namespace}Test\\%{library}\\', dirname(__DIR__) . '/test');
EOF
+: check compat autoloader
+php -r '
+require "%{buildroot}%{php_home}/Zend/%{library}/autoload.php";
+return (class_exists("\\Zend\\%{library}\\Message") ? 0 : 1);
+'
+
+: upstream test suite
ret=0
-for cmd in php php70 php71 php72 php73 php74; do
+for cmd in php php72 php73 php74; do
if which $cmd; then
$cmd %{_bindir}/phpunit6 || ret=1
fi
@@ -157,14 +184,19 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc composer.json
%{php_home}/Zend/%{library}
+%{php_home}/%{namespace}/%{library}
%changelog
+* Fri Jan 10 2020 Remi Collet <remi@remirepo.net> - 2.8.0-1
+- switch to Laminas
+
* Tue Feb 5 2019 Remi Collet <remi@remirepo.net> - 2.8.0-1
- update to 2.8.0
- raise dependency on zend-stdlib 3.2.1