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