Blob Blame History Raw
%global with_python3 1
%global module_name drat

Name:           python-%{module_name}
Version:        0.4.2
Release:        8%{?dist}
Summary:        A reading text analysis tool

License:        GPLv3+
URL:            https://github.com/riverrun/drat
Source0:        https://pypi.python.org/packages/source/d/%{module_name}/%{module_name}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-requests
BuildRequires:  python-click
BuildRequires:  python-setuptools

%description
Drat is a tool that analyzes reading texts and produces a brief report which
gives a readability score (according to the Dale-Chall readability formula)
and the number of uncommon words (based on the General Service List) in the
text. It also lists all of these uncommon words (if you choose the verbose
option).

%if 0%{with_python3}
%package -n python3-%{module_name}
Summary:        A reading text analysis tool
License:        GPLv3+
BuildRequires:  python3-devel
BuildRequires:  python3-requests
BuildRequires:  python3-click
BuildRequires:  python3-setuptools
%endif

%package -n %{module_name}-tools
Summary:        A reading text analysis tool
License:        GPLv3+

%if 0%{with_python3}
Requires: python3-drat
%else
Requires: python-drat
%endif

%if 0%{with_python3}
%description -n python3-%{module_name}
Drat is a tool that analyzes reading texts and produces a brief report which
gives a readability score (according to the Dale-Chall readability formula)
and the number of uncommon words (based on the General Service List) in the
text. It also lists all of these uncommon words (if you choose the verbose
option).
%endif

%description -n %{module_name}-tools
drat tool.

%prep
%setup -q -n %{module_name}-%{version}
rm -rf *.egg-info

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3

find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'

%build
%{__python2} setup.py build

%if 0%{with_python3}
echo ${_python3}
%{__python3} setup.py build
%endif

%install
%{__python2} setup.py install --skip-build --root=%{buildroot}

%if 0%{with_python3}
%{__python3} setup.py install --skip-build --root=%{buildroot}
%endif

%check
%{__python2} setup.py test

%if 0%{with_python3}
%{__python3} setup.py test
%endif

%files -n %{module_name}-tools
%doc README.rst
%{_bindir}/*

%files -n python-%{module_name}
%doc README.rst
%{python2_sitelib}/%{module_name}/
%{python2_sitelib}/%{module_name}-%{version}-py2.7.egg-info

%if 0%{?with_python3}
%files -n python3-%{module_name}
%doc README.rst
%{python3_sitelib}/%{module_name}/
%{python3_sitelib}/%{module_name}-%{version}-py3.*.egg-info
%endif


%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

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

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Jan 09 2015 Parag Nemade <pnemade AT redhat DOT com> - 0.4.2-2
- Fix drat execution
- require python3-drat

* Sun Oct 19 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.4.2-1
- Update to 0.4.2 release

* Sun Sep 28 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.4.1-1
- Update to 0.4.1 release

* Mon Sep 22 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.4.0-1
- Initial packaging