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