Blame php-gettext-languages.spec

d88fd26
%global gh_commit    0540c37d9ba554ef8fc240123cb3ee8df222e3b9
d88fd26
%global gh_short     %(c=%{gh_commit}; echo ${c:0:8})
d88fd26
%global gh_owner     mlocati
d88fd26
%global gh_project   cldr-to-gettext-plural-rules
d88fd26
d88fd26
d88fd26
Name:       php-gettext-languages
d88fd26
Version:    2.1.3
47559e2
Release:    5%{?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
d88fd26
Source0:    %{name}-%{version}-%{gh_short}.tgz
d88fd26
# https://github.com/mlocati/cldr-to-gettext-plural-rules/pull/13 was sent upstream, but this patch
d88fd26
# uses /usr/bin/php instead of /usr/bin/env php.
d88fd26
Patch0:     0000-Add-a-shebang-to-bin-export.php.patch
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
d88fd26
%setup -q -n cldr-to-gettext-plural-rules-%{gh_commit}
d88fd26
d88fd26
%patch0 -p1
d88fd26
d88fd26
sed -i "s:require_once.*:require_once '%{_datadir}/php/Gettext/Languages/autoloader.php';:" bin/export.php
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
d88fd26
cp -a bin/export.php %{buildroot}/%{_bindir}/%{name}-export
d88fd26
chmod 755 %{buildroot}/%{_bindir}/%{name}-export
d88fd26
d88fd26
cp -ar src/* %{buildroot}/%{_datadir}/php/Gettext/Languages/
d88fd26
d88fd26
d88fd26
%check
3d79e1d
sed -i "s:require_once.*:require_once '%{buildroot}/%{_datadir}/php/Gettext/Languages/autoloader.php';:" tests/bootstrap.php
3d79e1d
d88fd26
sed -i "s:require_once.*:require_once '%{buildroot}/%{_datadir}/php/Gettext/Languages/autoloader.php';:" bin/export.php
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
d88fd26
%{_bindir}/%{name}-export
d88fd26
%{_datadir}/php/Gettext
d88fd26
d88fd26
d88fd26
%changelog
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.