diff options
| -rw-r--r-- | composer.json | 33 | ||||
| -rw-r--r-- | php-laminas-mvc-form.spec | 138 | 
2 files changed, 121 insertions, 50 deletions
| diff --git a/composer.json b/composer.json index cfd7287..69334b7 100644 --- a/composer.json +++ b/composer.json @@ -1,26 +1,41 @@  { -    "name": "zendframework/zend-mvc-form", -    "description": "Metapackage with all requirements needed to use zend-form with zend-mvc.", +    "name": "laminas/laminas-mvc-form", +    "description": "Metapackage with all requirements needed to use laminas-form with laminas-mvc.",      "type": "metapackage",      "license": "BSD-3-Clause",      "keywords": [ -        "zf2", +        "laminas",          "mvc",          "form"      ], -    "homepage": "https://github.com/zendframework/zend-mvc-form", +    "homepage": "https://laminas.dev", +    "support": { +        "docs": "https://docs.laminas.dev/laminas-mvc-form/", +        "issues": "https://github.com/laminas/laminas-mvc-form/issues", +        "source": "https://github.com/laminas/laminas-mvc-form", +        "rss": "https://github.com/laminas/laminas-mvc-form/releases.atom", +        "chat": "https://laminas.dev/chat", +        "forum": "https://discourse.laminas.dev" +    }, +    "config": { +        "sort-packages": true +    },      "extra": {          "branch-alias": {              "dev-master": "1.0-dev"          }, -        "zf": { -            "component": "Zend\\Form" +        "laminas": { +            "component": "Laminas\\Form"          }      },      "require": {          "php": "^5.6 || ^7.0", -        "zendframework/zend-code": "^2.6.3 || ^3.0.2", -        "zendframework/zend-form": "^2.8.4", -        "zendframework/zend-i18n": "^2.7.2" +        "laminas/laminas-code": "^2.6.3 || ^3.0.2", +        "laminas/laminas-form": "^2.8.4", +        "laminas/laminas-i18n": "^2.7.2", +        "laminas/laminas-zendframework-bridge": "^1.0" +    }, +    "replace": { +        "zendframework/zend-mvc-form": "self.version"      }  } diff --git a/php-laminas-mvc-form.spec b/php-laminas-mvc-form.spec index 1028b5e..b8a0009 100644 --- a/php-laminas-mvc-form.spec +++ b/php-laminas-mvc-form.spec @@ -1,68 +1,93 @@ -# remirepo/Fedora spec file for php-zendframework-zend-mvc-form +# remirepo/Fedora spec file for php-laminas-mvc-form  # -# Copyright (c) 2016-2018 Remi Collet +# Copyright (c) 2016-2020 Remi Collet  # License: CC-BY-SA  # http://creativecommons.org/licenses/by-sa/4.0/  #  # Please, preserve the changelog entries  # -%global gh_commit    28bf47ce6661fd71f1b8d68f9b6bc8f841f6aeb0 +%global gh_commit    42254dd6d6d221f0825e79b1811bc734027908ed  %global gh_short     %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner     zendframework -%global gh_project   zend-mvc-form +%global gh_owner     laminas +%global gh_project   laminas-mvc-form +%global zf_name      zend-mvc-form  %global php_home     %{_datadir}/php -%global library      Form +%global namespace    Laminas +%global library      Mvc +%global subproj      Form -Name:           php-%{gh_owner}-%{gh_project} +Name:           php-%{gh_project}  Version:        1.0.0 -Release:        5%{?dist} -Summary:        Zend Framework Mvc-Form component +Release:        1%{?dist} +Summary:        %{namespace} Framework %{library}/%{subproj} component  License:        BSD -URL:            https://framework.zend.com/ +URL:            https://github.com/%{gh_owner}/%{gh_project}  Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz  BuildArch:      noarch  # For test  BuildRequires:  php-cli -BuildRequires:  php-autoloader(%{gh_owner}/zend-code)             >= 2.6.3 -BuildRequires:  php-autoloader(%{gh_owner}/zend-form)             >= 2.8.4 -BuildRequires:  php-autoloader(%{gh_owner}/zend-i18n)             >= 2.7.2 -# Because of polyfill -BuildRequires:  php-autoloader(%{gh_owner}/zend-servicemanager) +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-autoloader(%{gh_owner}/laminas-code)                 >= 3.0.2  with php-autoloader(%{gh_owner}/laminas-code)                 < 4) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-form)                 >= 2.8.4  with php-autoloader(%{gh_owner}/laminas-form)                 < 3) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-i18n)                 >= 2.7.2  with php-autoloader(%{gh_owner}/laminas-i18n)                 < 3) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0    with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2) +# remirepo:6 +%else +BuildRequires:  php-laminas-code +BuildRequires:  php-laminas-form +BuildRequires:  php-laminas-i18n +BuildRequires:  php-laminas-zendframework-bridge +%endif  # From composer, "require": {  #        "php": "^5.6 || ^7.0", -#        "zendframework/zend-code": "^2.6.3 || ^3.0.2", -#        "zendframework/zend-form": "^2.8.4", -#        "zendframework/zend-i18n": "^2.7.2" +#        "laminas/laminas-code": "^2.6.3 || ^3.0.2", +#        "laminas/laminas-form": "^2.8.4", +#        "laminas/laminas-i18n": "^2.7.2", +#        "laminas/laminas-zendframework-bridge": "^1.0"  Requires:       php(language) >= 5.6 -Requires:       php-autoloader(%{gh_owner}/zend-code)             >= 2.6.3 -Requires:       php-autoloader(%{gh_owner}/zend-code)             <  4 -Requires:       php-autoloader(%{gh_owner}/zend-form)             >= 2.8.4 -Requires:       php-autoloader(%{gh_owner}/zend-form)             <  3 -Requires:       php-autoloader(%{gh_owner}/zend-i18n)             >= 2.7.2 -Requires:       php-autoloader(%{gh_owner}/zend-i18n)             <  3 +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires:      (php-autoloader(%{gh_owner}/laminas-code)                 >= 3.0.2  with php-autoloader(%{gh_owner}/laminas-code)                 < 4) +Requires:      (php-autoloader(%{gh_owner}/laminas-form)                 >= 2.8.4  with php-autoloader(%{gh_owner}/laminas-form)                 < 3) +Requires:      (php-autoloader(%{gh_owner}/laminas-i18n)                 >= 2.7.2  with php-autoloader(%{gh_owner}/laminas-i18n)                 < 3) +Requires:      (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0    with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2) +# remirepo:6 +%else +Requires:       php-laminas-code +Requires:       php-laminas-form +Requires:       php-laminas-i18n +Requires:       php-laminas-zendframework-bridge +%endif  # Autoloader  Requires:       php-composer(fedora/autoloader) -Provides:       php-composer(%{gh_owner}/%{gh_project}) = %{version} +# Compatibily ensure by the bridge +Obsoletes:      php-zendframework-%{zf_name}              < 1.0.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-mvc-form is a metapackage that provides a single package for installing -all packages necessary to fully use zend-form under zend-mvc, including: +%{gh_project} is a metapackage that provides a single package for +installing all packages necessary to fully use laminas-form under laminas-mvc, +including: -* zendframework/zend-code -* zendframework/zend-form -* zendframework/zend-i18n +* laminas/laminas-code +* laminas/laminas-form +* laminas/laminas-i18n -i18n integration: this package only requires zend-i18n, and not zend-mvc-i18n. -This is to allow providing the bare minimum required to use zend-form, as its -base view helper extends from the base zend-i18n view helper. If you want to -provide translations for your form elements, please install zend-mvc-i18n as -well. +i18n integration: this package only requires laminas-i18n, and not +laminas-mvc-i18n. This is to allow providing the bare minimum required +to use laminas-form, as its base view helper extends from the base +laminas-i18n view helper. If you want to provide translations for your +form elements, please install laminas-mvc-i18n as well.  %prep @@ -77,31 +102,62 @@ cat << 'EOF' | tee autoload.php  <?php  require_once '/usr/share/php/Fedora/Autoloader/autoload.php';  \Fedora\Autoloader\Dependencies::required([ -    '%{php_home}/Zend/Code/autoload.php', -    '%{php_home}/Zend/Form/autoload.php', -    '%{php_home}/Zend/I18n/autoload.php', +    '%{php_home}/%{namespace}/Code/autoload.php', +    '%{php_home}/%{namespace}/Form/autoload.php', +    '%{php_home}/%{namespace}/I18n/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(dirname(__DIR__))) . '/%{namespace}/%{library}/%{subproj}/autoload.php',  ]);  EOF  %install -install -Dpm 644 autoload.php %{buildroot}%{php_home}/Zend/Mvc/%{library}/autoload.php +: Laminas library +install -Dpm 644 autoload.php %{buildroot}%{php_home}/%{namespace}/%{library}/%{subproj}/autoload.php +  +: Zend equiv +install -Dpm 644 zf.php %{buildroot}%{php_home}/Zend/%{library}/%{subproj}/autoload.php +  %check  : Ensure autoloader works -php -r 'require "%{buildroot}%{php_home}/Zend/Mvc/%{library}/autoload.php";' +php -r ' +require "%{buildroot}%{php_home}/%{namespace}/%{library}/%{subproj}/autoload.php"; +exit (class_exists("\\%{namespace}\\Form\\Factory") ? 0 : 1); +' + +: check compat autoloader +php -r ' +require "%{buildroot}%{php_home}/Zend/%{library}/%{subproj}/autoload.php"; +exit (class_exists("\\Zend\\Form\\Factory") ? 0 : 1); +'  %files +# remirepo:1  %{!?_licensedir:%global license %%doc}  %license LICENSE  %doc *.md  %doc composer.json -%{php_home}/Zend/Mvc/%{library} +%dir %{php_home}/Zend/%{library} +     %{php_home}/Zend/%{library}/%{subproj} +%dir %{php_home}/%{namespace}/%{library} +     %{php_home}/%{namespace}/%{library}/%{subproj}  %changelog +* Wed Jan 15 2020 Remi Collet <remi@remirepo.net> - 1.0.0-1 +- switch to Laminas +- use range dependencies +  * Tue Dec 12 2017 Remi Collet <remi@remirepo.net> - 1.0.0-5  - switch from zend-loader to fedora/autoloader | 
