# Created by pyp2rpm-1.0.1 %global pypi_name kazoo %if 0%{?fedora} || 0%{?rhel} > 7 %global with_python3 1 %global with_python2 0 %endif %bcond_with docs %if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python} %{!?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 Name: python-%{pypi_name} Version: 2.2.1 Release: 2%{?dist} Provides: python2-kazoo = %{version}-%{release} Summary: Higher level Python Zookeeper client License: ASL 2.0 URL: https://kazoo.readthedocs.org Source0: https://pypi.python.org/packages/source/k/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch # For building documentation %if %{with docs} BuildRequires: python2-sphinx %endif %description Kazoo is a Python library designed to make working with Zookeeper a more hassle-free experience that is less prone to errors. %if 0%{?with_python2} %package -n python2-%{pypi_name} Summary: Higher level Python Zookeeper client BuildRequires: python2-devel BuildRequires: python2-setuptools %description -n python2-%{pypi_name} Kazoo is a Python library designed to make working with Zookeeper a more hassle-free experience that is less prone to errors. %endif %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Higher level Python Zookeeper client BuildRequires: python3-devel BuildRequires: python3-setuptools # For building documentation %if %{with docs} BuildRequires: python3-sphinx %endif %description -n python3-%{pypi_name} Kazoo is a Python library designed to make working with Zookeeper a more hassle-free experience that is less prone to errors. %endif %if %{with docs} %package doc Summary: Documentation for %{name} Group: Documentation License: ASL 2.0 %description doc Kazoo is a Python library designed to make working with Zookeeper a more hassle-free experience that is less prone to errors. This package contains documentation in HTML format. %endif %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info # generate html docs ##sphinx-build docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' # generate html docs ##sphinx-build-3 docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %endif # with_python3 %build %if 0%{?with_python2} %{__python2} setup.py build %endif %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if 0%{?with_python2} %{__python2} setup.py install --skip-build --root %{buildroot} %endif %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif #delete tests rm -fr %{buildroot}%{python2_sitelib}/%{pypi_name}/tests/ rm -fr %{buildroot}%{python3_sitelib}/%{pypi_name}/tests/ %if 0%{?with_python2} %files -n python2-%{pypi_name} %doc README.rst LICENSE %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.rst LICENSE %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif #%files doc #%doc html %changelog * Fri Jan 18 2019 Shreshtha Joshi - 2.2.1-2 - RHEL8-isms * Thu Feb 11 2016 Alan Pevec - 2.2.1-1 - Update to 2.2.1 * Thu Feb 04 2016 Fedora Release Engineering - 2.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Nov 10 2015 Fedora Release Engineering - 2.0-4 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Thu Jun 18 2015 Fedora Release Engineering - 2.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Tue Aug 26 2014 Nejc Saje - 2.0-2 - Remove documentation's dependency on the base package. * Thu Jul 31 2014 Nejc Saje - 2.0-1 - Initial package.