Enable Python3 support

epel9
Luke Macken 12 years ago
parent cc38e70790
commit 9394419176

@ -1,5 +1,6 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%global with_python3 1
%global upstream_name redis %global upstream_name redis
Name: python-%{upstream_name} Name: python-%{upstream_name}
@ -17,35 +18,83 @@ BuildArch: noarch
BuildRequires: python-devel BuildRequires: python-devel
BuildRequires: python-py BuildRequires: python-py
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-py
%endif
%description %description
This is a Python interface to the Redis key-value store. This is a Python interface to the Redis key-value store.
%if 0%{?with_python3}
%package -n python3-redis
Summary: A Python3 client for redis
Group: Development/Languages
%description -n python3-redis
This is a Python interface to the Redis key-value store.
%endif
%prep %prep
%setup -q -n %{upstream_name}-%{version} %setup -q -n %{upstream_name}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%{__python} setup.py build %{__python} setup.py build
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root=%{buildroot}
popd
%endif
%{__python} setup.py install -O1 --skip-build --root %{buildroot} %{__python} setup.py install -O1 --skip-build --root %{buildroot}
%clean %clean
rm -rf %{buildroot} rm -rf %{buildroot}
%check %check
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif
%{__python} setup.py test %{__python} setup.py test
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc CHANGES LICENSE README.md %doc CHANGES LICENSE README.rst
%{python_sitelib}/%{upstream_name} %{python_sitelib}/%{upstream_name}
%{python_sitelib}/%{upstream_name}-%{version}-*.egg-info %{python_sitelib}/%{upstream_name}-%{version}-*.egg-info
%if 0%{?with_python3}
%files -n python3-redis
%defattr(-,root,root,-)
%doc CHANGES LICENSE README.rst
%{python3_sitelib}/%{upstream_name}
%{python3_sitelib}/%{upstream_name}-%{version}-*.egg-info
%endif
%changelog %changelog
* Sat Jul 27 2013 Luke Macken <lmacken@redhat.com> - 2.7.6-1 * Sat Jul 27 2013 Luke Macken <lmacken@redhat.com> - 2.7.6-1
- Update to 2.7.6 - Update to 2.7.6
- Run the test suite - Run the test suite
- Add a python3 subpackage
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-2 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

Loading…
Cancel
Save