Blame php-zendframework-zend-i18n.spec

Remi Collet 00ab3d7
# remirepo/Fedora spec file for php-zendframework-zend-i18n
Remi Collet 00ab3d7
#
d024b87
# Copyright (c) 2015-2018 Remi Collet
Remi Collet 00ab3d7
# License: CC-BY-SA
Remi Collet 00ab3d7
# http://creativecommons.org/licenses/by-sa/4.0/
Remi Collet 00ab3d7
#
Remi Collet 00ab3d7
# Please, preserve the changelog entries
Remi Collet 00ab3d7
#
Remi Collet 5a042fc
%global bootstrap    0
a119e49
%global gh_commit    6d69af5a04e1a4de7250043cb1322f077a0cdb7f
Remi Collet 00ab3d7
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
Remi Collet 00ab3d7
%global gh_owner     zendframework
Remi Collet 00ab3d7
%global gh_project   zend-i18n
Remi Collet 00ab3d7
%global php_home     %{_datadir}/php
Remi Collet 00ab3d7
%global library      I18n
Remi Collet 00ab3d7
%if %{bootstrap}
Remi Collet 00ab3d7
%global with_tests   0%{?_with_tests:1}
Remi Collet 00ab3d7
%else
Remi Collet 00ab3d7
%global with_tests   0%{!?_without_tests:1}
Remi Collet 00ab3d7
%endif
Remi Collet 00ab3d7
Remi Collet 00ab3d7
Name:           php-%{gh_owner}-%{gh_project}
a119e49
Version:        2.9.0
5685aaf
Release:        4%{?dist}
Remi Collet 00ab3d7
Summary:        Zend Framework %{library} component
Remi Collet 00ab3d7
Remi Collet 00ab3d7
License:        BSD
b038034
URL:            https://zendframework.github.io/%{gh_project}/
Remi Collet 00ab3d7
Source0:        %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz
Remi Collet 00ab3d7
Source1:        makesrc.sh
Remi Collet 00ab3d7
Remi Collet 00ab3d7
BuildArch:      noarch
Remi Collet 00ab3d7
# Tests
Remi Collet 00ab3d7
%if %{with_tests}
b038034
BuildRequires:  php(language) >= 5.6
Remi Collet 00ab3d7
BuildRequires:  php-ctype
Remi Collet 00ab3d7
BuildRequires:  php-date
Remi Collet 00ab3d7
BuildRequires:  php-intl
Remi Collet 00ab3d7
BuildRequires:  php-pcre
Remi Collet 00ab3d7
BuildRequires:  php-spl
Remi Collet 00ab3d7
# From composer, "require-dev": {
2e5c20c
#        "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2",
4fd4b4a
#        "zendframework/zend-cache": "^2.6.1",
b038034
#        "zendframework/zend-coding-standard": "~1.0.0",
349a44c
#        "zendframework/zend-config": "^2.6",
349a44c
#        "zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
349a44c
#        "zendframework/zend-filter": "^2.6.1",
349a44c
#        "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
4fd4b4a
#        "zendframework/zend-validator": "^2.6",
b038034
#        "zendframework/zend-view": "^2.6.3"
2e5c20c
BuildRequires:  (php-autoloader(%{gh_owner}/zend-stdlib)         >= 2.7   with php-autoloader(%{gh_owner}/zend-stdlib)         <  4)
2e5c20c
BuildRequires:  (php-composer(%{gh_owner}/zend-cache)            >= 2.6.1 with php-composer(%{gh_owner}/zend-cache)            <  3)
2e5c20c
BuildRequires:  (php-composer(%{gh_owner}/zend-config)           >= 2.6   with php-composer(%{gh_owner}/zend-config)           <  3)
2e5c20c
BuildRequires:  (php-composer(%{gh_owner}/zend-eventmanager)     >= 2.6.2 with php-composer(%{gh_owner}/zend-eventmanager)     <  4)
2e5c20c
BuildRequires:  (php-composer(%{gh_owner}/zend-filter)           >= 2.5   with php-composer(%{gh_owner}/zend-filter)           <  3)
2e5c20c
BuildRequires:  (php-composer(%{gh_owner}/zend-servicemanager)   >= 2.7.5 with php-composer(%{gh_owner}/zend-servicemanager)   <  4)
2e5c20c
BuildRequires:  (php-composer(%{gh_owner}/zend-validator)        >= 2.6   with php-composer(%{gh_owner}/zend-validator)        <  3)
2e5c20c
BuildRequires:  (php-composer(%{gh_owner}/zend-view)             >= 2.6.3 with php-composer(%{gh_owner}/zend-view)             <  3)
2e5c20c
%global phpunit %{_bindir}/phpunit7
2e5c20c
BuildRequires:  phpunit7 >= 7.1.2
Remi Collet 00ab3d7
# Autoloader
Remi Collet 00ab3d7
BuildRequires:  php-composer(%{gh_owner}/zend-loader)           >= 2.5
Remi Collet 00ab3d7
%endif
d024b87
BuildRequires:  php-fedora-autoloader-devel
Remi Collet 00ab3d7
Remi Collet 00ab3d7
# From composer, "require": {
2e5c20c
#        "php": "^5.6 || ^7.0",
349a44c
#        "zendframework/zend-stdlib": "^2.7 || ^3.0"
b038034
Requires:       php(language) >= 5.6
Remi Collet 00ab3d7
%if ! %{bootstrap}
2e5c20c
Requires:       (php-autoloader(%{gh_owner}/zend-stdlib)         >= 2.7   with php-autoloader(%{gh_owner}/zend-stdlib)         <  4)
a119e49
# From composer, "suggest": {
Remi Collet 00ab3d7
#        "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP",
Remi Collet 00ab3d7
#        "zendframework/zend-cache": "Zend\\Cache component",
Remi Collet 00ab3d7
#        "zendframework/zend-config": "Zend\\Config component",
Remi Collet 00ab3d7
#        "zendframework/zend-eventmanager": "You should install this package to use the events in the translator",
Remi Collet 00ab3d7
#        "zendframework/zend-filter": "You should install this package to use the provided filters",
2e5c20c
#        "zendframework/zend-i18n-resources": "Translation resources",
Remi Collet 00ab3d7
#        "zendframework/zend-servicemanager": "Zend\\ServiceManager component",
Remi Collet 00ab3d7
#        "zendframework/zend-validator": "You should install this package to use the provided validators",
Remi Collet 00ab3d7
#        "zendframework/zend-view": "You should install this package to use the provided view helpers",
Remi Collet 00ab3d7
#        "zendframework/zend-resources": "Translation resources"
Remi Collet 00ab3d7
Suggests:       php-composer(%{gh_owner}/zend-cache)
Remi Collet 00ab3d7
Suggests:       php-composer(%{gh_owner}/zend-config)
Remi Collet 00ab3d7
Suggests:       php-composer(%{gh_owner}/zend-eventmanager)
Remi Collet 00ab3d7
Suggests:       php-composer(%{gh_owner}/zend-filter)
2e5c20c
Suggests:       php-composer(%{gh_owner}/zend-i18n-resources)
Remi Collet 00ab3d7
Suggests:       php-composer(%{gh_owner}/zend-servicemanager)
Remi Collet 00ab3d7
Suggests:       php-composer(%{gh_owner}/zend-validator)
Remi Collet 00ab3d7
Suggests:       php-composer(%{gh_owner}/zend-view)
349a44c
%endif
Remi Collet 00ab3d7
Requires:       php-intl
Remi Collet 00ab3d7
# From phpcompatinfo report for version 2.5.1
Remi Collet 00ab3d7
Requires:       php-ctype
Remi Collet 00ab3d7
Requires:       php-date
Remi Collet 00ab3d7
Requires:       php-pcre
Remi Collet 00ab3d7
Requires:       php-spl
18e6238
# Autoloader
18e6238
Requires:       php-composer(fedora/autoloader)
Remi Collet 00ab3d7
Remi Collet 00ab3d7
Obsoletes:      php-ZendFramework2-%{library} < 2.5
Remi Collet 00ab3d7
Provides:       php-ZendFramework2-%{library} = %{version}
Remi Collet 00ab3d7
Provides:       php-composer(%{gh_owner}/%{gh_project}) = %{version}
18e6238
Provides:       php-autoloader(%{gh_owner}/%{gh_project}) = %{version}
Remi Collet 00ab3d7
Remi Collet 00ab3d7
Remi Collet 00ab3d7
%description
Remi Collet 00ab3d7
Zend\I18n comes with a complete translation suite which supports all major
Remi Collet 00ab3d7
formats and includes popular features like plural translations and text
Remi Collet 00ab3d7
domains. The Translator component is mostly dependency free, except for
Remi Collet 00ab3d7
the fallback to a default locale, where it relies on the Intl PHP extension.
Remi Collet 00ab3d7
Remi Collet 00ab3d7
The translator itself is initialized without any parameters, as any
Remi Collet 00ab3d7
configuration to it is optional. A translator without any translations
Remi Collet 00ab3d7
will actually do nothing but just return the given message IDs.
Remi Collet 00ab3d7
b038034
Documentation: https://zendframework.github.io/%{gh_project}/
b038034
Remi Collet 00ab3d7
Remi Collet 00ab3d7
%prep
Remi Collet 00ab3d7
%setup -q -n %{gh_project}-%{gh_commit}
Remi Collet 00ab3d7
b038034
mv LICENSE.md LICENSE
b038034
Remi Collet 00ab3d7
Remi Collet 00ab3d7
%build
18e6238
: Create autoloader
18e6238
phpab --template fedora --output src/autoload.php src
18e6238
cat << 'EOF' | tee -a src/autoload.php
18e6238
\Fedora\Autoloader\Dependencies::required([
18e6238
    '%{php_home}/Zend/Stdlib/autoload.php',
18e6238
]);
18e6238
\Fedora\Autoloader\Dependencies::optional([
18e6238
    '%{php_home}/Zend/Cache/autoload.php',
18e6238
    '%{php_home}/Zend/Config/autoload.php',
18e6238
    '%{php_home}/Zend/EventManager/autoload.php',
18e6238
    '%{php_home}/Zend/Filter/autoload.php',
18e6238
    '%{php_home}/Zend/ServiceManager/autoload.php',
18e6238
    '%{php_home}/Zend/Validator/autoload.php',
18e6238
    '%{php_home}/Zend/View/autoload.php',
18e6238
    '%{php_home}/Zend/I18n/Translator/Resources.php',
18e6238
]);
18e6238
EOF
Remi Collet 00ab3d7
Remi Collet 00ab3d7
Remi Collet 00ab3d7
%install
Remi Collet 00ab3d7
mkdir -p   %{buildroot}%{php_home}/Zend/
Remi Collet 00ab3d7
cp -pr src %{buildroot}%{php_home}/Zend/%{library}
Remi Collet 00ab3d7
Remi Collet 00ab3d7
Remi Collet 00ab3d7
%check
Remi Collet 00ab3d7
%if %{with_tests}
Remi Collet 00ab3d7
mkdir vendor
349a44c
cat << 'EOF' | tee vendor/autoload.php
Remi Collet 00ab3d7
18e6238
require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php';
18e6238
# For BR without new autoloader
18e6238
\Fedora\Autoloader\Dependencies::required([
18e6238
    '%{php_home}/Zend/autoload.php',
18e6238
]);
18e6238
\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test');
Remi Collet 00ab3d7
EOF
349a44c
b038034
ret=0
2e5c20c
for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit6" php71 php72; do
2e5c20c
  if which $cmdarg; then
2e5c20c
    set $cmdarg
aa893f7
    $1 ${2:-%{_bindir}/phpunit7} \
aa893f7
%if 0%{?fedora} >= 29
aa893f7
      --filter '^((?!(testSettersProvideDefaults|testBasic)).)*$' \
aa893f7
%endif
aa893f7
      --verbose || ret=1
b038034
  fi
b038034
done
b038034
exit $ret
Remi Collet 00ab3d7
%else
Remi Collet 00ab3d7
: Test suite disabled
Remi Collet 00ab3d7
%endif
Remi Collet 00ab3d7
Remi Collet 00ab3d7
Remi Collet 00ab3d7
%files
349a44c
%{!?_licensedir:%global license %%doc}
b038034
%license LICENSE
b038034
%doc *.md
Remi Collet 00ab3d7
%doc composer.json
Remi Collet 00ab3d7
%{php_home}/Zend/%{library}
Remi Collet 00ab3d7
Remi Collet 00ab3d7
Remi Collet 00ab3d7
%changelog
5685aaf
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-4
5685aaf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
5685aaf
0ec086e
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-3
0ec086e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0ec086e
a119e49
* Wed May 23 2018 Remi Collet <remi@remirepo.net> - 2.9.0-2
a119e49
- update to 2.9.0
aa893f7
- skip test failing with libicu 61, reported as
aa893f7
  https://github.com/zendframework/zend-i18n/issues/97
a119e49
2e5c20c
* Thu Apr 26 2018 Remi Collet <remi@remirepo.net> - 2.8.0-2
2e5c20c
- update to 2.8.0
2e5c20c
- switch to phpunit7
2e5c20c
- use range dependencies
2e5c20c
d024b87
* Tue Feb 13 2018 Remi Collet <remi@remirepo.net> - 2.7.4-4
d024b87
- fix FTBFS from Koschei, path from
d024b87
  https://github.com/zendframework/zend-i18n/pull/91
d024b87
- always use phpunit6
d024b87
cff22e2
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-4
cff22e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
cff22e2
18e6238
* Fri Nov 24 2017 Remi Collet <remi@remirepo.net> - 2.7.4-3
18e6238
- switch from zend-loader to fedora/autoloader
18e6238
323071f
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-2
323071f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
323071f
b038034
* Mon May 22 2017 Remi Collet <remi@remirepo.net> - 2.7.4-1
b038034
- Update to 2.7.4
b038034
- raise dependency on PHP 5.6
b038034
- use phpunit6 on F26+
b038034
9a352f1
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.3-2
9a352f1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9a352f1
dec2184
* Fri Jun 10 2016 Remi Collet <remi@fedoraproject.org> - 2.7.3-1
dec2184
- update to 2.7.3
dec2184
558ef01
* Tue Apr 19 2016 Remi Collet <remi@fedoraproject.org> - 2.7.2-1
558ef01
- update to 2.7.2
558ef01
4fd4b4a
* Thu Mar 31 2016 Remi Collet <remi@fedoraproject.org> - 2.7.1-1
4fd4b4a
- update to 2.7.1
4fd4b4a
349a44c
* Fri Feb 12 2016 Remi Collet <remi@fedoraproject.org> - 2.6.0-1
349a44c
- update to 2.6.0
349a44c
- raise dependency on PHP >= 5.5
349a44c
- raise dependency on zend-stdlib >= 2.7
5472cc8
- ignore failed test with ICU 56
349a44c
6f54319
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2
6f54319
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6f54319
Remi Collet 5a042fc
* Thu Oct  1 2015 Remi Collet <remi@fedoraproject.org> - 2.5.1-1
Remi Collet 5a042fc
- normal build
Remi Collet 5a042fc
Remi Collet 00ab3d7
* Tue Aug  4 2015 Remi Collet <remi@fedoraproject.org> - 2.5.1-0
2e5c20c
- initial package, bootstrap build