%global nsname backports %global modname csv %global srcname %{nsname}.%{modname} %global pkgname %(n=%{srcname}; echo ${n//./-}) Name: python-%{pkgname} Version: 1.0.1 Release: 1%{?dist} Summary: Backport of Python 3's csv module for Python 2 License: Python URL: https://github.com/ryanhiebert/backports.csv Source0: %{url}/archive/%{version}/%{pkgname}-%{version}.tar.gz BuildArch: noarch %global _description \ %{summary}.\ \ The API of the csv module in Python 2 is drastically different from the\ csv module in Python 3. This is due, for the most part, to the difference\ between str in Python 2 and Python 3. %description %{_description} %package -n python2-%{pkgname} Summary: %{summary} %{?python_provide:%python_provide python2-%{pkgname}} BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-nose Requires: python-backports %description -n python2-%{pkgname} %{_description} Python 2 version. %package -n python3-%{pkgname} Summary: %{summary} %{?python_provide:%python_provide python3-%{pkgname}} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-nose # https://bugzilla.redhat.com/show_bug.cgi?id=1372890 #Requires: python3-backports %description -n python3-%{pkgname} %{_description} Python 3 version. %prep %autosetup -n %{srcname}-%{version} %build %py2_build %py3_build %install %py2_install %py3_install %check nosetests-%{python2_version} -v nosetests-%{python3_version} -v %files -n python2-%{pkgname} %doc HISTORY.rst README.rst %{python2_sitelib}/%{srcname}-*-nspkg.pth %{python2_sitelib}/%{srcname}-*.egg-info/ %{python2_sitelib}/%{nsname}/%{modname}.py* %files -n python3-%{pkgname} %doc HISTORY.rst README.rst %{python3_sitelib}/%{srcname}-*-nspkg.pth %{python3_sitelib}/%{srcname}-*.egg-info/ %{python3_sitelib}/%{nsname}/__pycache__/%{modname}.* %{python3_sitelib}/%{nsname}/%{modname}.py %changelog * Sat Sep 03 2016 Igor Gnatenko - 1.0.1-1 - Initial package