Blob Blame History Raw

%global pname docx
%global with_python3 1

Name:		python-docx
Version:	0.8.5
Release:	15%{?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:	python2-devel
BuildRequires:	python2-lxml
# test requirements
BuildRequires:	python2-behave	>= 1.2.3
BuildRequires:	python2-pyparsing		>= 2.0.1
BuildRequires:	python2-mock		>= 1.0.1
BuildRequires:	python2-flake8	>= 2.0


%if 0%{?fedora} >=21
BuildRequires:	python2-pytest		>= 2.5
%else
BuildRequires:	pytest
%endif

%if 0%{?with_python3}
%package -n python3-%{pname}
Summary:	Create and update Microsoft Word .docx files
Requires:       python3-lxml
%{?python_provide:%python_provide python3-%{pname}}
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


%global _description\
Python library for creating and updating Microsoft Word (.docx) files.

%description %_description

%package -n python2-%{pname}
Summary: %summary
Requires:       python2-lxml
%{?python_provide:%python_provide python2-%{pname}}

%description -n python2-%{pname} %_description

%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 -n python2-%{pname}
%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 Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.5-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.8.5-14
- Rebuilt for Python 3.7

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.8.5-13
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.5-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 30 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.8.5-11
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
- Move python3-lxml form py2 to py3 subpkg
- Add python_provide to py3 subpackage

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.8.5-10
- Python 2 binary package renamed to python2-docx
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.5-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* 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.