%global pypi_name unicodecsv %if 0%{?fedora} %global with_python3 1 %endif %{!?upstream_version: %global upstream_version %{version}%{?milestone}} Name: python-%{pypi_name} Version: 0.14.1 Release: 1%{?dist} Summary: Drop-in replacement for csv module which supports unicode strings License: BSD URL: https://github.com/jdunck/python-unicodecsv Source0: https://pypi.python.org/packages/source/u/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-unittest2 >= 0.5.1 Provides: python2-%{pypi_name} %description The unicodecsv is a drop-in replacement for Python 2's csv module which supports unicode strings without a hassle. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Drop-in replacement for csv module which supports unicode strings BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-unittest2 >= 0.5.1 %description -n python3-%{pypi_name} The unicodecsv is a drop-in replacement for Python 2's csv module which supports unicode strings without a hassle. %endif %prep %setup -qc -n %{pypi_name}-%{upstream_version} mv %{pypi_name}-%{upstream_version} python2 pushd python2 #TODO ask upstream to add LICENSE file cp -p README.rst .. popd %if 0%{?with_python3} cp -a python2 python3 %endif %build pushd python2 %{__python2} setup.py build popd %if 0%{?with_python3} pushd python3 %{__python3} setup.py build popd %endif %install %if 0%{?with_python3} pushd python3 %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif pushd python2 %{__python2} setup.py install --skip-build --root %{buildroot} popd %check pushd python2 unit2 discover popd %if 0%{?with_python3} pushd python3 python3-unit2 discover popd %endif %files %doc README.rst %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-*.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.rst %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-*.egg-info %endif %changelog * Thu Sep 24 2015 Alan Pevec - 0.14.1-1 - Update to upstream 0.14.1 * Fri Jul 31 2015 Alan Pevec - 0.13.0-1 - Initial package.