# Created by pyp2rpm-1.1.0b %global pypi_name pluginbase %global with_python3 1 Name: python-%{pypi_name} Version: 0.3 Release: 1%{?dist} Summary: A support library for building plugins sytems in Python License: BSD URL: http://github.com/mitsuhiko/pluginbase Source0: https://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-sphinx BuildRequires: pytest %if %{?with_python3} BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: python3-sphinx %endif # if with_python3 %description PluginBase is a module for Python 2 that enables the development of flexible plugin systems in Python 2. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: A support library for building plugins sytems in Python %description -n python3-%{pypi_name} PluginBase is a module for Python 3 that enables the development of flexible plugin systems in Python 3. %endif # with_python3 %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} # generate html docs sphinx-build-3 docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %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 pushd tests PYTHONPATH=.. py.test-%{python2_version} popd %if 0%{?with_python3} pushd tests PYTHONPATH=.. py.test-%{python3_version} popd %endif %files %doc html LICENSE %{python2_sitelib}/%{pypi_name}.py* %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc html LICENSE %{python3_sitelib}/__pycache__/* %{python3_sitelib}/%{pypi_name}.py %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif # with_python3 %changelog * Tue Jul 01 2014 rkuska@redhat.com - 0.3-1 - Initial package.