diff options
author | Remi Collet <remi@remirepo.net> | 2019-12-16 13:44:43 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-12-16 13:44:43 +0100 |
commit | 5fb9393b9a99aaf4393b2e7f2e0c4e2019ad182e (patch) | |
tree | a4d1c9c4abd6f96f5a102681ea73e1b20f3eef45 /php-cakephp4.spec | |
parent | cfddc0249872e87d0aaceec4bbc5018d5d37d0f7 (diff) |
add Vallidation
Diffstat (limited to 'php-cakephp4.spec')
-rw-r--r-- | php-cakephp4.spec | 106 |
1 files changed, 85 insertions, 21 deletions
diff --git a/php-cakephp4.spec b/php-cakephp4.spec index 368e015..f8e6fad 100644 --- a/php-cakephp4.spec +++ b/php-cakephp4.spec @@ -7,7 +7,7 @@ # Please, preserve the changelog entries # -# TODO: Http, Form, ORM, Validation +# TODO: Http, Form, ORM # Auth, Command, Controller, Error, Mailer, Network, Routing, Shell, TestSuite, View # https://github.com/cakephp/cakephp/releases @@ -39,6 +39,7 @@ Source2: %{name}-chronos-%{chronos_version}-%{chronos_short}.tgz Source3: makesrc2.sh BuildArch: noarch +BuildRequires: php-cli %if %{with_tests} # For tests BuildRequires: php(language) >= 7.2 @@ -63,13 +64,10 @@ BuildRequires: php-spl BuildRequires: phpunit8 >= 8.4.0 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-composer(mikey179/vfsstream) >= 1.6 with php-composer(mikey179/vfsstream) < 6) -BuildRequires: (php-composer(aura/intl) >= 3.0.0 with php-composer(aura/intl) < 4) -BuildRequires: (php-composer(psr/log) >= 1.0.0 with php-composer(psr/log) < 2) BuildRequires: (php-composer(zendframework/zend-diactoros) >= 1.4.0 with php-composer(zendframework/zend-diactoros) < 2) +BuildRequires: glibc-langpack-fr %else BuildRequires: php-mikey179-vfsstream >= 1.6 -BuildRequires: php-aura-intl >= 3.0.0 -BuildRequires: php-PsrLog >= 1.0.0 BuildRequires: php-zendframework-zend-diactoros >= 1.4.0 %endif %endif @@ -380,8 +378,10 @@ Summary: logging library Requires: php(language) >= 7.2 Requires: php-composer(%{pk_vendor}/core) = %{version} %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(psr/log) >= 1.0.0 with php-composer(psr/log) < 2) Requires: (php-composer(psr/log) >= 1.0.0 with php-composer(psr/log) < 2) %else +BuildRequires: php-PsrLog >= 1.0.0 Requires: php-PsrLog >= 1.0.0 %endif # From phpcompatinfo report @@ -422,6 +422,40 @@ This library provides a range of utility classes that are used throughout the CakePHP framework. +%package validation +Summary: CakePHP Validation Classes +# From composer.json "require": { +# "php": ">=7.2.0", +# "cakephp/core": "^4.0", +# "cakephp/utility": "^4.0", +# "psr/http-message": "^1.0.0" +Requires: php(language) >= 7.2 +Requires: php-composer(%{pk_vendor}/core) = %{version} +Requires: php-composer(%{pk_vendor}/utility) = %{version} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(psr/http-message) >= 1.0.0 with php-composer(psr/http-message) < 2) +Requires: (php-composer(psr/http-message) >= 1.0.0 with php-composer(psr/http-message) < 2) +%else +BuildRequires: php-php-psr-http-message >= 1.0.0 +Requires: php-php-psr-http-message >= 1.0.0 +%endif +# From phpcompatinfo report +Requires: php-reflection +Requires: php-fileinfo +Requires: php-filter +Requires: php-intl +Requires: php-mbstring +Requires: php-pcre +Requires: php-spl +Provides: php-composer(%{pk_vendor}/validation) = %{version} + +%description validation +CakePHP validation Classes: + +The validation library in CakePHP provides features to build validators +that can validate arbitrary arrays of data with ease. + + %prep %setup -q -n %{gh_project}-%{gh_commit} -a 2 mv chronos-*/src src/Chronos @@ -455,6 +489,7 @@ require_once '%{php_home}/Fedora/Autoloader/autoload.php'; '%{php_home}/Aura/Intl/autoload.php', '%{php_home}/Psr/Log/autoload.php', '%{php_home}/Psr/SimpleCache/autoload.php', + '%{php_home}/Psr/Http/Message/autoload.php', '%{php_home}/Zend/Diactoros/autoload.php', '%{php_home}/org/bovigo/vfs/autoload.php', ]); @@ -610,16 +645,29 @@ require_once '%{php_home}/Fedora/Autoloader/autoload.php'; EOF +: ===== Generate "validation" autoloader +cat << 'EOF' | tee src/Validation/autoload.php +<?php +require_once '%{php_home}/Fedora/Autoloader/autoload.php'; + +\Fedora\Autoloader\Autoload::addPsr4('Cake\\Validation\\', __DIR__); +\Fedora\Autoloader\Dependencies::required([ + dirname(__DIR__) . '/Core/autoload.php', + dirname(__DIR__) . '/Utility/autoload.php', + '%{php_home}/Psr/Http/Message/autoload.php', +]); +EOF + + %install #: Library mkdir -p %{buildroot}%{php_home}/%{ns_vendor}%{major} -for dir in Cache Chronos Collection Console Core Database Datasource Event Filesystem I18n Log Utility; do +for dir in Cache Chronos Collection Console Core Database Datasource Event Filesystem I18n Log Utility Validation; do cp -pr src/$dir %{buildroot}%{php_home}/%{ns_vendor}%{major}/ done %check -%if %{with_tests} : Check our autoloaders php -r ' require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/Cache/autoload.php"; @@ -669,7 +717,12 @@ php -r ' require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/Utility/autoload.php"; exit (class_exists("Cake\\Utility\\Hash") ? 0 : 1); ' +php -r ' +require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/Validation/autoload.php"; +exit (class_exists("Cake\\Validation\\Validator") ? 0 : 1); +' +%if %{with_tests} : Run upstream test suites export LANG=fr_FR.UTF-8 ret=0 @@ -689,6 +742,7 @@ phpunit8 tests/TestCase/Filesystem --verbose || ret=1 phpunit8 tests/TestCase/I18n --verbose || ret=1 phpunit8 tests/TestCase/Log --verbose || ret=1 phpunit8 tests/TestCase/Utility --verbose || ret=1 +phpunit8 tests/TestCase/Validation --verbose || ret=1 exit $ret %else : Test suite disabled @@ -700,7 +754,7 @@ exit $ret %license LICENSE %doc src/Cache/composer.json %doc src/Cache/*md -%{php_home}/%{ns_vendor}%{major}/Cache + %{php_home}/%{ns_vendor}%{major}/Cache %exclude %{php_home}/%{ns_vendor}%{major}/Cache/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Cache/composer.json @@ -717,8 +771,8 @@ exit $ret %license src/Collection/LICENSE.txt %doc src/Collection/composer.json %doc src/Collection/*md -%dir %{php_home}/%{ns_vendor}%{major} - %{php_home}/%{ns_vendor}%{major}/Collection +%dir %{php_home}/%{ns_vendor}%{major} + %{php_home}/%{ns_vendor}%{major}/Collection %exclude %{php_home}/%{ns_vendor}%{major}/Collection/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Collection/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/Collection/LICENSE.txt @@ -728,7 +782,7 @@ exit $ret %license LICENSE %doc src/Console/composer.json %doc src/Console/*md -%{php_home}/%{ns_vendor}%{major}/Console + %{php_home}/%{ns_vendor}%{major}/Console %exclude %{php_home}/%{ns_vendor}%{major}/Collection/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Collection/composer.json @@ -737,8 +791,8 @@ exit $ret %license src/Core/LICENSE.txt %doc src/Core/composer.json %doc src/Core/*md -%dir %{php_home}/%{ns_vendor}%{major} - %{php_home}/%{ns_vendor}%{major}/Core +%dir %{php_home}/%{ns_vendor}%{major} + %{php_home}/%{ns_vendor}%{major}/Core %exclude %{php_home}/%{ns_vendor}%{major}/Core/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Core/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/Core/LICENSE.txt @@ -748,7 +802,7 @@ exit $ret %license src/Database/LICENSE.txt %doc src/Database/composer.json %doc src/Database/*md -%{php_home}/%{ns_vendor}%{major}/Database + %{php_home}/%{ns_vendor}%{major}/Database %exclude %{php_home}/%{ns_vendor}%{major}/Database/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Database/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/Database/LICENSE.txt @@ -758,7 +812,7 @@ exit $ret %license src/Datasource/LICENSE.txt %doc src/Datasource/composer.json %doc src/Datasource/*md -%{php_home}/%{ns_vendor}%{major}/Datasource + %{php_home}/%{ns_vendor}%{major}/Datasource %exclude %{php_home}/%{ns_vendor}%{major}/Datasource/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Datasource/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/Datasource/LICENSE.txt @@ -768,7 +822,7 @@ exit $ret %license src/Event/LICENSE.txt %doc src/Event/composer.json %doc src/Event/*md -%{php_home}/%{ns_vendor}%{major}/Event + %{php_home}/%{ns_vendor}%{major}/Event %exclude %{php_home}/%{ns_vendor}%{major}/Event/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Event/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/Event/LICENSE.txt @@ -778,7 +832,7 @@ exit $ret %license src/Filesystem/LICENSE.txt %doc src/Filesystem/composer.json %doc src/Filesystem/*md -%{php_home}/%{ns_vendor}%{major}/Filesystem + %{php_home}/%{ns_vendor}%{major}/Filesystem %exclude %{php_home}/%{ns_vendor}%{major}/Filesystem/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Filesystem/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/Filesystem/LICENSE.txt @@ -788,7 +842,7 @@ exit $ret %license src/I18n/LICENSE.txt %doc src/I18n/composer.json %doc src/I18n/*md -%{php_home}/%{ns_vendor}%{major}/I18n + %{php_home}/%{ns_vendor}%{major}/I18n %exclude %{php_home}/%{ns_vendor}%{major}/I18n/*.md %exclude %{php_home}/%{ns_vendor}%{major}/I18n/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/I18n/LICENSE.txt @@ -798,7 +852,7 @@ exit $ret %license src/Log/LICENSE.txt %doc src/Log/composer.json %doc src/Log/*md -%{php_home}/%{ns_vendor}%{major}/Log + %{php_home}/%{ns_vendor}%{major}/Log %exclude %{php_home}/%{ns_vendor}%{major}/Log/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Log/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/Log/LICENSE.txt @@ -808,18 +862,28 @@ exit $ret %license src/Utility/LICENSE.txt %doc src/Utility/composer.json %doc src/Utility/*md -%{php_home}/%{ns_vendor}%{major}/Utility + %{php_home}/%{ns_vendor}%{major}/Utility %exclude %{php_home}/%{ns_vendor}%{major}/Utility/*.md %exclude %{php_home}/%{ns_vendor}%{major}/Utility/composer.json %exclude %{php_home}/%{ns_vendor}%{major}/Utility/LICENSE.txt +%files validation +%{!?_licensedir:%global license %%doc} +%license src/Validation/LICENSE.txt +%doc src/Validation/composer.json +%doc src/Validation/*md + %{php_home}/%{ns_vendor}%{major}/Validation +%exclude %{php_home}/%{ns_vendor}%{major}/Validation/*.md +%exclude %{php_home}/%{ns_vendor}%{major}/Validation/composer.json +%exclude %{php_home}/%{ns_vendor}%{major}/Validation/LICENSE.txt + %changelog * Mon Dec 16 2019 Remi Collet <remi@remirepo.net> - 4.0.0-1 - update to 4.0.0 - raise dependency on PHP 7.2 - use Chronos 2.0.1 -- add Chronos, Console, Filesystem and I18n +- add Chronos, Console, Filesystem, I18n and Validation * Mon Dec 9 2019 Remi Collet <remi@remirepo.net> - 3.8.7-1 - update to 3.8.7 |