From 90fb3580fc7d35e9102e6687d997d38c9651bfe2 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 12 Oct 2016 16:20:53 -0600 Subject: [PATCH] Ship python2-whoosh - Build python3 package for EPEL7 - Modernize spec --- python-whoosh.spec | 77 +++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/python-whoosh.spec b/python-whoosh.spec index 3c60fd6..750ce37 100644 --- a/python-whoosh.spec +++ b/python-whoosh.spec @@ -1,10 +1,4 @@ -%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 +%if 0%{?fedora} || 0%{?rhel} >= 7 %global with_python3 1 %endif @@ -12,7 +6,7 @@ Name: python-whoosh Version: 2.7.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Fast, pure-Python full text indexing, search, and spell checking library License: BSD @@ -26,9 +20,9 @@ BuildRequires: pytest BuildRequires: python-sphinx %if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-pytest +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-pytest %endif %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 works can be extended or replaced to meet your needs exactly. -%if 0%{?with_python3} -%package -n python3-whoosh +%package -n python2-whoosh 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 implemented in pure Python. Programmers can use it to easily add search 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 %setup -q -n %{mod_name}-%{version} -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif - %build -%{__python2} setup.py build +%py2_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 +%py3_build rm -f docs/html/.buildinfo rm -rf docs/html/.doctrees -popd +%endif + +%install +%py2_install + +%if 0%{?with_python3} +%py3_install %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 +%files -n python2-whoosh +%license LICENSE.txt +%doc docs/html/ README.txt %{python2_sitelib}/*.egg-info/ %{python2_sitelib}/whoosh %if 0%{?with_python3} -%files -n python3-whoosh -%doc README.txt LICENSE.txt docs/html/ +%files -n python%{python3_pkgversion}-whoosh +%license LICENSE.txt +%doc README.txt docs/html/ %{python3_sitelib}/whoosh %{python3_sitelib}/*.egg-info/ %endif %changelog +* Wed Oct 12 2016 Orion Poplawski - 2.7.4-3 +- Ship python2-whoosh +- Build python3 package for EPEL7 +- Modernize spec + * Tue Jul 19 2016 Fedora Release Engineering - 2.7.4-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages