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}
cd03a58
Version:        0.201
a4fd628
Release:        10%{?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
Patch0:         use-system-leveldb.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
cd03a58
# remove bundled libraries
2869f42
rm -r snappy leveldb
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
a4fd628
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.201-10
a4fd628
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
a4fd628
7e77d8a
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.201-9
7e77d8a
- Rebuilt for Python 3.11
7e77d8a
e3f4ef1
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.201-8
e3f4ef1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
e3f4ef1
40a5cdf
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.201-7
40a5cdf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
40a5cdf
1a832db
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.201-6
1a832db
- Rebuilt for Python 3.10
1a832db
fa6a70b
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.201-5
fa6a70b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
fa6a70b
cf222b6
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.201-4
cf222b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
cf222b6
cf96a13
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.201-3
cf96a13
- Rebuilt for Python 3.9
cf96a13
c7490f5
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.201-2
c7490f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c7490f5
cd03a58
* Tue Dec 17 2019 Carl George <carl@george.computer> - 0.201-1
cd03a58
- Latest upstream
cd03a58
57adbb3
* Sun Sep 08 2019 Carl George <carl@george.computer> - 0.194-5
57adbb3
- Add patch2 to fix Python 3.8 build
57adbb3
e1e531d
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.194-4
e1e531d
- Rebuilt for Python 3.8
e1e531d
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