diff --git a/python-zope-structuredtext.spec b/python-zope-structuredtext.spec index 5c7361b..c80c587 100644 --- a/python-zope-structuredtext.spec +++ b/python-zope-structuredtext.spec @@ -1,3 +1,7 @@ +%if 0%{?fedora} +%global with_python3 1 +%endif + %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %endif @@ -6,7 +10,7 @@ Summary: StructuredText parser Name: python-zope-structuredtext Version: 4.1.0 -Release: 1%{?dist} +Release: 2%{?dist} Source0: http://pypi.python.org/packages/source/z/%{modname}/%{modname}-%{version}.tar.gz License: ZPLv2.1 Group: Development/Libraries @@ -17,45 +21,97 @@ BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-sphinx +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +%endif + %description This package provides a parser and renderers for the classic Zope "structured text" markup dialect (STX). STX is a plain text markup in which document structure is signaled primarily by indentation +%package -n python2-zope-structuredtext +Summary: StructuredText parser +%{?python_provide:%python_provide python2-zope-structuredtext} + +Requires: python2 + +%description -n python2-zope-structuredtext +This package provides a parser and renderers for the classic Zope +"structured text" markup dialect (STX). STX is a plain text markup in +which document structure is signaled primarily by indentation + +%if 0%{?with_python3} +%package -n python3-zope-structuredtext +Summary: StructuredText parser +%{?python_provide:%python_provide python3-zope-structuredtext} + +Requires: python3 + +%description -n python3-zope-structuredtext +This package provides a parser and renderers for the classic Zope +"structured text" markup dialect (STX). STX is a plain text markup in +which document structure is signaled primarily by indentation +%endif + %prep %setup -q -n %{modname}-%{version} %build -%{__python} setup.py build +%py2_build pushd docs PYTHONPATH=../src make html popd +%if 0%{?with_python3} +%py3_build +%endif %install -%{__python} setup.py install --root=%{buildroot} +%py2_install +%if 0%{?with_python3} +%py3_install +%endif # Clean up the documentation mv docs/_build/html . rm -rf html/.buildinfo %check -%{__python} setup.py test +%{__python2} setup.py test +%{__python3} setup.py test -%files -%defattr(-,root,root,-) +%files -n python2-zope-structuredtext %doc CHANGES.rst README.rst TODO.txt COPYRIGHT.txt html/ %license LICENSE.txt -%{python_sitelib}/zope/structuredtext/ -# Co-own %%{python_sitelib}/zope/ -%dir %{python_sitelib}/zope/ +%{python2_sitelib}/zope/structuredtext/ +# Co-own %%{python2_sitelib}/zope/ +%dir %{python2_sitelib}/zope/ # exclude the tests and data needed only for tests -%exclude %{python_sitelib}/zope/structuredtext/tests.py* -%exclude %{python_sitelib}/zope/structuredtext/regressions/ -%{python_sitelib}/%{modname}-*.egg-info -%{python_sitelib}/%{modname}-*-nspkg.pth +%exclude %{python2_sitelib}/zope/structuredtext/tests.py* +%exclude %{python2_sitelib}/zope/structuredtext/regressions/ +%{python2_sitelib}/%{modname}-*.egg-info +%{python2_sitelib}/%{modname}-*-nspkg.pth +%if 0%{?with_python3} +%files -n python3-zope-structuredtext +%doc CHANGES.rst README.rst TODO.txt COPYRIGHT.txt html/ +%license LICENSE.txt +%{python3_sitelib}/zope/structuredtext/ +# Co-own %%{python3_sitelib}/zope/ +%dir %{python3_sitelib}/zope/ +# exclude the tests and data needed only for tests +%exclude %{python3_sitelib}/zope/structuredtext/tests.py* +%exclude %{python3_sitelib}/zope/structuredtext/regressions/ +%{python3_sitelib}/%{modname}-*.egg-info +%{python3_sitelib}/%{modname}-*-nspkg.pth +%endif %changelog +* Tue Apr 05 2016 Ralph Bean - 4.1.0-2 +- Add a python3 subpackage. +- Modernize python macros. + * Tue Apr 05 2016 Ralph Bean - 4.1.0-1 - Latest upstream.