Compare commits

...

No commits in common. "c8s" and "c10s" have entirely different histories.
c8s ... c10s

4 changed files with 358 additions and 106 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/sphinx_rtd_theme-0.3.1.tar.gz
/sphinx_rtd_theme-0.3.1.tar.gz
/sphinx_rtd_theme-*.tar.gz
/objects.inv

View File

@ -0,0 +1,58 @@
--- a/package.json
+++ b/package.json
@@ -25,7 +25,6 @@
"css-loader": "^3.6.0",
"file-loader": "^3.0.1",
"font-awesome": "^4.7.0",
- "html5shiv": "^3.7.3",
"imports-loader": "^0.8.0",
"jquery": "^3.6.0",
"lato-font": "^3.0.0",
--- a/package-lock.json
+++ b/package-lock.json
@@ -3314,12 +3314,6 @@
"integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==",
"dev": true
},
- "html5shiv": {
- "version": "3.7.3",
- "resolved": "https://registry.npmjs.org/html5shiv/-/html5shiv-3.7.3.tgz",
- "integrity": "sha512-SZwGvLGNtgp8GbgFX7oXEp8OR1aBt5LliX6dG0kdD1kl3KhMonN0QcSa/A3TsTgFewaGCbIryQunjayWDXzxmw==",
- "dev": true
- },
"http-deceiver": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz",
--- a/sphinx_rtd_theme/layout.html
+++ b/sphinx_rtd_theme/layout.html
@@ -61,9 +61,6 @@
{#- JAVASCRIPTS #}
{%- block scripts %}
- <!--[if lt IE 9]>
- <script src="{{ pathto('_static/js/html5shiv.min.js', 1) }}"></script>
- <![endif]-->
{%- if not embedded %}
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
{%- if sphinx_version_info >= (1, 8) -%}
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -1,6 +1,5 @@
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
-const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
@@ -66,11 +65,5 @@ module.exports = {
filename: "css/[name].css?[hash]",
chunkFilename: "css/[name].css?[hash]"
}),
- new CopyPlugin([
- {
- from: 'node_modules/html5shiv/dist/*.min.js',
- flatten: true,
- to: path.resolve(__dirname,'sphinx_rtd_theme/static/js') },
- ]),
]
};

View File

@ -1,28 +1,35 @@
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_py3 1
%global with_py2 0
%endif
%global srcname sphinx_rtd_theme
# Disables tests and docs
%bcond_with bootstrap
Name: python-%{srcname}
Version: 0.3.1
Release: 3%{?dist}
Version: 2.0.0
Release: 4%{?dist}
Summary: Sphinx theme for readthedocs.org
# SPDX
License: MIT
URL: https://github.com/snide/sphinx_rtd_theme
Source0: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz
URL: https://github.com/readthedocs/%{srcname}/
Source: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
# The koji builders do not have network access, and this file is not included
# in any Fedora package, so we retrieve it for offline use.
Source: https://docs.readthedocs.io/en/latest/objects.inv
# Remove all traces of html5shiv. We have no interest in supporting ancient
# versions of Internet Explorer.
Patch: %{name}-html5shiv.patch
BuildArch: noarch
%if 0%{?with_py2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%endif
%if 0%{?with_py3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: font(fontawesome)
BuildRequires: font(lato)
BuildRequires: font(robotoslab)
BuildRequires: make
BuildRequires: python%{python3_pkgversion}-devel
%if %{without bootstrap}
BuildRequires: %{py3_dist pytest}
BuildRequires: %{py3_dist sphinx}
BuildRequires: python-sphinx-doc
%endif
%description
@ -31,125 +38,311 @@ It's currently in development and includes some rtd variable checks that
can be ignored if you're just trying to use it on your project outside
of that site.
%if 0%{?with_py2}
%package -n python2-%{srcname}
%package -n python%{python3_pkgversion}-%{srcname}
Summary: Sphinx theme for readthedocs.org
Requires: fontawesome-fonts-web
Requires: font(fontawesome)
Requires: font(lato)
Requires: font(robotoslab)
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
%description -n python%{python3_pkgversion}-%{srcname}
This is a prototype mobile-friendly sphinx theme for readthedocs.org.
It's currently in development and includes some rtd variable checks that
can be ignored if you're just trying to use it on your project outside
of that site.
%endif
%if 0%{?with_py3}
%package -n python3-%{srcname}
Summary: Sphinx theme for readthedocs.org
Requires: fontawesome-fonts-web
%if %{without bootstrap}
%package doc
Summary: Documentation for the Sphinx theme for readthedocs.org
Requires: font(fontawesome)
Requires: font(lato)
Requires: font(robotoslab)
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname}
This is a prototype mobile-friendly sphinx theme for readthedocs.org.
It's currently in development and includes some rtd variable checks that
can be ignored if you're just trying to use it on your project outside
of that site.
%description doc
This package contains documentation for the Sphinx theme for
readthedocs.org.
%endif
%prep
%setup -q -c
%autosetup -p1 -n %{srcname}-%{version}
# Prepare for python3 build
cp -a %{srcname}-%{version} python3-%{srcname}-%{version}
# Use local objects.inv for intersphinx
sed -e "s|\('https://docs\.readthedocs\.io/en/stable/', \)None|\1'%{SOURCE1}'|" \
-e "s|\('https://www\.sphinx-doc\.org/en/master/', \)None|\1'%{_docdir}/python-sphinx-doc/html/objects.inv'|" \
-i docs/conf.py
# We modify the tests to avoid dependency on readthedocs-sphinx-ext.
# According to upstream, the test dependency is only used to test integration with that dependency.
# See https://github.com/readthedocs/readthedocs-sphinx-ext/pull/105#pullrequestreview-928253285
sed -Ei -e "/extensions\.append\('readthedocs_ext\.readthedocs'\)/d" \
-e "s/'readthedocs[^']*'(, ?)?//g" \
tests/util.py
# We patch the theme css files to unbundle fonts (they are required from Fedora)
# Using Web Assets shall support the use case when documentation is
# exported via web server
# See: https://docs.fedoraproject.org/en-US/packaging-guidelines/Web_Assets/
pushd sphinx_rtd_theme/static/css
rm -r fonts
# Edit the fonts references in theme.css and badge.css
for FONT in lato-normal=lato/Lato-Regular.ttf \
lato-bold=lato/Lato-Bold.ttf \
lato-normal-italic=lato/Lato-Italic.ttf \
lato-bold-italic=lato/Lato-BoldItalic.ttf \
Roboto-Slab-Regular=google-roboto-slab-fonts/RobotoSlab-Regular.ttf \
Roboto-Slab-Bold=google-roboto-slab-fonts/RobotoSlab-Bold.ttf;
do
L="${FONT%=*}"
R="${FONT#*=}"
# Get the font basename from the path
F="${R#*/}"
F_BASENAME="${F/.ttf}"
sed \
-e "s|src:\(url(fonts/$L\.[^)]*) format([^)]*),\?\)\+|src:local('$F_BASENAME'),url('/.sysassets/fonts/$R') format(\"truetype\")|g" \
-i theme.css
done
sed -e "s|src:url(fonts/fontawesome-webfont\.[^)]*);||" \
-e "s|src:\(url(fonts/fontawesome-webfont\.[^)]*) format([^)]*),\?\)\+|src:local(\"FontAwesome\"),url('/.sysassets/fonts/fontawesome/fontawesome-webfont.ttf') format(\"truetype\")|" \
-i badge_only.css theme.css
popd
# We cannot build the Javascript from source at this time, due to many missing
# dependencies. Convince the build script to skip building the Javascript and
# go on to the python.
mkdir -p build/lib/%{srcname}/static/js
cp -p sphinx_rtd_theme/static/js/badge_only.js build/lib/%{srcname}/static/js
cp -p sphinx_rtd_theme/static/js/theme.js build/lib/%{srcname}/static/js
%generate_buildrequires
%pyproject_buildrequires
%build
%if 0%{?with_py2}
# Python 2 build
pushd %{srcname}-%{version}
%py2_build
popd
%pyproject_wheel
%if %{without bootstrap}
# Build the documentation
make -C docs html
%endif
%if 0%{?with_py3}
# Python 3 build
pushd python3-%{srcname}-%{version}
%py3_build
popd
%endif
rst2html --no-datestamp README.rst README.html
%install
%if 0%{?with_py2}
# Python 2 install
pushd %{srcname}-%{version}
%py2_install
popd
%pyproject_install
# Don't use the bundled fonts
pushd %{buildroot}/%{python2_sitelib}/%{srcname}/static/fonts
rm fontawesome-webfont.* Lato*.ttf RobotoSlab*.ttf
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.eot .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.svg .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.woff .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.woff2 .
ln -s %{_datadir}/fonts/google-roboto-slab/RobotoSlab-Bold.ttf .
ln -s %{_datadir}/fonts/google-roboto-slab/RobotoSlab-Regular.ttf .
ln -s %{_datadir}/fonts/lato/Lato-Bold.ttf .
ln -s %{_datadir}/fonts/lato/Lato-BoldItalic.ttf .
ln -s %{_datadir}/fonts/lato/Lato-Italic.ttf .
ln -s %{_datadir}/fonts/lato/Lato-Regular.ttf .
popd
%if %{without bootstrap}
rm docs/build/html/.buildinfo
%endif
%if 0%{?with_py3}
# Python 3 install
pushd python3-%{srcname}-%{version}
%py3_install
popd
# Don't use the bundled fonts
pushd %{buildroot}/%{python3_sitelib}/%{srcname}/static/fonts
rm fontawesome-webfont.* Lato*.ttf RobotoSlab*.ttf
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.eot .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.svg .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.woff .
ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.woff2 .
ln -s %{_datadir}/fonts/google-roboto-slab/RobotoSlab-Bold.ttf .
ln -s %{_datadir}/fonts/google-roboto-slab/RobotoSlab-Regular.ttf .
ln -s %{_datadir}/fonts/lato/Lato-Bold.ttf .
ln -s %{_datadir}/fonts/lato/Lato-BoldItalic.ttf .
ln -s %{_datadir}/fonts/lato/Lato-Italic.ttf .
ln -s %{_datadir}/fonts/lato/Lato-Regular.ttf .
popd
%check
%if %{without bootstrap}
%pytest
%endif
%if 0%{?with_py2}
%files -n python2-%{srcname}
%doc %{srcname}-%{version}/README.rst
%license %{srcname}-%{version}/LICENSE
%{python2_sitelib}/%{srcname}*
%endif
# Test that the forbidden fonts were successfully removed from the css files
grep 'format("woff2\?")' \
%{buildroot}%{python3_sitelib}/%{srcname}/static/css/badge_only.css \
%{buildroot}%{python3_sitelib}/%{srcname}/static/css/theme.css \
&& exit 1 || true
%if 0%{?with_py3}
%files -n python3-%{srcname}
%doc python3-%{srcname}-%{version}/README.rst
%license python3-%{srcname}-%{version}/LICENSE
%{python3_sitelib}/%{srcname}*
%files -n python%{python3_pkgversion}-%{srcname}
%doc README.html
%license LICENSE
%{python3_sitelib}/%{srcname}-%{version}.dist-info/
%dir %{python3_sitelib}/%{srcname}/
%{python3_sitelib}/%{srcname}/__pycache__/
%{python3_sitelib}/%{srcname}/static/
%{python3_sitelib}/%{srcname}/*.html
%{python3_sitelib}/%{srcname}/*.py
%{python3_sitelib}/%{srcname}/theme.conf
%dir %{python3_sitelib}/%{srcname}/locale/
%{python3_sitelib}/%{srcname}/locale/sphinx.pot
%lang(da) %{python3_sitelib}/%{srcname}/locale/da/
%lang(de) %{python3_sitelib}/%{srcname}/locale/de/
%lang(en) %{python3_sitelib}/%{srcname}/locale/en/
%lang(es) %{python3_sitelib}/%{srcname}/locale/es/
%lang(et) %{python3_sitelib}/%{srcname}/locale/et/
%lang(fa_IR) %{python3_sitelib}/%{srcname}/locale/fa_IR/
%lang(fr) %{python3_sitelib}/%{srcname}/locale/fr/
%lang(hr) %{python3_sitelib}/%{srcname}/locale/hr/
%lang(hu) %{python3_sitelib}/%{srcname}/locale/hu/
%lang(it) %{python3_sitelib}/%{srcname}/locale/it/
%lang(lt) %{python3_sitelib}/%{srcname}/locale/lt/
%lang(nl) %{python3_sitelib}/%{srcname}/locale/nl/
%lang(pl) %{python3_sitelib}/%{srcname}/locale/pl/
%lang(pt) %{python3_sitelib}/%{srcname}/locale/pt/
%lang(pt_BR) %{python3_sitelib}/%{srcname}/locale/pt_BR/
%lang(ru) %{python3_sitelib}/%{srcname}/locale/ru/
%lang(sv) %{python3_sitelib}/%{srcname}/locale/sv/
%lang(tr) %{python3_sitelib}/%{srcname}/locale/tr/
%lang(zh_CN) %{python3_sitelib}/%{srcname}/locale/zh_CN/
%lang(zh_TW) %{python3_sitelib}/%{srcname}/locale/zh_TW/
%if %{without bootstrap}
%files doc
%doc docs/build/html
%license LICENSE
%endif
%changelog
* Mon Jun 18 2018 Lumír Balhar <lbalhar@redhat.com> - 0.3.1-3
- Python 2 subpackage disabled
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.0.0-4
- Bump release for June 2024 mass rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Dec 04 2023 Karolina Surma <ksurma@redhat.com> - 2.0.0-1
- Update to 2.0.0
Fixes rhbz#2233302
* Mon Oct 16 2023 Miro Hrončok <mhroncok@redhat.com> - 1.2.2-2
- Do not BuildRequire python3-sphinxcontrib-httpdomain, it was not needed
* Mon Aug 07 2023 Karolina Surma <ksurma@redhat.com> - 1.2.2-1
- Update to 1.2.2
Fixes rhbz#2213220
- Make the package compatible with docutils 0.20+ and Sphinx 7
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 1.2.1-2
- Rebuilt for Python 3.12
* Wed May 24 2023 Karolina Surma <ksurma@redhat.com> - 1.2.1-1
- Update to 1.2.1
Fixes rhbz#2209270
* Tue Feb 21 2023 Karolina Surma <ksurma@redhat.com> - 1.2.0-1
- Update to 1.2.0
Fixes rhbz#2154374
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Nov 09 2022 Karolina Surma <ksurma@redhat.com> - 1.1.1-1
- Update to the new upstream version
- Relax the python-docutils version requirement to <0.20
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jul 01 2022 Karolina Surma <ksurma@redhat.com> - 1.0.0-7
- Relax the python-docutils version requirement to <0.19
- Improve references to system fonts (needed by Firefox)
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.0.0-6
- Rebuilt for Python 3.11
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.0.0-5
- Bootstrap for Python 3.11
* Wed Apr 13 2022 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-4
- Avoid build dependency on readthedocs-sphinx-ext
* Fri Mar 25 2022 Karolina Surma <ksurma@redhat.com> - 1.0.0-3
- Unbundle fonts properly, improve referencing them in css files
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Tue Sep 14 2021 Jerry James <loganjerry@gmail.com> - 1.0.0-1
- Version 1.0.0
- Drop upstreamed patch for Sphinx 4.1+
- Use the pyproject macros
* Wed Aug 04 2021 Miro Hrončok <mhroncok@redhat.com> - 0.5.2-5
- Fix for Sphinx 4.1+
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.5.2-3
- Rebuilt for Python 3.10
* Wed Jun 02 2021 Python Maint <python-maint@redhat.com> - 0.5.2-2
- Bootstrap for Python 3.10
* Tue Apr 6 2021 Jerry James <loganjerry@gmail.com> - 0.5.2-1
- Version 0.5.2
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jan 4 2021 Jerry James <loganjerry@gmail.com> - 0.5.1-1
- Version 0.5.1
- Do not list language files twice
* Thu Dec 10 2020 Jerry James <loganjerry@gmail.com> - 0.5.0-1
- Version 0.5.0
- Drop upstreamed -script patch
- Do not even link to fonts; modify the CSS to point to system fonts
- Remove all traces of html5shiv
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.3-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 0.4.3-13
- Rebuilt for Python 3.9
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 0.4.3-12
- Bootstrap for Python 3.9
* Wed Mar 18 2020 Jerry James <loganjerry@gmail.com> - 0.4.3-11
- Fix symlinks to the Roboto fonts
* Tue Feb 4 2020 Jerry James <loganjerry@gmail.com> - 0.4.3-10
- BR readthedocs-sphinx-ext so the tests can be run
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.3-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jan 24 2020 Jerry James <loganjerry@gmail.com> - 0.4.3-8
- Add -doc subpackage
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.3-7
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.3-6
- Rebuilt for Python 3.8
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.3-5
- Bootstrap for Python 3.8
* Tue Aug 6 2019 Jerry James <loganjerry@gmail.com> - 0.4.3-4
- Add -script patch to silence deprecation warnings
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Mar 06 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.3-2
- Subpackage python2-sphinx_rtd_theme has been removed
See https://fedoraproject.org/wiki/Changes/Sphinx2
* Tue Feb 12 2019 Jerry James <loganjerry@gmail.com> - 0.4.3-1
- New upstream version
- Use the github tarball, which has docs, instead of the pypi tarball
- Add %%check script
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Oct 22 2018 Jerry James <loganjerry@gmail.com> - 0.4.2-1
- New upstream version
* Tue Jul 31 2018 Jerry James <loganjerry@gmail.com> - 0.4.1-1
- New upstream version
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jul 2 2018 Jerry James <loganjerry@gmail.com> - 0.4.0-1
- New upstream version
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 0.3.1-2
- Rebuilt for Python 3.7

View File

@ -1 +1,2 @@
SHA512 (sphinx_rtd_theme-0.3.1.tar.gz) = 8b68baf776aad01cfe486bb83b9238b79dfed2ef493c836db566e8a043546772e2dc4943fe83f0938b8f0ffe4b420eccba4a14cf3da7601d0d2e76acaa91550d
SHA512 (sphinx_rtd_theme-2.0.0.tar.gz) = 68dcf85250fe16248d47fe28b5a601ae1305051291b6b15f40366cea6e66ab5e0e49a4a0ea996d0ba0c339aeb14f947cf5d99e3160b3ba2a70882b209678b100
SHA512 (objects.inv) = a4109c3c70e2329ae38cf2a276b3cab0f406e70b6fbe210b1617ade85c03fa5ad37e89d58ae928a355ba0f2bafe22c17e361819600c8d8e5235672ef355bf966