# Conditional build:
%bcond_without python2 # CPython 2.x version
%bcond_without python3 # CPython 3.x version
+%bcond_without tests # unit tests
Summary: Documentation Utilities
Summary(pl.UTF-8): Narzędzia do tworzenia dokumentacji
Name: docutils
-Version: 0.14
+Version: 0.15.2
Release: 1
-License: Public Domain, BSD, GPL (see COPYING.txt)
+License: Public Domain, BSD, GPL v3 (see COPYING.txt)
Group: Development/Tools
-Source0: http://downloads.sourceforge.net/docutils/%{name}-%{version}.tar.gz
-# Source0-md5: c53768d63db3873b7d452833553469de
+# Source0: http://downloads.sourceforge.net/docutils/%{name}-%{version}.tar.gz
+Source0: https://pypi.debian.net/%{name}/%{name}-%{version}.tar.gz
+# Source0-md5: e26a308d8000b0bed7416a633217c676
URL: http://docutils.sourceforge.net/
%if %{with python2}
-BuildRequires: python-devel >= 2.3
+BuildRequires: python-devel >= 1:2.6
%endif
%if %{with python3}
-BuildRequires: python3-2to3 >= 1:3.6
-BuildRequires: python3-2to3 < 1:3.7
-BuildRequires: python3-devel >= 3.6
+BuildRequires: python3-2to3 >= 1:3.4
+BuildRequires: python3-devel >= 1:3.4
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%build
%if %{with python2}
%{__python} setup.py config build -b build-2
+
+%if %{with tests}
+PYTHONPATH=$(pwd)/build-2/lib \
+%{__python} test/alltests.py
+%endif
%endif
%if %{with python3}
%{__python3} setup.py config build -b build-3
+
+%if %{with tests}
+PYTHONPATH=$(pwd)/build-3/lib \
+%{__python3} test3/alltests.py
+%endif
%endif
%install
%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc PKG-INFO *.txt docs
%attr(755,root,root) %{_bindir}/rst2html
%attr(755,root,root) %{_bindir}/rst2html4
%attr(755,root,root) %{_bindir}/rst2html5
%files -n python-%{name}
%defattr(644,root,root,755)
+%doc BUGS.txt COPYING.txt README.txt RELEASE-NOTES.txt THANKS.txt docs
%{py_sitescriptdir}/docutils
%{py_sitescriptdir}/docutils-%{version}-py*.egg-info
%endif
%if %{with python3}
%files 3
%defattr(644,root,root,755)
-%doc PKG-INFO *.txt docs
%attr(755,root,root) %{_bindir}/rst*-3
%files -n python3-%{name}
%defattr(644,root,root,755)
+%doc BUGS.txt COPYING.txt README.txt RELEASE-NOTES.txt THANKS.txt docs
%{py3_sitescriptdir}/docutils
%{py3_sitescriptdir}/docutils-%{version}-py*.egg-info
%endif