diff options
| author | Remi Collet <remi@remirepo.net> | 2020-01-07 16:18:56 +0100 | 
|---|---|---|
| committer | Remi Collet <remi@remirepo.net> | 2020-01-07 16:18:56 +0100 | 
| commit | b7442c0b9dc1e1afad1d1405c4afb4868a9940da (patch) | |
| tree | 13e6284d76859c0dc8f13feb5e9c58039eb10cca | |
| parent | 50b8d9406e6c32bc939b8c885e69e975c5643824 (diff) | |
switch to Laminas
| -rw-r--r-- | composer.json | 54 | ||||
| -rw-r--r-- | php-laminas-crypt.spec | 136 | 
2 files changed, 103 insertions, 87 deletions
diff --git a/composer.json b/composer.json index 58dc8d2..a1c6bea 100644 --- a/composer.json +++ b/composer.json @@ -1,37 +1,47 @@  { -    "name": "zendframework/zend-crypt", +    "name": "laminas/laminas-crypt",      "description": "Strong cryptography tools and password hashing",      "license": "BSD-3-Clause",      "keywords": [ -        "zf", -        "zendframework", +        "laminas",          "crypt"      ], +    "homepage": "https://laminas.dev",      "support": { -        "docs": "https://docs.zendframework.com/zend-crypt/", -        "issues": "https://github.com/zendframework/zend-crypt/issues", -        "source": "https://github.com/zendframework/zend-crypt", -        "rss": "https://github.com/zendframework/zend-crypt/releases.atom", -        "chat": "https://zendframework-slack.herokuapp.com", -        "forum": "https://discourse.zendframework.com/c/questions/components" +        "docs": "https://docs.laminas.dev/laminas-crypt/", +        "issues": "https://github.com/laminas/laminas-crypt/issues", +        "source": "https://github.com/laminas/laminas-crypt", +        "rss": "https://github.com/laminas/laminas-crypt/releases.atom", +        "chat": "https://laminas.dev/chat", +        "forum": "https://discourse.laminas.dev" +    }, +    "config": { +        "sort-packages": true +    }, +    "extra": { +        "branch-alias": { +            "dev-master": "3.3.x-dev", +            "dev-develop": "3.4.x-dev" +        }      },      "require": {          "php": "^5.6 || ^7.0",          "ext-mbstring": "*",          "container-interop/container-interop": "^1.2", -        "zendframework/zend-math": "^3.0", -        "zendframework/zend-stdlib": "^2.7.7 || ^3.1" +        "laminas/laminas-math": "^3.0", +        "laminas/laminas-stdlib": "^2.7.7 || ^3.1", +        "laminas/laminas-zendframework-bridge": "^1.0"      },      "require-dev": { -        "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", -        "zendframework/zend-coding-standard": "~1.0.0" +        "laminas/laminas-coding-standard": "~1.0.0", +        "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2"      },      "suggest": { -        "ext-openssl": "Required for most features of Zend\\Crypt" +        "ext-openssl": "Required for most features of Laminas\\Crypt"      },      "autoload": {          "psr-4": { -            "Zend\\Crypt\\": "src/" +            "Laminas\\Crypt\\": "src/"          }      },      "autoload-dev": { @@ -39,16 +49,7 @@              "test/_autoload.php"          ],          "psr-4": { -            "ZendTest\\Crypt\\": "test/" -        } -    }, -    "config": { -        "sort-packages": true -    }, -    "extra": { -        "branch-alias": { -            "dev-master": "3.3.x-dev", -            "dev-develop": "3.4.x-dev" +            "LaminasTest\\Crypt\\": "test/"          }      },      "scripts": { @@ -60,5 +61,8 @@          "cs-fix": "phpcbf",          "test": "phpunit --colors=always",          "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" +    }, +    "replace": { +        "zendframework/zend-crypt": "self.version"      }  } diff --git a/php-laminas-crypt.spec b/php-laminas-crypt.spec index d730506..c2aec92 100644 --- a/php-laminas-crypt.spec +++ b/php-laminas-crypt.spec @@ -1,4 +1,4 @@ -# remirepo/Fedora spec file for php-zendframework-zend-crypt +# remirepo/Fedora spec file for php-laminas-crypt  #  # 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    cf23da2731dabdbb916cf888f611fc0f123bd36b +%global gh_commit    5f5dfe3ca08c965cc1f44f95831a83a81a93bf78  %global gh_short     %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner     zendframework -%global gh_project   zend-crypt +%global gh_owner     laminas +%global gh_project   laminas-crypt +%global zf_name      zend-crypt  %global php_home     %{_datadir}/php +%global namespace    Laminas  %global library      Crypt  %if %{bootstrap}  %global with_tests   0%{?_with_tests:1} @@ -19,20 +21,16 @@  %global with_tests   0%{!?_without_tests:1}  %endif -Name:           php-%{gh_owner}-%{gh_project} +Name:           php-%{gh_project}  Version:        3.3.1  Release:        1%{?dist} -Summary:        Zend Framework %{library} component +Summary:        Laminas 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 -# remirepo:3 -# For test build on all available arch -#global debug_package %%{nil} -#global __debug_install_post /bin/true  BuildArch:      noarch  # Tests  %if %{with_tests} @@ -43,26 +41,24 @@ BuildRequires:  php-openssl  BuildRequires:  php-pcre  BuildRequires:  php-spl  # From composer, "require-dev": { -#        "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", -#        "zendframework/zend-coding-standard": "~1.0.0" +#        "laminas/laminas-coding-standard": "~1.0.0", +#        "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2"  # remirepo:1  %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires:  (php-composer(container-interop/container-interop) >= 1.2   with php-composer(container-interop/container-interop) < 2) -BuildRequires:  (php-autoloader(%{gh_owner}/zend-math)             >= 3.0   with php-autoloader(%{gh_owner}/zend-math)             < 4) -BuildRequires:  (php-autoloader(%{gh_owner}/zend-stdlib)           >= 2.7.7 with php-autoloader(%{gh_owner}/zend-stdlib)           < 4) -%global phpunit %{_bindir}/phpunit7 -BuildRequires:  phpunit7 >= 7.1.2 -# remirepo:10 +BuildRequires: (php-composer(container-interop/container-interop)      >= 1.2   with php-composer(container-interop/container-interop)      < 2) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-math)               >= 3.0   with php-autoloader(%{gh_owner}/laminas-math)               < 4) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-stdlib)             >= 3.1   with php-autoloader(%{gh_owner}/laminas-stdlib)             < 4) +BuildRequires: (php-composer(%{gh_owner}/laminas-zendframework-bridge) >= 1.0   with php-composer(%{gh_owner}/laminas-zendframework-bridge) < 2) +# remirepo:7  %else  BuildRequires:  php-composer(container-interop/container-interop) <  2  BuildRequires:  php-composer(container-interop/container-interop) >= 1.2 -BuildRequires:  php-autoloader(%{gh_owner}/zend-math)             <  4 -BuildRequires:  php-autoloader(%{gh_owner}/zend-math)             >= 3.0 -BuildRequires:  php-autoloader(%{gh_owner}/zend-stdlib)           <  4 -BuildRequires:  php-autoloader(%{gh_owner}/zend-stdlib)           >= 2.7.7 -%global phpunit %{_bindir}/phpunit6 -BuildRequires:  phpunit6 >= 6.5.8 +BuildRequires:  php-laminas-math +BuildRequires:  php-laminas-stdlib +BuildRequires:  php-laminas-zendframework-bridge  %endif +%global phpunit %{_bindir}/phpunit7 +BuildRequires:  phpunit7 >= 7.1.2  %endif  # Autoloader  BuildRequires:  php-fedora-autoloader-devel @@ -71,48 +67,48 @@ BuildRequires:  php-fedora-autoloader-devel  #        "php": "^5.6 || ^7.0",  #        "ext-mbstring": "*",  #        "container-interop/container-interop": "^1.2", -#        "zendframework/zend-math": "^3.0", -#        "zendframework/zend-stdlib": "^2.7.7 || ^3.1" +#        "laminas/laminas-math": "^3.0", +#        "laminas/laminas-stdlib": "^2.7.7 || ^3.1", +#        "laminas/laminas-zendframework-bridge": "^1.0"  Requires:       php(language) >= 5.6  Requires:       php-mbstring  %if ! %{bootstrap}  # remirepo:1  %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires:       (php-composer(container-interop/container-interop) >= 1.2   with php-composer(container-interop/container-interop) < 2) -Requires:       (php-autoloader(%{gh_owner}/zend-math)             >= 3.0   with php-autoloader(%{gh_owner}/zend-math)             < 4) -Requires:       (php-autoloader(%{gh_owner}/zend-stdlib)           >= 2.7.7 with php-autoloader(%{gh_owner}/zend-stdlib)           < 4) -# remirepo:8 +Requires:      (php-composer(container-interop/container-interop)      >= 1.2   with php-composer(container-interop/container-interop)      < 2) +Requires:      (php-autoloader(%{gh_owner}/laminas-math)               >= 3.0   with php-autoloader(%{gh_owner}/laminas-math)               < 4) +Requires:      (php-autoloader(%{gh_owner}/laminas-stdlib)             >= 3.1   with php-autoloader(%{gh_owner}/laminas-stdlib)             < 4) +Requires:      (php-composer(%{gh_owner}/laminas-zendframework-bridge) >= 1.0   with php-composer(%{gh_owner}/laminas-zendframework-bridge) < 2) +# remirepo:7  %else  Requires:       php-composer(container-interop/container-interop) <  2  Requires:       php-composer(container-interop/container-interop) >= 1.2 -Requires:       php-autoloader(%{gh_owner}/zend-math)             <  4 -Requires:       php-autoloader(%{gh_owner}/zend-math)             >= 3.0 -Requires:       php-autoloader(%{gh_owner}/zend-stdlib)           <  4 -Requires:       php-autoloader(%{gh_owner}/zend-stdlib)           >= 2.7.7 +Requires:       php-laminas-math +Requires:       php-laminas-stdlib +Requires:       php-laminas-zendframework-bridge  %endif  # From composer, "suggest": { -#        "ext-openssl": "Required for most features of Zend\\Crypt" +#        "ext-openssl": "Required for most features of Laminas\\Crypt"  Requires:       php-openssl  # Autoloader  Requires:       php-composer(fedora/autoloader)  %endif -# From phpcompatinfo report for version 3.1.0 +# From phpcompatinfo report for version 3.3.1  Requires:       php-hash  Requires:       php-pcre  Requires:       php-spl -# remirepo:3 -%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 -Suggests:       php-pecl(scrypt) -%endif -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}              < 3.3.1-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\Crypt provides support of some cryptographic tools. +%{gh_project} provides support of some cryptographic tools.  The available features are:  * encrypt-then-authenticate using symmetric ciphers    (the authentication step is provided using HMAC); @@ -128,7 +124,7 @@ The available features are:  The main scope of this component is to offer an easy and secure way  to protect and authenticate sensitive data in PHP. -Documentation: https://zendframework.github.io/%{gh_project}/ +Documentation: https://docs.laminas.dev/%{gh_project}/  %prep @@ -137,28 +133,34 @@ Documentation: https://zendframework.github.io/%{gh_project}/  mv LICENSE.md LICENSE  %build -: Create dependency autoloader - deprecated -cat << 'EOF' | tee autoload.php -<?php -require_once '%{php_home}/Interop/Container/autoload.php'; -EOF -  : Create autoloader  phpab --template fedora --output src/autoload.php src  cat << 'EOF' | tee -a src/autoload.php  \Fedora\Autoloader\Dependencies::required([ -    '%{php_home}/Zend/Math/autoload.php', -    '%{php_home}/Zend/Stdlib/autoload.php', +    '%{php_home}/%{namespace}/Math/autoload.php', +    '%{php_home}/%{namespace}/Stdlib/autoload.php',      '%{php_home}/Interop/Container/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} -install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php +: Zend equiv +mkdir -p      %{buildroot}%{php_home}/Zend/%{library} +cp -pr zf.php %{buildroot}%{php_home}/Zend/%{library}/autoload.php  %check @@ -166,19 +168,26 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php  mkdir vendor  cat << 'EOF' | tee vendor/autoload.php  <?php -require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php'; -\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); +require_once '%{buildroot}%{php_home}/%{namespace}/%{library}/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('%{namespace}Test\\%{library}\\', dirname(__DIR__) . '/test');  EOF  ret=0 -for cmdarg in "php %{phpunit}" php71 php72; do +for cmdarg in "php %{phpunit}" php72 php73 php74; do    if which $cmdarg; then      set $cmdarg      $1 ${2:-%{_bindir}/phpunit7} \ -      --filter '^((?!(testCcmEncryptWithTagSize)).)*$' \ +      --filter '^((?!(testCcmEncryptWithTagSize|testIsSupportedAndCache)).)*$' \        --verbose || ret=1    fi  done + +: check compat autoloader +php -r ' +require "%{buildroot}%{php_home}/Zend/%{library}/autoload.php"; +return (class_exists("\\Zend\\%{library}\\Hash") ? 0 : 1); +' +  exit $ret  %else  : Test suite disabled @@ -191,10 +200,13 @@ exit $ret  %doc *.md  %doc composer.json  %{php_home}/Zend/%{library} -%{php_home}/Zend/%{library}-autoload.php +%{php_home}/%{namespace}/%{library}  %changelog +* Tue Jan  7 2020 Remi Collet <remi@remirepo.net> - 3.3.1-1 +- switch to Laminas +  * Wed May 15 2019 Remi Collet <remi@remirepo.net> - 3.3.1-1  - update to 3.3.1  | 
