Blob Blame History Raw
%if 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

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

%global mod_name Whoosh

Name:           python-whoosh
Version:        2.7.0
Release:        1%{?dist}
Summary:        Fast, pure-Python full text indexing, search, and spell checking library 

License:        BSD 
URL:            http://pythonhosted.org/Whoosh/
Source0:        https://pypi.python.org/packages/source/W/%{mod_name}/%{mod_name}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  pytest 
BuildRequires:  python-sphinx

%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pytest
BuildRequires: python3-sphinx
%endif

%description
Whoosh is a fast, featureful full-text indexing and searching library
implemented in pure Python. Programmers can use it to easily add search
functionality to their applications and websites. Every part of how Whoosh
works can be extended or replaced to meet your needs exactly.

%if 0%{?with_python3}
%package -n python3-whoosh
Summary:    Fast, Python3 full text indexing, search, and spell checking library

%description -n python3-whoosh
Whoosh is a fast, featureful full-text indexing and searching library
implemented in pure Python. Programmers can use it to easily add search
functionality to their applications and websites. Every part of how Whoosh
works can be extended or replaced to meet your needs exactly.
%endif

%prep
%setup -q -n %{mod_name}-%{version}

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%{__python2} setup.py build
sphinx-build docs/source docs/html
rm -f docs/html/.buildinfo
rm -rf docs/html/.doctrees

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
rm -f docs/html/.buildinfo
rm -rf docs/html/.doctrees
popd
%endif

%check
%{__python2} setup.py test

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif

%install
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
popd
%endif

%files
%doc docs/html/ README.txt LICENSE.txt
%{python2_sitelib}/*.egg-info/
%{python2_sitelib}/whoosh

%if 0%{?with_python3}
%files -n python3-whoosh
%doc README.txt LICENSE.txt docs/html/
%{python3_sitelib}/whoosh
%{python3_sitelib}/*.egg-info/
%endif

%changelog
* Mon Oct 12 2015 Robert Kuska <rkuska@redhat.com> 2.7.0-1
- Update to version 2.7.0

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

* Wed Jul 30 2014 Robert Kuska <rkuska@redhat.com> - 2.7.5-4
- Change spec for el6 and epel7

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri May 16 2014 Robert Kuska <rkuska@redhat.com> - 2.7.5-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Mon Mar 03 2014 Robert Kuska <rkuska@redhat.com> - 2.5.7-1
- Rebase to 2.5.7

* Mon Jan 27 2014 Robert Kuska <rkuska@redhat.com> - 2.5.6-1
- Rebase to 2.5.6

* Tue Nov 19 2013 Robert Kuska <rkuska@redhat.com> - 2.5.5-1
- Rebase to 2.5.5

* Mon Sep 09 2013 Robert Kuska <rkuska@redhat.com> - 2.5.3-1
- Rebase to 2.5.3

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Jul 08 2013 Robert Kuska <rkuska@redhat.com> - 2.5.1-1
- Update source
- Add python3 subpackage (rhbz#979235)

* Mon Apr 08 2013 Robert Kuska <rkuska@redhat.com> - 2.4.1-2
- Review fixes

* Fri Apr 05 2013 Robert Kuska <rkuska@redhat.com> - 2.4.1-1
- Initial package