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