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