2869f42
# what it's called on pypi
2869f42
%global srcname leveldb
2869f42
# what it's imported as
2869f42
%global libname %{srcname}
2869f42
# name of egg info directory
2869f42
%global eggname %{srcname}
2869f42
# package name fragment
2869f42
%global pkgname %{srcname}
2869f42
2869f42
%global _description \
2869f42
Thread-safe Python bindings for LevelDB.  Features everything from the LevelDB\
2869f42
API, except for arbitrary key comparison and all iteration except for\
2869f42
single-step forward/backwards.
2869f42
2869f42
%bcond_without python3
2869f42
2869f42
%if %{defined rhel}
2869f42
%bcond_without python2
2869f42
%bcond_without python3_other
2869f42
%endif
2869f42
2869f42
%bcond_without tests
2869f42
2869f42
2869f42
Name:           python-%{pkgname}
2869f42
Version:        0.194
0528986
Release:        3%{?dist}
2869f42
Summary:        Python bindings for leveldb database library
2869f42
License:        BSD
2869f42
URL:            https://github.com/rjpower/py-leveldb
2869f42
Source0:        %pypi_source
2869f42
# https://github.com/rjpower/py-leveldb/pull/9
2869f42
# The PyPI tarball is missing the LICENSE
2869f42
Source1:        https://raw.githubusercontent.com/rjpower/py-leveldb/b0405197b55d42c2492f10ca2c8f91572ef337b8/LICENSE
2869f42
Patch0:         use-system-leveldb.patch
2869f42
# https://github.com/rjpower/py-leveldb/issues/7
2869f42
Patch1:         py34-compat.patch
2869f42
BuildRequires:  gcc-c++
2869f42
BuildRequires:  leveldb-devel
2869f42
BuildRequires:  snappy-devel
2869f42
2869f42
2869f42
%description %{_description}
2869f42
2869f42
2869f42
%if %{with python2}
2869f42
%package -n python2-%{pkgname}
2869f42
Summary:        %{summary}
2869f42
BuildRequires:  python2-devel
2869f42
BuildRequires:  python2-setuptools
2869f42
%{?python_provide:%python_provide python2-%{pkgname}}
2869f42
2869f42
2869f42
%description -n python2-%{pkgname} %{_description}
2869f42
%endif
2869f42
2869f42
2869f42
%if %{with python3}
2869f42
%package -n python%{python3_pkgversion}-%{pkgname}
2869f42
Summary:        %{summary}
2869f42
BuildRequires:  python%{python3_pkgversion}-devel
2869f42
BuildRequires:  python%{python3_pkgversion}-setuptools
2869f42
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}}
2869f42
2869f42
2869f42
%description -n python%{python3_pkgversion}-%{pkgname} %{_description}
2869f42
%endif
2869f42
2869f42
2869f42
%if %{with python3_other}
2869f42
%package -n python%{python3_other_pkgversion}-%{pkgname}
2869f42
Summary:        %{summary}
2869f42
BuildRequires:  python%{python3_other_pkgversion}-devel
2869f42
BuildRequires:  python%{python3_other_pkgversion}-setuptools
2869f42
2869f42
2869f42
%description -n python%{python3_other_pkgversion}-%{pkgname} %{_description}
2869f42
%endif
2869f42
2869f42
2869f42
%prep
2869f42
%autosetup -n %{srcname}-%{version} -p 1
2869f42
rm -r %{eggname}.egg-info
2869f42
rm -r snappy leveldb
2869f42
# move missing LICENSE into place for %%files
2869f42
mv %{S:1} .
2869f42
# rpmlint fix
2869f42
chmod -x README
2869f42
2869f42
2869f42
%build
2869f42
%{?with_python2:%py2_build}
2869f42
%{?with_python3:%py3_build}
2869f42
%{?with_python3_other:%py3_other_build}
2869f42
2869f42
2869f42
%install
2869f42
%{?with_python2:%py2_install}
2869f42
%{?with_python3:%py3_install}
2869f42
%{?with_python3_other:%py3_other_install}
2869f42
2869f42
2869f42
%if %{with tests}
2869f42
%check
2869f42
%{?with_python2:PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} test/test.py}
2869f42
%{?with_python3:PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} test/test.py}
2869f42
%{?with_python3_other:PYTHONPATH=%{buildroot}%{python3_other_sitearch} %{__python3_other} test/test.py}
2869f42
%endif
2869f42
2869f42
2869f42
%if %{with python2}
2869f42
%files -n python2-%{pkgname}
2869f42
%license LICENSE
2869f42
%doc README
2869f42
%{python2_sitearch}/%{libname}.so
2869f42
%{python2_sitearch}/%{eggname}-%{version}-py%{python2_version}.egg-info
2869f42
%endif
2869f42
2869f42
2869f42
%if %{with python3}
2869f42
%files -n python%{python3_pkgversion}-%{pkgname}
2869f42
%license LICENSE
2869f42
%doc README
2525f4f
%{python3_sitearch}/%{libname}.cpython-%{python3_version_nodots}*.so
2869f42
%{python3_sitearch}/%{eggname}-%{version}-py%{python3_version}.egg-info
2869f42
%endif
2869f42
2869f42
2869f42
%if %{with python3_other}
2869f42
%files -n python%{python3_other_pkgversion}-%{pkgname}
2869f42
%license LICENSE
2869f42
%doc README
2525f4f
%{python3_other_sitearch}/%{libname}.cpython-%{python3_other_version_nodots}*.so
2869f42
%{python3_other_sitearch}/%{eggname}-%{version}-py%{python3_other_version}.egg-info
2869f42
%endif
2869f42
2869f42
2869f42
%changelog
0528986
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.194-3
0528986
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0528986
8d3ec30
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.194-2
8d3ec30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
8d3ec30
2869f42
* Wed Oct 24 2018 Carl George <carl@george.computer> - 0.194-1
2869f42
- Initial package