f5e66e
%global srcname Babel
f5e66e
%global sum Library for internationalizing Python applications
f5e66e
f5e66e
# On fedora 24 and beyond we want to use the python3 version by default
f5e66e
# (Only reason earlier versions aren't switched is that we didn't push it out
f5e66e
# before the release)
f5e66e
%if 0%{?fedora} >= 24 || 0%{?rhel} > 7
f5e66e
%global default_python 3
f5e66e
%else
f5e66e
%global default_python 2
f5e66e
%endif
f5e66e
f5e66e
# There is some bootstrapping involved when upgrading Python 3
f5e66e
# First of all we need babel (this package) to use sphinx
f5e66e
# And pytest is at this point not yet ready
f5e66e
%global bootstrap 0
f5e66e
f5e66e
Name:           babel
f5e66e
Version:        2.5.1
f5e66e
Release:        3%{?dist}
f5e66e
Summary:        Tools for internationalizing Python applications
f5e66e
f5e66e
License:        BSD
f5e66e
URL:            http://babel.pocoo.org/
f5e66e
Source0:        https://files.pythonhosted.org/packages/source/B/%{srcname}/%{srcname}-%{version}.tar.gz
f5e66e
Patch0:         babel-2.3.4-remove-pytz-version.patch
f5e66e
f5e66e
BuildArch:      noarch
f5e66e
f5e66e
%if %{?rhel} <= 7
f5e66e
BuildRequires:  python2-devel
f5e66e
BuildRequires:  python2-setuptools
f5e66e
BuildRequires:  python2-pytz
f5e66e
BuildRequires:  python2-pytest
f5e66e
%endif
f5e66e
BuildRequires:  python3-devel
f5e66e
BuildRequires:  python3-setuptools
f5e66e
%if !%{bootstrap}
f5e66e
BuildRequires:  python3-pytz
f5e66e
BuildRequires:  python3-pytest
f5e66e
%endif
f5e66e
f5e66e
# build the documentation
f5e66e
BuildRequires:  make
f5e66e
f5e66e
%if %{default_python} >= 3
f5e66e
%if %{bootstrap}
f5e66e
BuildRequires:  python2-sphinx
f5e66e
%else
f5e66e
BuildRequires:  python3-sphinx
f5e66e
%endif
f5e66e
Requires:       python3-babel
f5e66e
Requires:       python3-setuptools
f5e66e
%else
f5e66e
BuildRequires:  python2-sphinx
f5e66e
Requires:       python2-babel
f5e66e
Requires:       python2-setuptools
f5e66e
%endif
f5e66e
f5e66e
f5e66e
%description
f5e66e
Babel is composed of two major parts:
f5e66e
f5e66e
* tools to build and work with gettext message catalogs
f5e66e
f5e66e
* a Python interface to the CLDR (Common Locale Data Repository),
f5e66e
  providing access to various locale display names, localized number
f5e66e
  and date formatting, etc.
f5e66e
f5e66e
%package -n python2-babel
f5e66e
Summary:        %sum
f5e66e
f5e66e
Requires:       python2-setuptools
f5e66e
Requires:       pytz
f5e66e
f5e66e
%{?python_provide:%python_provide python2-babel}
f5e66e
f5e66e
%description -n python2-babel
f5e66e
Babel is composed of two major parts:
f5e66e
f5e66e
* tools to build and work with gettext message catalogs
f5e66e
f5e66e
* a Python interface to the CLDR (Common Locale Data Repository),
f5e66e
  providing access to various locale display names, localized number
f5e66e
  and date formatting, etc.
f5e66e
f5e66e
%package -n python3-babel
f5e66e
Summary:        %sum
f5e66e
f5e66e
Requires:       python3-setuptools
f5e66e
Requires:       python3-pytz
f5e66e
f5e66e
%{?python_provide:%python_provide python3-babel}
f5e66e
f5e66e
%description -n python3-babel
f5e66e
Babel is composed of two major parts:
f5e66e
f5e66e
* tools to build and work with gettext message catalogs
f5e66e
f5e66e
* a Python interface to the CLDR (Common Locale Data Repository),
f5e66e
  providing access to various locale display names, localized number
f5e66e
  and date formatting, etc.
f5e66e
f5e66e
%package doc
f5e66e
Summary:        Documentation for Babel
f5e66e
Provides:       python-babel-doc = %{version}-%{release}
f5e66e
Provides:       python2-babel-doc = %{version}-%{release}
f5e66e
Provides:       python3-babel-doc = %{version}-%{release}
f5e66e
f5e66e
%description doc
f5e66e
Documentation for Babel
f5e66e
f5e66e
%prep
f5e66e
%autosetup -n %{srcname}-%{version}
f5e66e
f5e66e
%build
f5e66e
%if %{?rhel} <= 7
f5e66e
%py2_build
f5e66e
%endif
f5e66e
%py3_build
f5e66e
f5e66e
BUILDDIR="$PWD/built-docs"
f5e66e
rm -rf "$BUILDDIR"
f5e66e
pushd docs
f5e66e
make \
f5e66e
%if %{default_python} >= 3 && !%{bootstrap}
f5e66e
    SPHINXBUILD=sphinx-build-3 \
f5e66e
%else
f5e66e
    SPHINXBUILD=sphinx-build \
f5e66e
%endif
f5e66e
    BUILDDIR="$BUILDDIR" \
f5e66e
    html
f5e66e
popd
f5e66e
rm -f "$BUILDDIR/html/.buildinfo"
f5e66e
f5e66e
%install
f5e66e
%if %{default_python} >= 3
f5e66e
%if %{?rhel} <= 7
f5e66e
%py2_install
f5e66e
%endif
f5e66e
%py3_install
f5e66e
%else
f5e66e
%py3_install
f5e66e
%py2_install
f5e66e
%endif
f5e66e
f5e66e
%check
f5e66e
f5e66e
# test_frontend needs python-freezegun
f5e66e
rm tests/messages/test_frontend.py
f5e66e
f5e66e
export TZ=America/New_York
f5e66e
%if %{?rhel} <= 7
f5e66e
%{__python2} setup.py test
f5e66e
%endif
f5e66e
%if !%{bootstrap}
f5e66e
%{__python3} setup.py test
f5e66e
%endif
f5e66e
f5e66e
%files
f5e66e
%doc CHANGES AUTHORS
f5e66e
%license LICENSE
f5e66e
%{_bindir}/pybabel
f5e66e
f5e66e
%if %{?rhel} <= 7
f5e66e
%files -n python2-babel
f5e66e
%{python2_sitelib}/Babel-%{version}-py*.egg-info
f5e66e
%{python2_sitelib}/babel
f5e66e
%endif
f5e66e
f5e66e
%files -n python3-babel
f5e66e
%{python3_sitelib}/Babel-%{version}-py*.egg-info
f5e66e
%{python3_sitelib}/babel
f5e66e
f5e66e
%files doc
f5e66e
%doc built-docs/html/*
f5e66e
f5e66e
%changelog
f5e66e
* Mon Jun 18 2018 Petr Viktorin <pviktori@redhat.com> - 2.5.1-3
f5e66e
- Remove the freezegun dependency
f5e66e
f5e66e
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f5e66e
f5e66e
* Fri Dec 15 2017 Felix Schwarz <fschwarz@fedoraproject.org> - 2.5.1-1
f5e66e
- update to upstream version 2.5.1
f5e66e
f5e66e
* Fri Dec 15 2017 Iryna Shcherbina <ishcherb@redhat.com> - 2.3.4-7
f5e66e
- Update Python 2 dependency declarations to new packaging standards
f5e66e
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
f5e66e
f5e66e
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-6
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f5e66e
f5e66e
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-5
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f5e66e
f5e66e
* Tue Dec 13 2016 Miro Hrončok <mhroncok@redhat.com> - 2.3.4-4
f5e66e
- Finish bootstrapping for Python 3.6
f5e66e
f5e66e
* Tue Dec 13 2016 Miro Hrončok <mhroncok@redhat.com> - 2.3.4-3
f5e66e
- Rebuild for Python 3.6
f5e66e
- Add "bootstrap" conditions
f5e66e
f5e66e
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.4-2
f5e66e
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
f5e66e
f5e66e
* Tue May 31 2016 Nils Philippsen <nils@redhat.com>
f5e66e
- fix source URL
f5e66e
f5e66e
* Mon Apr 25 2016 Nils Philippsen <nils@redhat.com> - 2.3.4-1
f5e66e
- version 2.3.4
f5e66e
- always build Python3 subpackages
f5e66e
- remove obsolete packaging constructs
f5e66e
- update to current Python packaging guidelines
f5e66e
- build docs non-destructively
f5e66e
- tag license file as %%license
f5e66e
- use %%python_provide macro only if present
f5e66e
- update remove-pytz-version patch
f5e66e
- fix build dependencies
f5e66e
- set TZ in %%check
f5e66e
f5e66e
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.3-12
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f5e66e
f5e66e
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-11
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
f5e66e
f5e66e
* Fri Nov  6 2015 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3-10
f5e66e
- Also make sure that the babel package that has pybabel depends on the correct
f5e66e
  packages (python2 packages on F23 or less and python3 packages on F24 and
f5e66e
  greater.)
f5e66e
f5e66e
* Wed Nov  4 2015 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3-9
f5e66e
- Install the python3 version of pybabel on Fedora 24+ to match with Fedora's
f5e66e
  default python version
f5e66e
f5e66e
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-8
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
f5e66e
f5e66e
* Wed Dec 17 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3-7
f5e66e
- Remove pytz version requirement in egginfo as it confuses newer setuptools
f5e66e
f5e66e
* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3-6
f5e66e
- Change python-setuptools-devel BR into python-setuptools
f5e66e
f5e66e
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-5
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f5e66e
f5e66e
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.3-4
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
f5e66e
f5e66e
* Wed Apr 02 2014 Nils Philippsen <nils@redhat.com> - 1.3-3
f5e66e
- fix dependencies (#1083470)
f5e66e
f5e66e
* Sun Oct 06 2013 Felix Schwarz <fschwarz@fedoraproject.org> - 1.3-2
f5e66e
- enable python3 subpackage
f5e66e
f5e66e
* Wed Oct 02 2013 Felix Schwarz <fschwarz@fedoraproject.org> - 1.3-1
f5e66e
- update to Babel 1.3
f5e66e
- disabled %%check as it tries to download the CLDR
f5e66e
f5e66e
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-9
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f5e66e
f5e66e
* Wed Jun 26 2013 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.9.6-8
f5e66e
- split documentation off to a separate subpackage
f5e66e
f5e66e
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-7
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f5e66e
f5e66e
* Thu Oct 18 2012 Nils Philippsen <nils@redhat.com> - 0.9.6-6
f5e66e
- run tests in %%check
f5e66e
- add pytz build requirement for tests
f5e66e
f5e66e
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 0.9.6-5
f5e66e
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
f5e66e
f5e66e
* Wed Aug 01 2012 Felix Schwarz <felix.schwarz@oss.schwarz.eu> - 0.9.6-4
f5e66e
- disable building of non-functional python3 subpackage (#761583)
f5e66e
f5e66e
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-3
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
f5e66e
f5e66e
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-2
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f5e66e
f5e66e
* Tue Jun 07 2011 Nils Philippsen <nils@redhat.com> - 0.9.6-1
f5e66e
- version 0.9.6:
f5e66e
  * Backport r493-494: documentation typo fixes.
f5e66e
  * Make the CLDR import script work with Python 2.7.
f5e66e
  * Fix various typos.
f5e66e
  * Fixed Python 2.3 compatibility (ticket #146, #233).
f5e66e
  * Sort output of list-locales.
f5e66e
  * Make the POT-Creation-Date of the catalog being updated equal to
f5e66e
    POT-Creation-Date of the template used to update (ticket #148).
f5e66e
  * Use a more explicit error message if no option or argument (command) is
f5e66e
    passed to pybabel (ticket #81).
f5e66e
  * Keep the PO-Revision-Date if it is not the default value (ticket #148).
f5e66e
  * Make --no-wrap work by reworking --width's default and mimic xgettext's
f5e66e
    behaviour of always wrapping comments (ticket #145).
f5e66e
  * Fixed negative offset handling of Catalog._set_mime_headers (ticket #165).
f5e66e
  * Add --project and --version options for commandline (ticket #173).
f5e66e
  * Add a __ne__() method to the Local class.
f5e66e
  * Explicitly sort instead of using sorted() and don't assume ordering
f5e66e
    (Python 2.3 and Jython compatibility).
f5e66e
  * Removed ValueError raising for string formatting message checkers if the
f5e66e
    string does not contain any string formattings (ticket #150).
f5e66e
  * Fix Serbian plural forms (ticket #213).
f5e66e
  * Small speed improvement in format_date() (ticket #216).
f5e66e
  * Fix number formatting for locales where CLDR specifies alt or draft
f5e66e
    items (ticket #217)
f5e66e
  * Fix bad check in format_time (ticket #257, reported with patch and tests by
f5e66e
    jomae)
f5e66e
  * Fix so frontend.CommandLineInterface.run does not accumulate logging
f5e66e
    handlers (#227, reported with initial patch by dfraser)
f5e66e
  * Fix exception if environment contains an invalid locale setting (#200)
f5e66e
- install python2 rather than python3 executable (#710880)
f5e66e
f5e66e
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-4
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
f5e66e
f5e66e
* Thu Aug 26 2010 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.9.5-3
f5e66e
- Add python3 subpackage
f5e66e
f5e66e
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.9.5-2
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
f5e66e
f5e66e
* Wed Apr  7 2010 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.9.5-1
f5e66e
- This release contains a small number of bugfixes over the 0.9.4
f5e66e
- release.
f5e66e
-
f5e66e
- What's New:
f5e66e
- -----------
f5e66e
- * Fixed the case where messages containing square brackets would break
f5e66e
-  with an unpack error
f5e66e
- * Fuzzy matching regarding plurals should *NOT* be checked against
f5e66e
-  len(message.id) because this is always 2, instead, it's should be
f5e66e
-  checked against catalog.num_plurals (ticket #212).
f5e66e
f5e66e
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-5
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
f5e66e
f5e66e
* Sat Mar 28 2009 Robert Scheck <robert@fedoraproject.org> - 0.9.4-4
f5e66e
- Added missing requires to python-setuptools for pkg_resources
f5e66e
f5e66e
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-3
f5e66e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
f5e66e
f5e66e
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.9.4-2
f5e66e
- Rebuild for Python 2.6
f5e66e
f5e66e
* Mon Aug 25 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.9.4-1
f5e66e
- Update to 0.9.4
f5e66e
f5e66e
* Thu Jul 10 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.9.3-1
f5e66e
- Update to 0.9.3
f5e66e
f5e66e
* Sun Dec 16 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.9.1-1
f5e66e
- Update to 0.9.1
f5e66e
f5e66e
* Tue Aug 28 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.9-2
f5e66e
- BR python-setuptools-devel
f5e66e
f5e66e
* Mon Aug 27 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.9-1
f5e66e
- Update to 0.9
f5e66e
f5e66e
* Mon Jul  2 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8.1-1
f5e66e
- Update to 0.8.1
f5e66e
- Remove upstreamed patch.
f5e66e
f5e66e
* Fri Jun 29 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8-3
f5e66e
- Replace patch with one that actually applies.
f5e66e
f5e66e
* Fri Jun 29 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8-2
f5e66e
- Apply upstream patch to rename command line script to "pybabel" - BZ#246208
f5e66e
f5e66e
* Thu Jun 21 2007 Jeffrey C. Ollie <jeff@ocjtech.us> - 0.8-1
f5e66e
- First version for Fedora
f5e66e