# Created by pyp2rpm-1.1.1 %global pypi_name dapp %global with_python3 1 Name: python-%{pypi_name} Version: 0.3.0 Release: 1%{?dist} Summary: Library implementing DevAssistant PingPong protocol License: GPLv2+ URL: https://github.com/devassistant/dapp Source0: https://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-six BuildRequires: pytest BuildRequires: PyYAML %if %{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-six BuildRequires: python3-pytest BuildRequires: python3-PyYAML %endif # if with_python3 Requires: python-six Requires: PyYAML %description Library implementing protocol used for communication between DevAssistant and PingPong scripts (a.k.a. executable assistants). %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Library implementing DevAssistant PingPong protocol Requires: python3-six Requires: python3-PyYAML %description -n python3-%{pypi_name} Library implementing protocol used for communication between DevAssistant and PingPong scripts (a.k.a. executable assistants). This package contains python3 build of dapp. %endif # with_python3 %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif # with_python3 %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install (and we want the python2 version # to be the default for now). %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif # with_python3 %{__python2} setup.py install --skip-build --root %{buildroot} %check %{__python2} setup.py test -t py.test %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py test -t py.test-%{python3_version} popd %endif # with_python3 %files %doc README.rst LICENSE %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %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 # with_python3 %changelog * Wed Nov 05 2014 Slavek Kabrda - 0.3.0-1 - Initial package.