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