Blob Blame History Raw

%global pname docx
%global with_python3 1

Name:		python-docx
Version:	0.8.5
Release:	8%{?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
Requires:       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
Requires:       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
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.8.5-7
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.5-6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.5-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Mar 13 2015 Kushal Khandelwal <kushal124@gmail.com> - 0.8.5-2
- Fix dependency requirement.

* Mon Mar 9 2015 Kushal Khandelwal <kushal124@gmail.com> - 0.8.5-1
- update to 0.8.5

* Fri Feb 20 2015 Kushal Khandelwal <kushal124@gmail.com> - 0.8.2-1
- Initial package.