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