Blob Blame History Raw

%global pypi_name sphinxcontrib-spelling
%global sum  A spelling checker for Sphinx-based documentation
%global py2_major 2

%if 0%{?fedora} > 12
  %global with_python3 1
%endif

%if 0%{?el7}
  %global py2_major %{nil}
%endif

%if 0%{?el6}
  %global py2_major %{nil}
  %global __python2 %{__python}
  %global python2_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%endif

Name:           python-%{pypi_name}
Version:        4.0.1
Release:        3%{?dist}
Summary:        %{sum}

License:        BSD
URL:            https://bitbucket.org/dhellmann/sphinxcontrib-spelling
Source0:        https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python%{py2_major}-setuptools
BuildRequires:  python%{py2_major}-devel
BuildRequires:  python%{py2_major}-pbr
BuildRequires:  python%{py2_major}-nose
BuildRequires:  python%{py2_major}-fixtures
BuildRequires:  python%{py2_major}-six
BuildRequires:  python%{py2_major}-enchant
BuildRequires:  python%{py2_major}-sphinx
BuildRequires:  hunspell-en
BuildRequires:  hunspell-de

%if 0%{?el6}
Patch0:         el6-compat.patch
%endif

%if ! 0%{?py2_major}
Patch1:         debug-unsupported.patch
Requires:       python-six
Requires:       python-enchant
Requires:       python-sphinx
%endif


%if 0%{?with_python3}
BuildRequires:  python3-setuptools
BuildRequires:  python3-devel
BuildRequires:  python3-pbr
BuildRequires:  python3-nose
BuildRequires:  python3-fixtures
BuildRequires:  python3-six
BuildRequires:  python3-enchant
BuildRequires:  python3-sphinx
%endif

%description
This package contains sphinxcontrib.spelling, a spelling checker for
Sphinx-based documentation. It uses PyEnchant to produce a report showing
misspelled words.

%if 0%{?py2_major}
%package -n     python2-%{pypi_name}
Summary:        %{sum}
%{?python_provide:%python_provide python2-%{pypi_name}}
Requires:       python2-six
Requires:       python2-enchant
Requires:       python2-sphinx

%description -n python2-%{pypi_name}
This package contains sphinxcontrib.spelling, a spelling checker for
Sphinx-based documentation. It uses PyEnchant to produce a report showing
misspelled words.
%endif

%if 0%{?with_python3}
%package -n     python3-%{pypi_name}
Summary:        %{sum}
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires:       python3-enchant
Requires:       python3-six
Requires:       python3-sphinx

%description -n python3-%{pypi_name}
This package contains sphinxcontrib.spelling, a spelling checker for
Sphinx-based documentation. It uses PyEnchant to produce a report showing
misspelled words.
%endif

%prep
%autosetup -p0 -n %{pypi_name}-%{version}

%if 0%{?el6} 
%patch0
%endif

%if ! 0%{?py2_major}
%patch1
%endif

# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info


%build
%py2_build

%if 0%{?with_python3}
%py3_build
%endif


%install
%if 0%{?with_python3}
%py3_install
%endif

%py2_install

%check
%if 0%{?py2_major}
%{__python2} -m nose
%else
nosetests
%endif

%if 0%{?with_python3}
%{__python3} -m nose
%endif

%files -n python%{py2_major}-%{pypi_name}
%doc README
%license LICENSE
%{python2_sitelib}/sphinxcontrib
%{python2_sitelib}/sphinxcontrib_spelling*

%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README
%license LICENSE
%{python3_sitelib}/sphinxcontrib
%{python3_sitelib}/sphinxcontrib_spelling*
%endif

%changelog
* Wed Feb 28 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.0.1-3
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 09 2018  Avram Lubkin <aviso@rockhopper.net> - 4.0.1-1
- Updated to 4.0.1

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Sun Jan 01 2017  Avram Lubkin <aviso@rockhopper.net> - 2.3.0-1
- Update to 2.3.0

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 2.1.2-3
- Rebuild for Python 3.6

* Wed Jul 20 2016 Avram Lubkin <aviso@rockhopper.net> - 2.1.2-2
- Added build support for EPEL 6 and 7

* Wed Jun 15 2016 Avram Lubkin <aviso@rockhopper.net> - 2.1.2-1
- Initial package.