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