%global pname docx %global with_python3 1 Name: python-docx Version: 0.8.5 Release: 1%{?dist} Summary: Create and update Microsoft Word .docx files License: MIT URL: https://github.com/python-openxml/python-docx Source0: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python-devel BuildRequires: python-lxml # test requirements BuildRequires: python-behave >= 1.2.3 BuildRequires: pyparsing >= 2.0.1 BuildRequires: python-mock >= 1.0.1 BuildRequires: python-flake8 >= 2.0 %if 0%{?fedora} >=21 BuildRequires: pytest >= 2.5 %else BuildRequires: pytest %endif %if 0%{?with_python3} %package -n python3-%{pname} Summary: Create and update Microsoft Word .docx files BuildRequires: python3-devel BuildRequires: python3-lxml #Testing requirements # python-behave Not available for python3 BuildRequires: python3-pyparsing >= 2.0.1 BuildRequires: python3-mock >= 1.0.1 BuildRequires: python3-flake8 >= 2.0 %if 0%{?fedora} >=21 BuildRequires: python3-pytest >= 2.5 %endif %description -n python3-%{pname} Python library for creating and updating Microsoft Word (.docx) files. %endif %description Python library for creating and updating Microsoft Word (.docx) files. %prep %setup -qn %{name}-%{version} # Remove bundled egg-info rm -rf python_%{pname}.egg-info %build %{__python2} setup.py build %if 0%{?with_python3} %{__python3} setup.py build %endif %install %{__python2} setup.py install --skip-build --root %{buildroot} %if 0%{?with_python3} %{__python3} setup.py install --skip-build --root %{buildroot} %endif %check py.test behave --stop %if 0%{?with_python3} && 0%{?fedora} >=21 %{__python3} -m pytest %endif %files %doc README.rst %license LICENSE %{python2_sitelib}/%{pname} %{python2_sitelib}/python_%{pname}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pname} %doc README.rst %license LICENSE %{python3_sitelib}/%{pname} %{python3_sitelib}/python_%{pname}-%{version}-py?.?.egg-info %endif %changelog * Mon Mar 9 2015 Kushal Khandelwal - 0.8.5-1 - update to 0.8.5 * Fri Feb 20 2015 Kushal Khandelwal - 0.8.2-1 - Initial package.