30fb97b
%global pypi_name django-babel
30fb97b
30fb97b
%if 0%{?fedora}
30fb97b
%global with_python3 1
30fb97b
%endif
30fb97b
30fb97b
Name:           python-%{pypi_name}
30fb97b
Version:        0.4.0
30fb97b
Release:        2%{?dist}
30fb97b
Summary:        Utilities for using Babel in Django
30fb97b
30fb97b
License:        BSD
30fb97b
URL:            http://github.com/graingert/django-babel/
30fb97b
Source0:        https://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
30fb97b
BuildArch:      noarch
30fb97b
30fb97b
%description
30fb97b
This package contains various utilities for integration of
30fb97b
Babel into the Django web framework:
30fb97b
30fb97b
* A message extraction plugin for Django templates.
30fb97b
* A middleware class that adds the Babel `Locale`_ object to requests.
30fb97b
 * A set
30fb97b
of template tags for date and number formatting.
30fb97b
30fb97b
30fb97b
%package -n python2-%{pypi_name}
30fb97b
Summary:        Utilities for using Babel in Django
30fb97b
30fb97b
%{?python_provide:%python_provide python2-%{pypi_name}}
30fb97b
30fb97b
BuildRequires:  python2-devel
30fb97b
BuildRequires:  python-setuptools
30fb97b
BuildRequires:  python-sphinx
30fb97b
30fb97b
# test requirements
30fb97b
#BuildRequires:  python-coverage
30fb97b
#BuildRequires:  pytest
30fb97b
#BuildRequires:  python-pytest-cov
30fb97b
#BuildRequires:  python-pytest-flakes
30fb97b
# currently missing dep:
30fb97b
# BuildRequires: python-coveralls
30fb97b
30fb97b
Requires:       python-django >= 1.4
30fb97b
Requires:       python-django < 1.9
30fb97b
Requires:       python-babel >= 1.3
30fb97b
Requires:       python-setuptools
30fb97b
30fb97b
%description -n python2-django-babel
30fb97b
This package contains various utilities for integration of
30fb97b
Babel into the Django web framework:
30fb97b
30fb97b
* A message extraction plugin for Django templates.
30fb97b
* A middleware class that adds the Babel `Locale`_ object to requests.
30fb97b
 * A set
30fb97b
of template tags for date and number formatting.
30fb97b
30fb97b
%if 0%{?with_python3}
30fb97b
%package -n python3-django-babel
30fb97b
Summary:        Utilities for using Babel in Django
30fb97b
30fb97b
%{?python_provide:%python_provide python3-%{pypi_name}}
30fb97b
30fb97b
BuildRequires:  python3-devel
30fb97b
BuildRequires:  python3-setuptools
30fb97b
BuildRequires:  python3-sphinx
30fb97b
30fb97b
# test requirements
30fb97b
# BuildRequires:  python3-coverage
30fb97b
# BuildRequires:  python3-pytest
30fb97b
# BuildRequires:  python3-pytest-cov
30fb97b
# BuildRequires:  python3-pytest-flakes
30fb97b
# currently missing test dep:
30fb97b
# BuildRequires:  python3-coveralls
30fb97b
30fb97b
Requires:       python3-django
30fb97b
Requires:       python3-babel >= 1.3
30fb97b
Requires:       python3-setuptools
30fb97b
30fb97b
%description -n python3-django-babel
30fb97b
This package contains various utilities for integration of
30fb97b
Babel into the Django web framework:
30fb97b
30fb97b
* A message extraction plugin for Django templates.
30fb97b
* A middleware class that adds the Babel `Locale`_ object to requests.
30fb97b
 * A set
30fb97b
of template tags for date and number formatting.
30fb97b
%endif
30fb97b
30fb97b
%prep
30fb97b
%setup -q -n %{pypi_name}-%{version}
30fb97b
30fb97b
30fb97b
30fb97b
%build
30fb97b
%{__python2} setup.py build
30fb97b
30fb97b
%if 0%{?with_python3}
30fb97b
%{__python2} setup.py build
30fb97b
%endif
30fb97b
30fb97b
# generate html docs
30fb97b
sphinx-build docs html
30fb97b
# remove the sphinx-build leftovers
30fb97b
rm -rf html/.{doctrees,buildinfo}
30fb97b
30fb97b
30fb97b
30fb97b
30fb97b
%install
30fb97b
%{__python2} setup.py install --skip-build --root %{buildroot}
30fb97b
30fb97b
%if 0%{?with_python3}
30fb97b
%{__python3} setup.py install --skip-build --root %{buildroot}
30fb97b
%endif
30fb97b
30fb97b
%check
30fb97b
# python-coveralls is missing test requirement
30fb97b
#%{__python2} setup.py test
30fb97b
#%if 0%{?with_python3}
30fb97b
#%{__python3} setup.py test
30fb97b
#%endif
30fb97b
%files -n python2-django-babel
30fb97b
%doc html README.rst
30fb97b
%{python2_sitelib}/django_babel
30fb97b
%{python2_sitelib}/django_babel-%{version}-py?.?.egg-info
30fb97b
30fb97b
%if 0%{?with_python3}
30fb97b
%files -n python3-django-babel
30fb97b
%doc README.rst
30fb97b
%{python3_sitelib}/django_babel
30fb97b
%{python3_sitelib}/django_babel-%{version}-py?.?.egg-info
30fb97b
%endif
30fb97b
30fb97b
%changelog
30fb97b
* Thu Sep 10 2015 Matthias Runge <mrunge@redhat.com> - 0.4.0-2
30fb97b
- spec fixes, move docs creation to build (rhbz#1261042)
30fb97b
30fb97b
* Tue Sep 08 2015 Matthias Runge <mrunge@redhat.com> - 0.4.0-1
30fb97b
- Initial package.