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