代码拉取完成,页面将自动刷新
%bcond_with python_bootstrap
# open this flag when support more pkg
%bcond_with websupport
# open this flag when support latex
%bcond_with latex
%global py3_shebang_flags %nil
%global common_description %{expand:
Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python
projects (or other documents consisting of multiple reStructuredText sources), written by Georg
Brandl. It was originally created to translate the new Python documentation, but has now been
cleaned up in the hope that it will be useful to many other projects.
Sphinx uses reStructuredText as its markup language, and many of its strengths come from the power
and straightforwardness of reStructuredText and its parsing and translating suite, the Docutils.
Although it is still under constant development, the following features are already present, work
fine and can be seen "in action" in the Python docs:
* Output formats: HTML (including Windows HTML Help) and LaTeX, for printable PDF versions
* Extensive cross-references: semantic markup and automatic links for functions, classes,
glossary terms and similar pieces of information
* Hierarchical structure: easy definition of a document tree, with automatic links to siblings,
parents and children
* Automatic indices: general index as well as a module index
* Code handling: automatic highlighting using the Pygments highlighter
* Various extensions are available, e.g. for automatic testing of snippets and inclusion of
appropriately formatted docstrings.
}
Summary: Python documentation generator
Name: python-sphinx
Version: 7.0.1
Release: 5%{?dist}
License: BSD and Python and MIT
URL: https://www.sphinx-doc.org/
Source0: https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz
Patch3000: sphinx-test_theming.diff
BuildRequires: make python%{python3_pkgversion}-devel pyproject-rpm-macros
%if %{with websupport}
BuildRequires: python%{python3_pkgversion}-sphinxcontrib-websupport
%endif
BuildRequires: python%{python3_pkgversion}-test gcc gettext graphviz texinfo
# latex tests
%if %{with latex}
BuildRequires: texlive-collection-fontsrecommended texlive-collection-latex texlive-dvipng texlive-dvisvgm
BuildRequires: tex(amsmath.sty) tex(amsthm.sty) tex(anyfontsize.sty) tex(article.cls)
BuildRequires: tex(capt-of.sty) tex(cmap.sty) tex(color.sty) tex(ctablestack.sty)
BuildRequires: tex(fancyhdr.sty) tex(fancyvrb.sty) tex(fncychap.sty) tex(framed.sty)
BuildRequires: tex(FreeSerif.otf) tex(geometry.sty) tex(hyperref.sty) tex(kvoptions.sty)
BuildRequires: tex(parskip.sty) tex(wrapfig.sty) tex(luatex85.sty) tex(needspace.sty)
BuildRequires: tex(polyglossia.sty) tex(tabulary.sty) tex(titlesec.sty) tex(upquote.sty) tex(utf8x.def)
%endif
BuildArch: noarch
%description
%{common_description}
%package -n python%{python3_pkgversion}-sphinx
Summary: Python documentation generator
Provides: bundled(jquery) = 3.5.1
Provides: bundled(underscore) = 1.3.1
Provides: bundled(css3-mediaqueries) = 1.0
Recommends: graphviz
Recommends: ImageMagick
%description -n python%{python3_pkgversion}-sphinx
%{common_description}
%if %{with latex}
%package -n python%{python3_pkgversion}-sphinx-latex
Summary: LaTeX builder dependencies for python%{python3_pkgversion}-sphinx
Requires: python%{python3_pkgversion}-sphinx = %{version}-%{release}
Requires: texlive-collection-fontsrecommended texlive-collection-latex texlive-dvipng texlive-dvisvgm
Requires: tex(amsmath.sty) tex(amsthm.sty) tex(anyfontsize.sty) tex(article.cls) tex(capt-of.sty)
Requires: tex(cmap.sty) tex(color.sty) tex(ctablestack.sty) tex(fancyhdr.sty) tex(fancyvrb.sty)
Requires: tex(fncychap.sty) tex(framed.sty) tex(FreeSerif.otf) tex(geometry.sty) tex(hyperref.sty)
Requires: tex(kvoptions.sty) tex(luatex85.sty) tex(needspace.sty) tex(parskip.sty) tex(polyglossia.sty)
Requires: tex(tabulary.sty) tex(titlesec.sty) tex(upquote.sty) tex(utf8x.def) tex(wrapfig.sty)
%description -n python%{python3_pkgversion}-sphinx-latex
%{common_description}
This package pulls in the TeX dependencies needed by Sphinx's LaTeX builder.
%endif
%package doc
Summary: Documentation for %{name}
License: BSD-2-Clause
Recommends: python%{python3_pkgversion}-sphinx = %{version}-%{release}
%description doc
Sphinx is a tool that makes it easy to create intelligent and
beautiful documentation for Python projects (or other documents
consisting of multiple reStructuredText sources), written by Georg
Brandl. It was originally created to translate the new Python
documentation, but has now been cleaned up in the hope that it will be
useful to many other projects.
This package contains documentation in the HTML format.
%prep
%autosetup -n Sphinx-%{version} -p1
rm tests/test_ext_imgconverter.py
sed -i '/filelock/d' pyproject.toml
rm tests/test_build_linkcheck.py tests/test_ext_intersphinx.py
%generate_buildrequires
%pyproject_buildrequires -r %{!?with_python_bootstrap:-x test}
%build
%pyproject_wheel
export PYTHONPATH="$PWD:%{?with_python_bootstrap:$PYTHONPATH}"
pushd doc
export SPHINXBUILD="%{python3} ../sphinx/cmd/build.py"
make html SPHINXBUILD="$SPHINXBUILD"
make man SPHINXBUILD="$SPHINXBUILD"
rm -rf _build/html/.buildinfo
# Those files are copied to _build/html/_images and loaded to the
# html pages from there - we can safely remove the duplicated and unused files
rm -rf _build/html/_static/themes _build/html/_static/tutorial
rm -f _build/html/_static/more.png _build/html/_static/translation.svg
mv _build/html ..
popd
%install
%pyproject_install
for i in sphinx-{apidoc,autogen,build,quickstart}; do
ln -s %{_bindir}/$i %{buildroot}%{_bindir}/$i-%{python3_version}
ln -s %{_bindir}/$i %{buildroot}%{_bindir}/$i-3
done
pushd doc
install -d %{buildroot}%{_mandir}/man1
for f in _build/man/sphinx-*.1;
do
cp -p $f %{buildroot}%{_mandir}/man1/$(basename $f)
done
popd
pushd %{buildroot}%{python3_sitelib}
for lang in `find sphinx/locale -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' -printf "%f "`;
do
test $lang == __pycache__ && continue
install -d %{buildroot}%{_datadir}/sphinx/locale/$lang
install -d %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES
mv sphinx/locale/$lang/LC_MESSAGES/sphinx.js \
%{buildroot}%{_datadir}/sphinx/locale/$lang/
mv sphinx/locale/$lang/LC_MESSAGES/sphinx.mo \
%{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/
rm -rf sphinx/locale/$lang
done
popd
mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
%find_lang sphinx
(cd %{buildroot} && find . -name 'sphinx.js') | sed -e 's|^.||' | sed -e \
's:\(.*/locale/\)\([^/_]\+\)\(.*\.js$\):%lang(\2) \1\2\3:' \
>> sphinx.lang
%if %{without python_bootstrap}
%check
# disable internet test for koji
%pytest -k "not linkcheck and not test_latex_images and not test_build_latex_doc"
%endif
%files -n python%{python3_pkgversion}-sphinx -f sphinx.lang
%license LICENSE
%doc AUTHORS CHANGES EXAMPLES README.rst
%{_bindir}/sphinx-*
%{python3_sitelib}/sphinx/
%dir %{python3_sitelib}/sphinxcontrib/
%{python3_sitelib}/sphinx-%{version}.dist-info/
%dir %{_datadir}/sphinx/
%dir %{_datadir}/sphinx/locale
%dir %{_datadir}/sphinx/locale/*
%{_mandir}/man1/sphinx-*
%if %{with latex}
%files -n python%{python3_pkgversion}-sphinx-latex
# blank for metapackage
%endif
%files doc
%license LICENSE
%doc html
%changelog
* Thu Sep 26 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 7.0.1-5
- Rebuilt for clarifying the packages requirement in BaseOS and AppStream
* Thu Sep 12 2024 Yi Lin <nilusyi@tencent.com> - 7.0.1-4
- [Type] other
- [DESC] remove subpkg latex
* Mon Aug 19 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 7.0.1-3
- [Type] other
- [DESC] Add subpkg latex
* Fri Aug 16 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 7.0.1-2
- Rebuilt for loongarch release
* Fri Sep 22 2023 Shuo Wang <abushwang@tencent.com> - 7.0.1-1
- update to 7.0.1
* Thu Sep 21 2023 Shuo Wang <abushwang@tencent.com> - 5.3.0-1
- update to 5.3.0
* Tue Sep 19 2023 Shuo Wang <abushwang@tencent.com> - 4.3.1-8
- bypass some test due to pygments updating
* Tue Sep 19 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.3.1-7
- Rebuilt for python 3.11
* Tue Sep 12 2023 Shuo Wang <abushwang@tencent.com> - 4.3.1-6
- bypass many test for update python3.11
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.3.1-5
- Rebuilt for OpenCloudOS Stream 23.09
* Mon Aug 7 2023 Wang Guodong <gordonwwang@tencent.com> - 4.3.1-4
- Update tests for Babel 2.12
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.3.1-3
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 4.3.1-2
- Rebuilt for OpenCloudOS Stream 23
* Fri Feb 10 2023 Shuo Wang <abushwang@tencent.com> - 4.3.1-1
- initial build
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。