diff --git a/.gitignore b/.gitignore index 0134fae..b4b31fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1 @@ -/Sphinx-1.2.3.tar.gz -/Sphinx-1.3.1.tar.gz -/Sphinx-1.4.4.tar.gz -/Sphinx-1.4.5.tar.gz -/Sphinx-1.4.6.tar.gz -/Sphinx-1.4.8.tar.gz -/Sphinx-1.4.9.tar.gz +/Sphinx-1.5.2.tar.gz diff --git a/fix-crash-on-parallel-build.patch b/fix-crash-on-parallel-build.patch new file mode 100644 index 0000000..9bf01c7 --- /dev/null +++ b/fix-crash-on-parallel-build.patch @@ -0,0 +1,12 @@ +diff --git a/sphinx/util/parallel.py b/sphinx/util/parallel.py +index ce51ac0..64f9bc1 100644 +--- a/sphinx/util/parallel.py ++++ b/sphinx/util/parallel.py +@@ -100,6 +100,7 @@ class ParallelTasks(object): + raise SphinxParallelError(*result) + self._result_funcs.pop(tid)(self._args.pop(tid), result) + self._procs[tid].join() ++ self._precvs.pop(tid) + self._pworking -= 1 + break + else: diff --git a/python-sphinx.spec b/python-sphinx.spec index 149a5e5..394cd8c 100644 --- a/python-sphinx.spec +++ b/python-sphinx.spec @@ -4,18 +4,18 @@ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif -# At some point, RHEL will need to be in here too -%if 0%{?fedora} && 0%{?fedora} > 24 -%global py3_default 1 +# Currently Fedora policy is that the python2 version is the default version +%if 0 +%global py3_alt_priority 500 %else -%global py3_default 0 +%global py3_alt_priority 10 %endif %global upstream_name Sphinx Name: python-sphinx -Version: 1.4.9 -Release: 2%{?dist} +Version: 1.5.2 +Release: 3%{?dist} Summary: Python documentation generator Group: Development/Tools @@ -27,11 +27,13 @@ Group: Development/Tools License: BSD and Public Domain and Python and (MIT or GPLv2) URL: http://sphinx-doc.org/ Source0: https://files.pythonhosted.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz -Source1: python2-sphinx -Source2: python3-sphinx -Source3: zz-modules-python-sphinx.sh -Source4: zz-modules-python-sphinx.csh -#Patch0: Sphinx-1.2.1-mantarget.patch + +# Backport of a bugfix from the 1.6 upstream branch of sphinx +# to address a crash with parallel building. +# https://bugzilla.redhat.com/show_bug.cgi?id=1494276 +# Upstream commit: +# https://github.com/sphinx-doc/sphinx/pull/4039/commits/0cb57f19a099be2809a8fb5dc9274f7411e1caac +Patch0: fix-crash-on-parallel-build.patch BuildArch: noarch BuildRequires: python2-devel >= 2.4 @@ -44,6 +46,7 @@ BuildRequires: python-six BuildRequires: python2-sphinx_rtd_theme BuildRequires: python2-sphinx-theme-alabaster BuildRequires: python2-imagesize +BuildRequires: python2-requests BuildRequires: environment(modules) # for fixes @@ -51,13 +54,18 @@ BuildRequires: dos2unix # for testing BuildRequires: python-nose +BuildRequires: python2-pytest +BuildRequires: python-pytest-cov BuildRequires: gettext BuildRequires: texinfo BuildRequires: graphviz BuildRequires: python-sqlalchemy BuildRequires: python2-mock +BuildRequires: python2-simplejson +BuildRequires: python-html5lib BuildRequires: python-whoosh BuildRequires: python2-snowballstemmer +BuildRequires: python-enum34 # note: no Python3 xapian binding yet BuildRequires: xapian-bindings-python BuildRequires: texlive-collection-fontsrecommended @@ -67,7 +75,6 @@ BuildRequires: texlive-dvisvgm BuildRequires: texlive-ucs BuildRequires: tex(cmap.sty) BuildRequires: tex(ecrm1000.tfm) -BuildRequires: tex(fancybox.sty) BuildRequires: tex(footnote.sty) BuildRequires: tex(framed.sty) BuildRequires: tex(multirow.sty) @@ -90,6 +97,10 @@ BuildRequires: tex(eqparbox.sty) BuildRequires: tex(atbegshi.sty) BuildRequires: tex(anyfontsize.sty) BuildRequires: tex(luatex85.sty) +BuildRequires: tex(fncychap.sty) +BuildRequires: tex(tabulary.sty) +BuildRequires: tex(polyglossia.sty) +BuildRequires: tex(eu1enc.def) %if 0%{?with_python3} BuildRequires: python3-devel @@ -99,14 +110,19 @@ BuildRequires: python3-docutils BuildRequires: python3-jinja2 BuildRequires: python3-pygments BuildRequires: python3-nose +BuildRequires: python3-pytest +BuildRequires: python3-pytest-cov BuildRequires: python3-sqlalchemy BuildRequires: python3-mock +BuildRequires: python3-simplejson +BuildRequires: python3-html5lib BuildRequires: python3-whoosh BuildRequires: python3-snowballstemmer BuildRequires: python3-six BuildRequires: python3-sphinx_rtd_theme BuildRequires: python3-sphinx-theme-alabaster BuildRequires: python3-imagesize +BuildRequires: python3-requests %endif # with_python3 @@ -152,11 +168,10 @@ Requires: python2-sphinx_rtd_theme Requires: python2-six Requires: python2-sphinx-theme-alabaster Requires: python2-imagesize -Requires(posttrans): Lmod -# Needed to get rid of the alternatives config installed in f24 and f25 -# versions of the package -Requires(posttrans): /usr/sbin/alternatives +Requires: python2-requests Recommends: graphviz +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives Obsoletes: python-sphinx <= 1.2.3 Obsoletes: python-sphinxcontrib-napoleon < 0.5 Provides: python-sphinxcontrib-napoleon = %{version}-%{release} @@ -205,7 +220,6 @@ Requires: texlive-dvisvgm Requires: texlive-ucs Requires: tex(cmap.sty) Requires: tex(ecrm1000.tfm) -Requires: tex(fancybox.sty) Requires: tex(footnote.sty) Requires: tex(framed.sty) Requires: tex(multirow.sty) @@ -228,6 +242,10 @@ Requires: tex(eqparbox.sty) Requires: tex(atbegshi.sty) Requires: tex(anyfontsize.sty) Requires: tex(luatex85.sty) +Requires: tex(fncychap.sty) +Requires: tex(tabulary.sty) +Requires: tex(polyglossia.sty) +Requires: tex(eu1enc.def) Obsoletes: python3-sphinx-latex < 1.4.4-2 %description latex @@ -256,18 +274,16 @@ Requires: python3-snowballstemmer Requires: python3-sphinx_rtd_theme Requires: python3-sphinx-theme-alabaster Requires: python3-imagesize +Requires: python3-requests Requires: python3-six Recommends: graphviz -Requires(posttrans): Lmod -# Needed to get rid of the alternatives config installed in f24 and f25 -# versions of the package -Requires(posttrans): /usr/sbin/alternatives +Requires(post): %{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives Obsoletes: python3-sphinxcontrib-napoleon < 0.3.0 Provides: python3-sphinxcontrib-napoleon = %{version}-%{release} Provides: python(Sphinx) = %{version}-%{release} %{?python_provide:%python_provide python3-sphinx} Conflicts: python2-Sphinx < %{version}-%{release} -Conflicts: python2-sphinx < %{version}-%{release} %description -n python3-sphinx Sphinx is a tool that makes it easy to create intelligent and @@ -339,6 +355,10 @@ sed '1d' -i sphinx/pycode/pgen2/token.py # fix line encoding of bundled jquery.js dos2unix -k ./sphinx/themes/basic/static/jquery.js +# In 1.5.2, the upstream tarball left this .pyc by mistake. +# Remove it so that it doesn't get included in the python3 build by mistake +rm sphinx/locale/__init__.pyc + %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} @@ -360,22 +380,35 @@ popd %install + %if 0%{?with_python3} %py3_install -install -d %{buildroot}%{_libexecdir}/python3-sphinx for i in sphinx-{apidoc,autogen,build,quickstart}; do mv %{buildroot}%{_bindir}/$i %{buildroot}%{_bindir}/$i-%{python3_version} ln -s $i-%{python3_version} %{buildroot}%{_bindir}/$i-3 - ln -s %{_bindir}/$i-3 %{buildroot}%{_libexecdir}/python3-sphinx/$i done + +# These appear to be incomplete C extensions to speed up parsing. They are not +# built by setup.py yet. Removing them in %%install so that if sphinx does +# make use of them, and we don't notice, we only remove these source files +# after the build has created the .so's +rm %{buildroot}%{python3_sitelib}/sphinx/pycode/pgen2/parse.{pyx,c} %endif # with_python3 %py2_install -install -d %{buildroot}%{_libexecdir}/python2-sphinx for i in sphinx-{apidoc,autogen,build,quickstart}; do mv %{buildroot}%{_bindir}/$i %{buildroot}%{_bindir}/$i-%{python2_version} ln -s $i-%{python2_version} %{buildroot}%{_bindir}/$i-2 - ln -s %{_bindir}/$i-2 %{buildroot}%{_libexecdir}/python2-sphinx/$i +done + +# These appear to be incomplete C extensions to speed up parsing. They are not +# built by setup.py yet. Removing them in %%install so that if sphinx does +# make use of them, and we don't notice, we only remove these source files +# after the build has created the .so's +rm %{buildroot}%{python2_sitelib}/sphinx/pycode/pgen2/parse.{pyx,c} + +for i in sphinx-{apidoc,autogen,build,quickstart}; do + touch %{buildroot}%{_bindir}/$i done pushd doc @@ -383,9 +416,6 @@ pushd doc install -d %{buildroot}%{_mandir}/man1 for f in _build/man/sphinx-*.1; do - ### TODO: these are all the same. Do we really need to ship them three - ### times or is it fine to just ship them as e.g. sphinx-build.1 - cp -p $f %{buildroot}%{_mandir}/man1/$(basename $f) cp -p $f %{buildroot}%{_mandir}/man1/$(basename $f | sed -e "s|.1$|-%{python2_version}.1|") cp -p $f %{buildroot}%{_mandir}/man1/$(basename $f | sed -e "s|.1$|-%{python3_version}.1|") done @@ -415,38 +445,6 @@ do rm -rf sphinx/locale/$lang done popd - -install -d %{buildroot}%{_modulesdir}/python-sphinx -install -m 0644 %{SOURCE1} %{buildroot}%{_modulesdir}/python-sphinx/ -sed -i 's|@python2_sphinx_dir@|%{_libexecdir}/python2-sphinx|' %{buildroot}%{_modulesdir}/python-sphinx/python2-sphinx -install -m 0644 %{SOURCE2} %{buildroot}%{_modulesdir}/python-sphinx/ -sed -i 's|@python3_sphinx_dir@|%{_libexecdir}/python3-sphinx|' %{buildroot}%{_modulesdir}/python-sphinx/python3-sphinx -install -d %{buildroot}%{_sysconfdir}/profile.d -install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/profile.d/zz-modules-python-sphinx.sh -install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/zz-modules-python-sphinx.csh - -%if %{py3_default} -ln -s python3-sphinx %{buildroot}%{_modulesdir}/python-sphinx/default - -# These symlinks establish a default for when a package is first installed (and -# therefore, environment modules is not loaded). The user can immediately -# switch them by using module swap python-sphinx/python2-sphinx -for filename in sphinx-{build,apidoc,autogen,quickstart} ; do -ln -s %{_libexecdir}/python3-sphinx/$filename %{buildroot}%{_bindir}/$filename -done - -%else -ln -s python2-sphinx %{buildroot}%{_modulesdir}/python-sphinx/default - -# These symlinks establish a default for when a package is first installed (and -# therefore, environment modules is not loaded). The user can immediately -# switch them by using module swap python-sphinx/python3-sphinx -for filename in sphinx-{build,apidoc,autogen,quickstart} ; do -ln -s %{_libexecdir}/python2-sphinx/$filename %{buildroot}%{_bindir}/$filename -done - -%endif - %find_lang sphinx # Language files; Since these are javascript, it's not immediately obvious to @@ -457,26 +455,72 @@ done %check -LANG=en_US.UTF-8 make test + +# Hate to disable checks but they need pytest 3.0+ in order to function +# and we don't have that on F25. + +#LANG=en_US.UTF-8 make test %if 0%{?with_python3} pushd %{py3dir} -LANG=en_US.UTF-8 PYTHON=python3 make test +#LANG=en_US.UTF-8 PYTHON=python3 make test popd %endif # with_python3 +%post -n python2-sphinx -%pre -n python2-sphinx -# python-sphinx as shipped in an update to f24 and f25 used alternatives. So -# we need to clean up the alternatives configuration until at least f27 -%{_sbindir}/update-alternatives --remove sphinx-build %{_bindir}/sphinx-build-%{python2_version} || : +# Remove old versions of files so alternatives doesn't break +for filename in %{_mandir}/man1/sphinx-{all,apidoc,build,quickstart}.1.gz %{_bindir}/sphinx-{build,apidoc,autogen,quickstart} +do + if [ ! -L $filename ] + then + rm -f $filename + fi +done + +%{_sbindir}/update-alternatives --install %{_bindir}/sphinx-build \ + sphinx-build %{_bindir}/sphinx-build-%{python2_version} 100 \ + --slave %{_bindir}/sphinx-apidoc sphinx-apidoc %{_bindir}/sphinx-apidoc-%{python2_version} \ + --slave %{_bindir}/sphinx-autogen sphinx-autogen %{_bindir}/sphinx-autogen-%{python2_version} \ + --slave %{_bindir}/sphinx-quickstart sphinx-quickstart %{_bindir}/sphinx-quickstart-%{python2_version} \ + --slave %{_mandir}/man1/sphinx-all.1.gz sphinx-all.1.gz %{_mandir}/man1/sphinx-all-%{python2_version}.1.gz \ + --slave %{_mandir}/man1/sphinx-apidoc.1.gz sphinx-apidoc.1.gz %{_mandir}/man1/sphinx-apidoc-%{python2_version}.1.gz \ + --slave %{_mandir}/man1/sphinx-build.1.gz sphinx-build.1.gz %{_mandir}/man1/sphinx-build-%{python2_version}.1.gz \ + --slave %{_mandir}/man1/sphinx-quickstart.1.gz sphinx-quickstart.1.gz %{_mandir}/man1/sphinx-quickstart-%{python2_version}.1.gz %if 0%{?with_python3} -%pre -n python3-sphinx -# python-sphinx as shipped in an update to f24 and f25 used alternatives. So -# we need to clean up the alternatives configuration until at least f27 -%{_sbindir}/update-alternatives --remove sphinx-build %{_bindir}/sphinx-build-%{python3_version} || : +%post -n python3-sphinx + +# Remove old versions of files so alternatives doesn't break +for filename in %{_mandir}/man1/sphinx-{all,apidoc,build,quickstart}.1.gz %{_bindir}/sphinx-{build,apidoc,autogen,quickstart} +do + if [ ! -L $filename ] + then + rm -f $filename + fi +done + +%{_sbindir}/update-alternatives --install %{_bindir}/sphinx-build \ + sphinx-build %{_bindir}/sphinx-build-%{python3_version} %{py3_alt_priority} \ + --slave %{_bindir}/sphinx-apidoc sphinx-apidoc %{_bindir}/sphinx-apidoc-%{python3_version} \ + --slave %{_bindir}/sphinx-autogen sphinx-autogen %{_bindir}/sphinx-autogen-%{python3_version} \ + --slave %{_bindir}/sphinx-quickstart sphinx-quickstart %{_bindir}/sphinx-quickstart-%{python3_version} \ + --slave %{_mandir}/man1/sphinx-all.1.gz sphinx-all.1.gz %{_mandir}/man1/sphinx-all-%{python3_version}.1.gz \ + --slave %{_mandir}/man1/sphinx-apidoc.1.gz sphinx-apidoc.1.gz %{_mandir}/man1/sphinx-apidoc-%{python3_version}.1.gz \ + --slave %{_mandir}/man1/sphinx-build.1.gz sphinx-build.1.gz %{_mandir}/man1/sphinx-build-%{python3_version}.1.gz \ + --slave %{_mandir}/man1/sphinx-quickstart.1.gz sphinx-quickstart.1.gz %{_mandir}/man1/sphinx-quickstart-%{python3_version}.1.gz %endif # with_python3 +%postun -n python2-sphinx +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove sphinx-build %{_bindir}/sphinx-build-%{python2_version} +fi + +%if 0%{?with_python3} +%postun -n python3-sphinx +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove sphinx-build %{_bindir}/sphinx-build-%{python3_version} +fi +%endif # with_python3 %files latex %license LICENSE @@ -495,34 +539,33 @@ popd %{python2_sitelib}/Sphinx-%{version}-py%{python2_version}.egg-info/ %exclude %{_mandir}/man1/sphinx-*-%{python3_version}.1* %{_mandir}/man1/* -%{_libexecdir}/python2-sphinx/ -%{_modulesdir}/python-sphinx/python2-sphinx -%if !%{py3_default} -%{_modulesdir}/python-sphinx/default -%endif -%{_sysconfdir}/profile.d/zz-modules-python-sphinx.sh -%{_sysconfdir}/profile.d/zz-modules-python-sphinx.csh +%ghost %attr(755, root, root) %{_bindir}/sphinx-apidoc +%ghost %attr(755, root, root) %{_bindir}/sphinx-autogen +%ghost %attr(755, root, root) %{_bindir}/sphinx-build +%ghost %attr(755, root, root) %{_bindir}/sphinx-quickstart +%ghost %attr(644, root, root) %{_mandir}/man1/sphinx-all.1.gz +%ghost %attr(644, root, root) %{_mandir}/man1/sphinx-apidoc.1.gz +%ghost %attr(644, root, root) %{_mandir}/man1/sphinx-build.1.gz +%ghost %attr(644, root, root) %{_mandir}/man1/sphinx-quickstart.1.gz %if 0%{?with_python3} %files -n python3-sphinx %license LICENSE %doc AUTHORS CHANGES EXAMPLES README.rst %{_bindir}/sphinx-*-3* -%{_bindir}/sphinx-build -%{_bindir}/sphinx-apidoc -%{_bindir}/sphinx-autogen -%{_bindir}/sphinx-quickstart %{python3_sitelib}/sphinx/ %{python3_sitelib}/Sphinx-%{version}-py%{python3_version}.egg-info/ %{_mandir}/man1/sphinx-*-%{python3_version}.1* -%{_libexecdir}/python3-sphinx/ -%{_modulesdir}/python-sphinx/python3-sphinx -%if %{py3_default} -%{_modulesdir}/python-sphinx/default -%endif -%{_sysconfdir}/profile.d/zz-modules-python-sphinx.sh -%{_sysconfdir}/profile.d/zz-modules-python-sphinx.csh + +%ghost %attr(755, root, root) %{_bindir}/sphinx-apidoc +%ghost %attr(755, root, root) %{_bindir}/sphinx-autogen +%ghost %attr(755, root, root) %{_bindir}/sphinx-build +%ghost %attr(755, root, root) %{_bindir}/sphinx-quickstart +%ghost %attr(644, root, root) %{_mandir}/man1/sphinx-all.1.gz +%ghost %attr(644, root, root) %{_mandir}/man1/sphinx-apidoc.1.gz +%ghost %attr(644, root, root) %{_mandir}/man1/sphinx-build.1.gz +%ghost %attr(644, root, root) %{_mandir}/man1/sphinx-quickstart.1.gz %endif # with_python3 @@ -531,13 +574,31 @@ popd %changelog -* Fri Dec 30 2016 Toshio Kuratomi - 1.4.9-2 -- Remove alternatives. Alternatives should only be used for a very small - number of packages (system daemons which also have a compatible command line - interface). -- Use environment-modules to switch between the python2 and python3 packages - *but* be aware that no amount of manual switching can get this 100% right. - The code has to be fixed upstream, not in packaging. +* Fri Sep 22 2017 Charalampos Stratakis - 1.5.2-3 +- Fix a crash on parallel build. + +* Sat Feb 18 2017 Toshio Kuratomi - - 1.5.2-2 +- Assign %%attrs to %%ghosted files so that rpm knows what permissions they + should have. +- Cleanup source files that should not be installed +- Fix the __init__.pyc that was byte compiled for the wrong python + +* Fri Feb 17 2017 Toshio Kuratomi - - 1.5.2-1 +- Update to 1.5.2 +- Remove a few latex dependencies that are no longer needed +- Remove xapian patch; now in upstream tarball +- Disable checks. The tests require pytest >= 3.0 and we only have + pytest-2.9.2 on F25 + +* Fri Feb 17 2017 Fedora Release Engineering - 1.5.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Feb 17 2017 Orion Poplawski - 1.5.1-1 +- Update to 1.5.1 + +* Wed Jan 18 2017 Toshio Kuratomi - - 1.4.9-3 +- Change alternatives priority so that the python2 version gets the default to + follow Fedora policy. * Tue Dec 13 2016 Charalampos Stratakis - 1.4.9-1 - Update to 1.4.9 diff --git a/python2-sphinx b/python2-sphinx deleted file mode 100644 index e015ae6..0000000 --- a/python2-sphinx +++ /dev/null @@ -1,6 +0,0 @@ -#%Module 1.0 -# -# python2-sphinx module for use with 'environment modules' package -# -conflict python-sphinx -prepend-path PATH @python2_sphinx_dir@ diff --git a/python3-sphinx b/python3-sphinx deleted file mode 100644 index 6d79fad..0000000 --- a/python3-sphinx +++ /dev/null @@ -1,6 +0,0 @@ -#%Module 1.0 -# -# python2-sphinx module for use with 'environment modules' package -# -conflict python-sphinx -prepend-path PATH @python3_sphinx_dir@ diff --git a/sources b/sources index 0eaf98a..a6650e7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Sphinx-1.4.9.tar.gz) = 8dd16fc947a59a1fadb0b00f0f6a83a4dd1321569cdb86a96d68f6f9c9acb85d5fa234ffde1a986b95346569b166a90647cc5e9b64516bc184ebad932b1c0156 +SHA512 (Sphinx-1.5.2.tar.gz) = 32c8fb98d72e998fcce8c46ceddcbb0a0776d0e9ce75dc96cef48139b8b47ebe9636243fb48b9e04c8e1d5c56e09fc4c60248fbbef810fba9813b83a3e6cbe88 diff --git a/zz-modules-python-sphinx.csh b/zz-modules-python-sphinx.csh deleted file mode 100644 index a0bc0b8..0000000 --- a/zz-modules-python-sphinx.csh +++ /dev/null @@ -1,2 +0,0 @@ -# Add path to the default python-sphinx scripts on this version of Fedora -module load python-sphinx diff --git a/zz-modules-python-sphinx.sh b/zz-modules-python-sphinx.sh deleted file mode 100644 index a0bc0b8..0000000 --- a/zz-modules-python-sphinx.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Add path to the default python-sphinx scripts on this version of Fedora -module load python-sphinx