%global pkg_name restructuredtext-lint
%global pypi_name restructuredtext_lint
%global desc Lint reStructuredText linter files with an API or a CLI.\
It reports errors and warning including:\
- Unknown directives\
- Wrong usage of directives\
- Inconsistencies in title levels\
- Unexpected unindent
Name: python-%{pkg_name}
Version: 1.1.3
Release: 1%{?dist}
Summary: reStructuredText linter
License: Unlicense
URL: https://pypi.python.org/pypi/restructuredtext_lint
Source0: https://files.pythonhosted.org/packages/7e/b5/d28da439210e7f35e4f58f743e2d1fa9c7f34fb5ab9a0532e0bb3a77274a/restructuredtext_lint-%{version}.tar.gz
BuildArch: noarch
%description
%{desc}
%package -n python2-%{pkg_name}
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-nose >= 1.3.0
BuildRequires: PyYAML >= 3.11
BuildRequires: python-docutils >= 0.11
BuildRequires: python-docutils < 1.0
Requires: python-docutils >= 0.11
Requires: python-docutils < 1.0
Summary: %{summary}
%{?python_provide:%python_provide python2-%{pkg_name}}
%description -n python2-%{pkg_name}
%{desc}
%package -n python3-%{pkg_name}
Summary: %{summary}
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-nose >= 1.3.0
BuildRequires: python3-PyYAML >= 3.11
BuildRequires: python3-docutils >= 0.11
BuildRequires: python3-docutils < 1.0
Requires: python3-docutils >= 0.11
Requires: python3-docutils < 1.0
%{?python_provide:%python_provide python3-%{pkg_name}}
%description -n python3-%{pkg_name}
%{desc}
%prep
%setup -qn %{pypi_name}-%{version}
# Remove pyc files from source
find -name '*.pyc' -delete
%build
%py2_build
%py3_build
%install
# Install Python 2 first to have default cli on Python 3
%py2_install
%py3_install
%check
PYTHONPATH="$(pwd)" nosetests-%{python2_version} -v .
PYTHONPATH="$(pwd)" nosetests-%{python3_version} -v .
%files -n python2-%{pkg_name}
%doc README.rst
%license UNLICENSE
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/
%{python2_sitelib}/%{pypi_name}/
%files -n python3-%{pkg_name}
%doc README.rst
%license UNLICENSE
%{_bindir}/rst-lint
%{_bindir}/restructuredtext-lint
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
%{python3_sitelib}/%{pypi_name}/
%changelog
* Mon Feb 26 2018 Julien Enselme <jujens@jujens.eu> - 1.1.3-1
- Update to 1.1.3
* Tue Nov 14 2017 Julien Enselme <jujens@jujens.eu> - 1.1.2-1
- Update to 1.1.2
* Sat Aug 05 2017 Julien Enselme <jujens@jujens.eu> - 1.1.0-1
- Update to 1.1.0
* Fri Mar 17 2017 Julien Enselme <jujens@jujens.eu> - 1.0.1-1
- Update to 1.0.1
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.17.2-4
- Rebuild for Python 3.6
* Sun Oct 30 2016 Julien Enselme <jujens@jujens.eu> - 0.17.2-3
- Correct typos in description
- Use -delete option in find to delete pyc files
* Sun Oct 30 2016 Julien Enselme <jujens@jujens.eu> - 0.17.2-2
- Expand description
- Rename package from python-restructuredtext_lint to python-restructuredtext-lint
- Use only on executable
* Tue Oct 11 2016 Julien Enselme <jujens@jujens.eu> - 0.17.2-1
- Inital package