# Created by pyp2rpm-3.2.1 %global pypi_name pykafka %global alphatag .dev2 %if 0%{?fedora} %global with_python3 1 %endif # Note: there's already a python-kafka package which is a separate # project (kafka-python on pypi) # FIXME: requested upstream to include license in source tarball # https://github.com/Parsely/pykafka/pull/654 Name: python-%{pypi_name} Version: 2.6.0 Release: 0.1%{?alphatag}%{?dist} Summary: Full-Featured Pure-Python Kafka Client License: ASL 2.0 URL: https://github.com/Parsely/%{pypi_name} Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}%{?alphatag}.tar.gz BuildRequires: librdkafka-devel %description PyKafka is a cluster-aware Kafka client for Python. PyKafka’s primary goal is to provide a similar level of abstraction to the JVM Kafka client using idioms familiar to Python programmers and exposing the most Pythonic API possible. %package -n python2-%{pypi_name} Summary: Full-Featured Pure-Python Kafka Client %{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python-pytest BuildRequires: python-pytest-cov BuildRequires: python-snappy BuildRequires: python-mock BuildRequires: python-unittest2 BuildRequires: python-setuptools BuildRequires: python-kazoo BuildRequires: python-gevent >= 1.1.0 Requires: python-six >= 1.5 Requires: python-kazoo Requires: python-tabulate Requires: python-gevent >= 1.1.0 Requires: python-setuptools %description -n python2-%{pypi_name} %{description} %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Full-Featured Pure-Python Kafka Client %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: python3-pytest-cov BuildRequires: python3-snappy BuildRequires: python3-mock BuildRequires: python3-unittest2 BuildRequires: python3-setuptools BuildRequires: python3-kazoo BuildRequires: python3-gevent >= 1.1.0 Requires: python3-six >= 1.5 Requires: python3-kazoo Requires: python3-tabulate Requires: python3-gevent >= 1.1.0 Requires: python3-setuptools %description -n python3-%{pypi_name} %{description} %endif %prep %autosetup -n %{pypi_name}-%{version}%{?alphatag} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %if 0%{?with_python3} %py3_build %endif %install %if 0%{?with_python3} # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install. %py3_install cp -p %{buildroot}/%{_bindir}/kafka-tools %{buildroot}/%{_bindir}/kafka-tools-3 ln -sf %{_bindir}/kafka-tools-3 %{buildroot}/%{_bindir}/kafka-tools-%{python3_version} # Remove tests as they're not installed in package specific path rm -rf %{buildroot}%{python3_sitearch}/tests # Remove python module C source code rm %{buildroot}%{python3_sitearch}/%{pypi_name}/rdkafka/_rd_kafkamodule.c %endif %py2_install cp -p %{buildroot}/%{_bindir}/kafka-tools %{buildroot}/%{_bindir}/kafka-tools-2 ln -sf %{_bindir}/kafka-tools-2 %{buildroot}/%{_bindir}/kafka-tools-%{python2_version} # Remove tests as they're not installed in package specific path rm -rf %{buildroot}%{python2_sitearch}/tests # Remove python module C source code rm %{buildroot}%{python2_sitearch}/%{pypi_name}/rdkafka/_rd_kafkamodule.c %check # FIXME: missing deps on python-testinstances # make tests non-failing until it is available %{__python2} setup.py test ||: %if 0%{?with_python3} %{__python3} setup.py test ||: %endif %files -n python2-%{pypi_name} %doc README.rst %{_bindir}/kafka-tools %{_bindir}/kafka-tools-2 %{_bindir}/kafka-tools-%{python2_version} %{python2_sitearch}/%{pypi_name} %{python2_sitearch}/%{pypi_name}-*.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.rst %{_bindir}/kafka-tools-3 %{_bindir}/kafka-tools-%{python3_version} %{python3_sitearch}/%{pypi_name} %{python3_sitearch}/%{pypi_name}-*.egg-info %endif %changelog * Tue Feb 14 2017 hguemar - 2.6.0.dev2-1 - Initial package.