From a3d3cf9a8e7eeade0e2352c13bd950b941d95329 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Sat, 18 Feb 2017 09:53:25 -0800 Subject: [PATCH] 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__ --- python-sphinx.spec | 57 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/python-sphinx.spec b/python-sphinx.spec index b65cdcc..c79a8ca 100644 --- a/python-sphinx.spec +++ b/python-sphinx.spec @@ -15,7 +15,7 @@ Name: python-sphinx Version: 1.5.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Python documentation generator Group: Development/Tools @@ -348,6 +348,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} @@ -369,12 +373,19 @@ popd %install + %if 0%{?with_python3} %py3_install 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 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 %{builddir}%{python3_sitelib}/sphinx/pycode/pgen2/parse.{pyx,c} %endif # with_python3 %py2_install @@ -383,6 +394,12 @@ for i in sphinx-{apidoc,autogen,build,quickstart}; do ln -s $i-%{python2_version} %{buildroot}%{_bindir}/$i-2 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 %{builddir}%{python2_sitelib}/sphinx/pycode/pgen2/parse.{pyx,c} + for i in sphinx-{apidoc,autogen,build,quickstart}; do touch %{buildroot}%{_bindir}/$i done @@ -516,14 +533,14 @@ fi %exclude %{_mandir}/man1/sphinx-*-%{python3_version}.1* %{_mandir}/man1/* -%ghost %{_bindir}/sphinx-apidoc -%ghost %{_bindir}/sphinx-autogen -%ghost %{_bindir}/sphinx-build -%ghost %{_bindir}/sphinx-quickstart -%ghost %{_mandir}/man1/sphinx-all.1.gz -%ghost %{_mandir}/man1/sphinx-apidoc.1.gz -%ghost %{_mandir}/man1/sphinx-build.1.gz -%ghost %{_mandir}/man1/sphinx-quickstart.1.gz +%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 @@ -534,14 +551,14 @@ fi %{python3_sitelib}/Sphinx-%{version}-py%{python3_version}.egg-info/ %{_mandir}/man1/sphinx-*-%{python3_version}.1* -%ghost %{_bindir}/sphinx-apidoc -%ghost %{_bindir}/sphinx-autogen -%ghost %{_bindir}/sphinx-build -%ghost %{_bindir}/sphinx-quickstart -%ghost %{_mandir}/man1/sphinx-all.1.gz -%ghost %{_mandir}/man1/sphinx-apidoc.1.gz -%ghost %{_mandir}/man1/sphinx-build.1.gz -%ghost %{_mandir}/man1/sphinx-quickstart.1.gz +%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 @@ -550,6 +567,12 @@ fi %changelog +* 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__ + * 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