Ship python2-whoosh

- Build python3 package for EPEL7
- Modernize spec
This commit is contained in:
Orion Poplawski 2016-10-12 16:20:53 -06:00
parent 63dcb773cc
commit 90fb3580fc

View File

@ -1,10 +1,4 @@
%if 0%{?rhel} <= 6 %if 0%{?fedora} || 0%{?rhel} >= 7
%{!?__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 %global with_python3 1
%endif %endif
@ -12,7 +6,7 @@
Name: python-whoosh Name: python-whoosh
Version: 2.7.4 Version: 2.7.4
Release: 2%{?dist} Release: 3%{?dist}
Summary: Fast, pure-Python full text indexing, search, and spell checking library Summary: Fast, pure-Python full text indexing, search, and spell checking library
License: BSD License: BSD
@ -26,9 +20,9 @@ BuildRequires: pytest
BuildRequires: python-sphinx BuildRequires: python-sphinx
%if 0%{?with_python3} %if 0%{?with_python3}
BuildRequires: python3-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python3-setuptools BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python3-pytest BuildRequires: python%{python3_pkgversion}-pytest
%endif %endif
%description %description
@ -37,11 +31,22 @@ implemented in pure Python. Programmers can use it to easily add search
functionality to their applications and websites. Every part of how Whoosh functionality to their applications and websites. Every part of how Whoosh
works can be extended or replaced to meet your needs exactly. works can be extended or replaced to meet your needs exactly.
%if 0%{?with_python3} %package -n python2-whoosh
%package -n python3-whoosh
Summary: Fast, Python3 full text indexing, search, and spell checking library Summary: Fast, Python3 full text indexing, search, and spell checking library
%{?python_provide:%python_provide python2-whoosh}
%description -n python3-whoosh %description -n python2-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.
%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-whoosh
Summary: Fast, Python3 full text indexing, search, and spell checking library
%{?python_provide:%python_provide python%{python3_pkgversion}-whoosh}
%description -n python%{python3_pkgversion}-whoosh
Whoosh is a fast, featureful full-text indexing and searching library Whoosh is a fast, featureful full-text indexing and searching library
implemented in pure Python. Programmers can use it to easily add search implemented in pure Python. Programmers can use it to easily add search
functionality to their applications and websites. Every part of how Whoosh functionality to their applications and websites. Every part of how Whoosh
@ -51,56 +56,52 @@ works can be extended or replaced to meet your needs exactly.
%prep %prep
%setup -q -n %{mod_name}-%{version} %setup -q -n %{mod_name}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
%{__python2} setup.py build %py2_build
sphinx-build docs/source docs/html sphinx-build docs/source docs/html
rm -f docs/html/.buildinfo rm -f docs/html/.buildinfo
rm -rf docs/html/.doctrees rm -rf docs/html/.doctrees
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir} %py3_build
%{__python3} setup.py build
rm -f docs/html/.buildinfo rm -f docs/html/.buildinfo
rm -rf docs/html/.doctrees rm -rf docs/html/.doctrees
popd %endif
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif %endif
%check %check
%{__python2} setup.py test %{__python2} setup.py test
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test %{__python3} setup.py test
popd
%endif %endif
%install %files -n python2-whoosh
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %license LICENSE.txt
%doc docs/html/ README.txt
%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}/*.egg-info/
%{python2_sitelib}/whoosh %{python2_sitelib}/whoosh
%if 0%{?with_python3} %if 0%{?with_python3}
%files -n python3-whoosh %files -n python%{python3_pkgversion}-whoosh
%doc README.txt LICENSE.txt docs/html/ %license LICENSE.txt
%doc README.txt docs/html/
%{python3_sitelib}/whoosh %{python3_sitelib}/whoosh
%{python3_sitelib}/*.egg-info/ %{python3_sitelib}/*.egg-info/
%endif %endif
%changelog %changelog
* Wed Oct 12 2016 Orion Poplawski <orion@cora.nwra.com> - 2.7.4-3
- Ship python2-whoosh
- Build python3 package for EPEL7
- Modernize spec
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.4-2 * Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.4-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages