d88fd26
Name:       php-gettext-languages
d08e0c1
Version:    2.6.0
95e26ea
Release:    3%{?dist}
d88fd26
BuildArch:  noarch
d88fd26
d88fd26
License:    MIT and Unicode
d88fd26
Summary:    Generate gettext language lists with plural rules
d88fd26
URL:        https://github.com/mlocati/cldr-to-gettext-plural-rules
9c2cad5
# Upstream removes the tests from the archive, so the tarball is manually built from a checkout.
220bf91
# https://github.com/mlocati/cldr-to-gettext-plural-rules/issues/11
220bf91
#
220bf91
# To build the tarball:
220bf91
#
220bf91
# $ git clone git@github.com:mlocati/cldr-to-gettext-plural-rules.git
220bf91
# $ cd cldr-to-gettext-plural-rules
220bf91
# $ rm .gitattributes
220bf91
# $ touch .gitattributes
ab37381
# $ git archive -o cldr-to-gettext-plural-rules-VERSION.tar.gz --prefix cldr-to-gettext-plural-rules-VERSION/ --worktree-attributes VERSION
9c2cad5
Source0:    cldr-to-gettext-plural-rules-%{version}.tar.gz
d88fd26
d88fd26
BuildRequires: php-composer(fedora/autoloader)
d88fd26
BuildRequires: phpunit 
d88fd26
d88fd26
Requires:   php(language) >= 5.4.0
d88fd26
Requires:   php-cli
d88fd26
Requires:   php-dom
d88fd26
Requires:   php-iconv
d88fd26
Requires:   php-json
d88fd26
Requires:   php-pcre
d88fd26
Requires:   php-spl
d88fd26
d88fd26
Provides:   php-composer(gettext/languages) = %{version}
d88fd26
d88fd26
d88fd26
%description
d88fd26
A library that can generate gettext language lists automatically
d88fd26
generated from CLDR data.
d88fd26
d88fd26
d88fd26
%prep
9c2cad5
%autosetup -p1 -n cldr-to-gettext-plural-rules-%{version}
d88fd26
d08e0c1
sed -i "s:require_once.*:require_once '%{_datadir}/php/Gettext/Languages/autoloader.php';:" bin/export-plural-rules
d08e0c1
#echo "#!/usr/bin/env php" > bin/export-plural-rules.sh
d08e0c1
#cat bin/export-plural-rules.sh bin/export-plural-rules.php > bin/export-plural-rules
d08e0c1
d08e0c1
sed -i '1s;^;#!/usr/bin/php\n;' bin/export-plural-rules
d88fd26
d88fd26
d88fd26
%install
d88fd26
install -d -p -m 0755 %{buildroot}/%{_bindir}
d88fd26
install -d -p -m 0755 %{buildroot}/%{_datadir}/php
d88fd26
install -d -p -m 0755 %{buildroot}/%{_datadir}/php/Gettext
d88fd26
install -d -p -m 0755 %{buildroot}/%{_datadir}/php/Gettext/Languages
d88fd26
9c2cad5
cp -a bin/export-plural-rules %{buildroot}/%{_bindir}/%{name}-export-plural-rules
9c2cad5
chmod 755 %{buildroot}/%{_bindir}/%{name}-export-plural-rules
d88fd26
d88fd26
cp -ar src/* %{buildroot}/%{_datadir}/php/Gettext/Languages/
d08e0c1
cp -ar tests/test %{buildroot}/%{_datadir}/php/Gettext/Languages/Test
d88fd26
d88fd26
d88fd26
%check
3d79e1d
sed -i "s:require_once.*:require_once '%{buildroot}/%{_datadir}/php/Gettext/Languages/autoloader.php';:" tests/bootstrap.php
3d79e1d
d08e0c1
sed -i "s:require_once.*:require_once '%{buildroot}/%{_datadir}/php/Gettext/Languages/autoloader.php';:" bin/export-plural-rules
d88fd26
phpunit --bootstrap tests/bootstrap.php
d88fd26
d88fd26
d88fd26
%files
d88fd26
%license LICENSE
d88fd26
%license UNICODE-LICENSE.txt
d88fd26
%doc composer.json
d88fd26
%doc README.md
9c2cad5
%{_bindir}/%{name}-export-plural-rules
d88fd26
%{_datadir}/php/Gettext
d88fd26
d88fd26
d88fd26
%changelog
95e26ea
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-3
95e26ea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
95e26ea
ee8b973
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-2
ee8b973
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
ee8b973
d08e0c1
* Fri Jul 24 2020 Sundeep Anand <suanand@fedoraproject.org> - 2.6.0-1
d08e0c1
- Update to 2.6.0 (#1772151).
d08e0c1
3d33455
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-4
3d33455
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
3d33455
fb2ee45
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-3
fb2ee45
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
fb2ee45
357e01c
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-2
357e01c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
357e01c
220bf91
* Sun Jul 29 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.4.0-1
220bf91
- Update to 2.4.0 (#1594776).
220bf91
- https://github.com/mlocati/cldr-to-gettext-plural-rules/releases/tag/2.4.0
220bf91
de9c258
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-3
de9c258
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
de9c258
2118101
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2
2118101
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2118101
fd7f269
* Sat Jan 13 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.3.0-1
9c2cad5
- Update to 2.3.0 (#1435488).
9c2cad5
47559e2
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-5
47559e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
47559e2
3d79e1d
* Sun Feb 12 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.1.3-4
3d79e1d
- Move the sed on tests/bootstrap.php into the check section to get rid of a lint warning.
3d79e1d
d88fd26
* Wed Feb 01 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.1.3-3
d88fd26
- Add an export cli.
d88fd26
- Include a patch that adds a shebang to the export CLI.
d88fd26
d88fd26
* Sat Jan 21 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.1.3-2
d88fd26
- Use a git snapshot instead of the version tag so that we get the
d88fd26
  tests and the docs (See
d88fd26
  https://github.com/mlocati/cldr-to-gettext-plural-rules/issues/11 )
d88fd26
- Run the tests.
d88fd26
- Modify the test bootstrap and export.php to use the library
d88fd26
  installation location instead of the local path.
d88fd26
d88fd26
* Sun Jan 15 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.1.3-1
d88fd26
- Initial release.