%global mod_name flask-whooshee
%global with_python3 1
Name: python-flask-whooshee
Version: 0.0.6
Release: 4%{?dist}
Summary: Whoosh integration
License: GPLv2+
URL: https://github.com/bkabrda/flask-whooshee
Source0: https://pypi.python.org/packages/source/f/%{mod_name}/%{mod_name}-%{version}.tar.gz
# Adds test_suite line into setup.py
Patch1: 0001-add-tests-to-setup.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
# Test build requires
BuildRequires: python-whoosh
BuildRequires: python-flask
BuildRequires: python-flask-sqlalchemy
BuildRequires: python-blinker
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-whoosh
BuildRequires: python3-flask
BuildRequires: python3-flask-sqlalchemy
BuildRequires: python3-blinker
%endif # if with_python3
Requires: python-flask-sqlalchemy
Requires: python-whoosh
Requires: python-blinker
Requires: python-flask
%description
Whoosh integration that allows to create and search custom indexes.
%if 0%{?with_python3}
%package -n python3-flask-whooshee
Summary: Whoosh integration
Requires: python3-flask-sqlalchemy
Requires: python3-whoosh
Requires: python3-blinker
Requires: python3-flask
%description -n python3-flask-whooshee
Whoosh integration that allows to create and search custom indexes.
%endif
%prep
%setup -q -n %{mod_name}-%{version}
%patch1
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%check
%{__python} setup.py test
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif
%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif
%files
%doc LICENSE README.md
%{python_sitelib}/flask_whooshee.py*
%{python_sitelib}/*.egg-info
%if 0%{?with_python3}
%files -n python3-flask-whooshee
%doc LICENSE README.md
%{python3_sitelib}/
%endif
%changelog
* Thu Jul 03 2014 Robert Kuska <rkuska@redhat.com> - 0.0.6-4
- Move Requires for Python 3 into correct place
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri May 16 2014 Robert Kuska <rkuska@redhat.com> - 0.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Wed Dec 18 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 0.0.6-1
- Update to flask-whooshee 0.0.6.
- Drop py3 compat patch, since it's now upstream.
- Use buildroot macro consistently.
* Fri Oct 04 2013 Robert Kuska <rkuska@redhat.com> 0.0.5-4
- Add python3 subpackage
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Apr 11 2013 Robert Kuska <rkuska@redhat.com> 0.0.5-2
- Review fixes
* Wed Apr 10 2013 Robert Kuska <rkuska@redhat.com> 0.0.5-1
- Initial package