summaryrefslogtreecommitdiffstats
path: root/php-cakephp4.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-12-16 13:30:09 +0100
committerRemi Collet <remi@remirepo.net>2019-12-16 13:30:09 +0100
commitcfddc0249872e87d0aaceec4bbc5018d5d37d0f7 (patch)
tree007ea03e426ef78db7ca7e8f9f0524780dd1a389 /php-cakephp4.spec
parenta0a57f9df7a9f23a5109ef9398f180e433f7f8de (diff)
add I18n
Diffstat (limited to 'php-cakephp4.spec')
-rw-r--r--php-cakephp4.spec72
1 files changed, 68 insertions, 4 deletions
diff --git a/php-cakephp4.spec b/php-cakephp4.spec
index a11721a..368e015 100644
--- a/php-cakephp4.spec
+++ b/php-cakephp4.spec
@@ -7,7 +7,7 @@
# Please, preserve the changelog entries
#
-# TODO: Http, Form, I18n, ORM, Validation
+# TODO: Http, Form, ORM, Validation
# Auth, Command, Controller, Error, Mailer, Network, Routing, Shell, TestSuite, View
# https://github.com/cakephp/cakephp/releases
@@ -134,7 +134,7 @@ Requires: php-ctype
Requires: php-date
Requires: php-pcre
Requires: php-spl
-Provides: php-composer(%{pk_vendor}/chronos) = %{version}
+Provides: php-composer(%{pk_vendor}/chronos) = %{chronos_version}
%description chronos
CakePHP Chronos Library:
@@ -336,6 +336,41 @@ CakePHP FileSystem Library:
CakePHP filesystem convenience classes to help you work with files and folders.
+%package i18n
+Summary: CakePHP I18n Library
+# From composer.json "require": {
+# "php": ">=7.2.0",
+# "ext-intl": "*",
+# "cakephp/core": "^4.0",
+# "cakephp/chronos": "^2.0.0",
+# "aura/intl": "^3.0.0"
+Requires: php(language) >= 7.2
+Requires: php-intl
+Requires: php-composer(%{pk_vendor}/core) = %{version}
+Requires: php-composer(%{pk_vendor}/chronos) = %{chronos_version}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(aura/intl) >= 3.0.0 with php-composer(aura/intl) < 4)
+Requires: (php-composer(aura/intl) >= 3.0.0 with php-composer(aura/intl) < 4)
+%else
+BuildRequires: php-aura-intl >= 3.0.0
+Requires: php-aura-intl >= 3.0.0
+%endif
+# From phpcompatinfo report
+Requires: php-date
+Requires: php-pcre
+Requires: php-spl
+Provides: php-composer(%{pk_vendor}/i18n) = %{version}
+
+%description i18n
+CakePHP I18n Library:
+
+The I18n library provides a `I18n` service locator that can be used for setting
+the current locale, building translation bundles and translating messages.
+
+Additionally, it provides the `Time` and `Number` classes which can be used to
+output dates, currencies and any numbers in the right format for the specified locale.
+
+
%package log
Summary: logging library
# From composer.json "require": {
@@ -536,6 +571,20 @@ require_once '%{php_home}/Fedora/Autoloader/autoload.php';
]);
EOF
+: ===== Generate "i18n" autoloader
+cat << 'EOF' | tee src/I18n/autoload.php
+<?php
+require_once '%{php_home}/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('Cake\\I18n\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required([
+ dirname(__DIR__) . '/Core/autoload.php',
+ dirname(__DIR__) . '/Chronos/autoload.php',
+ '%{php_home}/Aura/Intl/autoload.php',
+ __DIR__ . '/functions.php',
+]);
+EOF
+
: ===== Generate "log" autoloader
cat << 'EOF' | tee src/Log/autoload.php
<?php
@@ -564,7 +613,7 @@ EOF
%install
#: Library
mkdir -p %{buildroot}%{php_home}/%{ns_vendor}%{major}
-for dir in Cache Chronos Collection Console Core Database Datasource Event Filesystem Log Utility; do
+for dir in Cache Chronos Collection Console Core Database Datasource Event Filesystem I18n Log Utility; do
cp -pr src/$dir %{buildroot}%{php_home}/%{ns_vendor}%{major}/
done
@@ -609,6 +658,10 @@ require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/Filesystem/autoload.php";
exit (class_exists("Cake\\Filesystem\\File") ? 0 : 1);
'
php -r '
+require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/I18n/autoload.php";
+exit (class_exists("Cake\\I18n\\Date") ? 0 : 1);
+'
+php -r '
require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/Log/autoload.php";
exit (class_exists("Cake\\Log\\Log") ? 0 : 1);
'
@@ -633,6 +686,7 @@ phpunit8 tests/TestCase/Datasource --verbose || ret=1
%endif
phpunit8 tests/TestCase/Event --verbose || ret=1
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
exit $ret
@@ -729,6 +783,16 @@ exit $ret
%exclude %{php_home}/%{ns_vendor}%{major}/Filesystem/composer.json
%exclude %{php_home}/%{ns_vendor}%{major}/Filesystem/LICENSE.txt
+%files i18n
+%{!?_licensedir:%global license %%doc}
+%license src/I18n/LICENSE.txt
+%doc src/I18n/composer.json
+%doc src/I18n/*md
+%{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
+
%files log
%{!?_licensedir:%global license %%doc}
%license src/Log/LICENSE.txt
@@ -755,7 +819,7 @@ exit $ret
- update to 4.0.0
- raise dependency on PHP 7.2
- use Chronos 2.0.1
-- add Chronos, Console and Filesystem
+- add Chronos, Console, Filesystem and I18n
* Mon Dec 9 2019 Remi Collet <remi@remirepo.net> - 3.8.7-1
- update to 3.8.7