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