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