From 7c92ca4063c13b4ec6d9100b027b87ef131a1f41 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Tue, 23 Apr 2019 18:58:41 +0300 Subject: [PATCH] 1:1.6.5-alt4 - introduce doc knob (having a hairy package build its own documentation is a *very* bad thing during bootstrap and can hurt package version upgrades badly either) - added explicit BR: python3(requests.exceptions) --- .gear/python-module-sphinx.spec | 70 +++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/.gear/python-module-sphinx.spec b/.gear/python-module-sphinx.spec index 05c29a0..a5c107c 100644 --- a/.gear/python-module-sphinx.spec +++ b/.gear/python-module-sphinx.spec @@ -1,17 +1,29 @@ +%def_with doc + %define oname sphinx %define sphinx_dir %python_sitelibdir_noarch/%oname %define sphinx3_dir %python3_sitelibdir_noarch/%oname Name: python-module-%oname Version: 1.6.5 -Release: alt3 +Release: alt4 Epoch: 1 Summary: Tool for producing documentation for Python projects License: BSD Group: Development/Python + Url: http://sphinx.pocoo.org/ # https://github.com/sphinx-doc/sphinx.git + +Source0: %name-%version.tar +Source1: conf.py.template +Source2: macro +Source3: macro3 +Source4: refcounting.py +Source5: sphinx-1.6.4-alt-disable-remote-tests.patch +Patch0: sphinx-1.4b1-alt-avoid-download-objects.inv.patch + BuildArch: noarch %py_requires simplejson @@ -24,24 +36,17 @@ BuildArch: noarch Provides: python-module-objects.inv Obsoletes: python-module-objects.inv -Source0: %name-%version.tar -Source1: conf.py.template -Source2: macro -Source3: macro3 -Source4: refcounting.py -Source5: sphinx-1.6.4-alt-disable-remote-tests.patch -Patch0: sphinx-1.4b1-alt-avoid-download-objects.inv.patch - BuildRequires(pre): rpm-build-python +%if_with doc BuildRequires: python-sphinx-objects.inv BuildRequires: python-module-docutils BuildRequires: python-module-html5lib +BuildRequires: python2.7(sphinxcontrib.websupport) +BuildRequires: python2.7(sphinxcontrib) +%endif BuildRequires: python-module-nose -BuildRequires: python-module-alabaster BuildRequires: python2.7(typing) -BuildRequires: python2.7(sphinxcontrib.websupport) BuildRequires: /usr/bin/convert -BuildRequires: python2.7(sphinxcontrib) BuildRequires: %py_dependencies imagesize # For %%check: BuildRequires: %py_dependencies mock @@ -52,16 +57,19 @@ BuildRequires: python-module-Pygments >= 2.1.3 BuildRequires: python-module-alabaster >= 0.7.6-alt2.git20150703 BuildRequires(pre): rpm-build-python3 +%if_with doc +BuildPreReq: python3(docutils) BuildPreReq: python3-module-html5lib +BuildPreReq: python3(sphinxcontrib.websupport) +BuildPreReq: python3(requests.exceptions) +%endif BuildPreReq: python3-module-nose BuildPreReq: python3(typing) -BuildPreReq: python3(sphinxcontrib.websupport) # For python3-2to3: BuildPreReq: python3-tools # For running the new sphinx itself (and generating the docs): BuildPreReq: python3(imagesize) BuildPreReq: python3(mock) -BuildPreReq: python3(docutils) BuildPreReq: python3(jinja2) BuildPreReq: python3(pygments) BuildPreReq: python3-module-SQLAlchemy >= 1.0.8-alt2 @@ -150,7 +158,9 @@ This packages contains RPM macros for build with Sphinx. Summary: Development package for Sphinx Group: Development/Python Requires: %name = %epoch:%version-%release +%if_with doc Requires: %name-pickles = %epoch:%version-%release +%endif Requires: rpm-macros-sphinx = %epoch:%version-%release %description devel @@ -223,7 +233,7 @@ This packages contains pickles for Sphinx. %prep %setup -%patch0 -p1 +%patch -p1 install -pm644 %_sourcedir/conf.py.template . ln -s %_datadir/python-sphinx/objects.inv doc/ @@ -252,9 +262,11 @@ sed -i 's|%_bindir/env python|%_bindir/env python3|' \ popd +%if_with doc # docs %make_build -C doc html %make_build -C doc man +%endif %install pushd ../python3 @@ -296,6 +308,12 @@ ln -rs %buildroot%_datadir/python-sphinx/objects.inv \ ln -frs %buildroot%_datadir/python-sphinx/objects.inv \ %buildroot%sphinx_dir/tests/ +# macros +install -d %buildroot%_rpmmacrosdir +sed -e 's:@SPHINX_DIR@:%sphinx_dir:g' < macro > %buildroot%_rpmmacrosdir/sphinx +sed -e 's:@SPHINX3_DIR@:%sphinx3_dir:g' < ../python3/macro3 > %buildroot%_rpmmacrosdir/sphinx3 + +%if_with doc # docs install -d %buildroot%_docdir/%name install -d %buildroot%_man1dir @@ -303,11 +321,6 @@ cp -R doc/_build/html %buildroot%_docdir/%name/ install -p -m644 AUTHORS CHANGES* EXAMPLES LICENSE README.rst \ %buildroot%_docdir/%name -# macros -install -d %buildroot%_rpmmacrosdir -sed -e 's:@SPHINX_DIR@:%sphinx_dir:g' < macro > %buildroot%_rpmmacrosdir/sphinx -sed -e 's:@SPHINX3_DIR@:%sphinx3_dir:g' < ../python3/macro3 > %buildroot%_rpmmacrosdir/sphinx3 - # add pickle files %make_build -C doc pickle @@ -320,6 +333,7 @@ install -p -m644 conf.py.template \ install -p -m644 conf.py.template \ %buildroot%sphinx3_dir/ +%endif mkdir -p %buildroot%_rpmlibdir cat <<\EOF >%buildroot%_rpmlibdir/%name-files.req.list @@ -351,21 +365,25 @@ PYTHONPATH=$(pwd) %make_build test %exclude %_bindir/*-3* %sphinx_dir/ %exclude %sphinx_dir/tests +%if_with doc %exclude %sphinx_dir/pickle %exclude %sphinx_dir/doctrees +%endif %python_sitelibdir/*.egg-info %files devel +%files tests +%sphinx_dir/tests + +%if_with doc %files pickles %sphinx_dir/pickle %sphinx_dir/doctrees -%files tests -%sphinx_dir/tests - %files doc %doc %_docdir/%name +%endif %files -n rpm-macros-sphinx %_rpmmacrosdir/sphinx @@ -389,6 +407,12 @@ PYTHONPATH=$(pwd) %make_build test %changelog +* Tue Apr 23 2019 Michael Shigorin 1:1.6.5-alt4 +- introduce doc knob (having a hairy package build its own + documentation is a *very* bad thing during bootstrap + and can hurt package version upgrades badly either) +- added explicit BR: python3(requests.exceptions) + * Tue Sep 18 2018 Igor Vlasenko 1:1.6.5-alt3 - added sphinx-build-3 for compatibility with fedora -- 2.10.4