%global upstream_name plyvel %global module_name plyvel %if 0%{?fedora} || 0%{?rhel} > 6 %bcond_without python3 %else %bcond_with python3 %endif Name: python-%{upstream_name} Version: 0.2 Release: 1%{?dist} Summary: Python interface to the LevelDB embedded database library License: BSD URL: https://github.com/wbolster/plyvel Source0: http://pypi.python.org/packages/source/p/%{upstream_name}/%{upstream_name}-%{version}.tar.gz # TODO Patch0: plyvel-0.2-test-tmp-db-fs-encoding.patch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-nose BuildRequires: leveldb-devel BuildRequires: Cython %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-nose %endif %global __provides_exclude_from ^(%{python_sitearch}|%{python3_sitearch})/.*\\.so$ %description Plyvel is a fast and feature-rich Python interface to the LevelDB embedded database library. It has a rich feature set, high performance, and a friendly Pythonic API. %if %{with python3} %package -n python3-%{upstream_name} Summary: Python 3 interface to the LevelDB embedded database library %description -n python3-%{upstream_name} Plyvel is a fast and feature-rich Python interface to the LevelDB embedded database library. It has a rich feature set, high performance, and a friendly Pythonic API. %endif %prep %setup -q -n %{upstream_name}-%{version} %patch0 -p1 rm -rf *.egg-info %if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build make ext %{__python} setup.py build %if %{with python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if %{with python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif %{__python} setup.py install --skip-build --root %{buildroot} %check %{__python} setup.py nosetests %if %{with python3} pushd %{py3dir} %{__python3} setup.py nosetests #%if %{?fedora} <= 17 #nosetests-3.2 build/lib #%else #nosetests-3.3 build/lib #%endif popd %endif %files %doc README.rst LICENSE.rst NEWS.rst %{python_sitearch}/%{module_name} %{python_sitearch}/%{module_name}*.egg-info %if %{with python3} %files -n python3-%{upstream_name} %doc README.rst LICENSE.rst NEWS.rst %{python3_sitearch}/%{module_name} %{python3_sitearch}/%{module_name}*.egg-info %endif %changelog * Sat May 25 2013 Dan Callaghan - 0.2-1 - initial version