Initial RPM

This commit is contained in:
Jerry James 2025-12-12 15:23:51 -07:00
commit b347bc0584
7 changed files with 387 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/sphinx-book-theme-*-vendor.tar.xz
/sphinx-book-theme-*.tar.gz

24
919.patch Normal file
View file

@ -0,0 +1,24 @@
From 6d313dd98fe04f4492066727828471c677e17159 Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Sun, 9 Nov 2025 13:33:52 +0300
Subject: [PATCH] Ignore PendingDeprecationWarning about parser_name
deprecation with Docutils 0.22
---
pyproject.toml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 290291cf..8cd058c4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -25,7 +25,8 @@ filterwarnings = [
# Sphinx triggers this
'''ignore:'imghdr' is deprecated and slated for removal in Python 3\.13:DeprecationWarning''',
'''ignore:'sphinx.util.import_object' is deprecated.:PendingDeprecationWarning''',
- 'ignore:Parsing dates involving a day of month without a year specified is ambiguious:DeprecationWarning'
+ 'ignore:Parsing dates involving a day of month without a year specified is ambiguious:DeprecationWarning',
+ 'ignore:Argument "parser_name" will be removed in Docutils 2.0.:PendingDeprecationWarning',
]
[project]

65
prepare_vendor.sh Executable file
View file

@ -0,0 +1,65 @@
#!/bin/bash
PKG_URL=$(spectool *.spec --source 0 | sed -e 's/Source0:[ ]*//g')
PKG_TARBALL=$(basename $PKG_URL)
PKG_NAME=$(rpmspec -q --queryformat="%{NAME}" *.spec --srpm | sed 's/^python-//')
PKG_VERSION=$(rpmspec -q --queryformat="%{VERSION}" *.spec --srpm)
PKG_SRCDIR="${PKG_NAME}-${PKG_VERSION}"
PKG_DIR="$PWD"
PKG_TMPDIR=$(mktemp --tmpdir -d ${PKG_NAME}-XXXXXXXX)
PKG_PATH="$PKG_TMPDIR/$PKG_SRCDIR/"
echo "URL: $PKG_URL"
echo "TARBALL: $PKG_TARBALL"
echo "NAME: $PKG_NAME"
echo "VERSION: $PKG_VERSION"
echo "PATH: $PKG_PATH"
cleanup_tmpdir() {
popd 2>/dev/null
rm -rf $PKG_TMPDIR
rm -rf /tmp/yarn--*
}
trap cleanup_tmpdir SIGINT
cleanup_and_exit() {
cleanup_tmpdir
if test "$1" = 0 -o -z "$1" ; then
exit 0
else
exit $1
fi
}
if [ ! -w "$PKG_TARBALL" ]; then
wget "$PKG_URL"
fi
mkdir -p $PKG_TMPDIR
tar -xf $PKG_TARBALL -C $PKG_TMPDIR
cd $PKG_PATH
export YARN_CACHE_FOLDER="$PWD/.package-cache"
echo ">>>>>> Install npm modules"
yarn install --frozen-lockfile
if [ $? -ne 0 ]; then
echo "ERROR: yarn install failed"
cleanup_and_exit 1
fi
echo ">>>>>> Package vendor files"
rm -f $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor.tar.xz
XZ_OPT="-9e -T$(nproc)" tar cJf $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor.tar.xz .package-cache
if [ $? -ne 0 ]; then
cleanup_and_exit 1
fi
yarn add license-checker
yarn license-checker --summary | sed "s#$PKG_PATH#/tmp/#g" > $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor-licenses.txt
cd -
rm -rf .package-cache node_modules
cleanup_and_exit 0

View file

@ -0,0 +1,201 @@
--- sphinx-book-theme-1.1.4/tests/test_build/build__header-article.html.orig 2025-02-20 09:20:37.000000000 -0700
+++ sphinx-book-theme-1.1.4/tests/test_build/build__header-article.html 2025-12-12 14:47:20.167592092 -0700
@@ -106,22 +106,18 @@
</i>
</span>
</button>
- <script>
- document.write(`
- <button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
- <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
- <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
- </button>
-`);
- </script>
- <script>
- document.write(`
- <button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="fa-solid fa-magnifying-glass fa-lg"></i>
- </button>
-`);
- </script>
+ <button aria-label="Color mode" class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" data-bs-placement="bottom" data-bs-title="Color mode" data-bs-toggle="tooltip">
+ <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light">
+ </i>
+ <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark">
+ </i>
+ <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings">
+ </i>
+ </button>
+ <button aria-label="Search" class="btn btn-sm pst-navbar-icon search-button search-button__button pst-js-only" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Search">
+ <i class="fa-solid fa-magnifying-glass fa-lg">
+ </i>
+ </button>
</div>
</div>
</div>
--- sphinx-book-theme-1.1.4/tests/test_build/build__pagetoc--page-multipletitles.html.orig 2025-02-20 09:20:37.000000000 -0700
+++ sphinx-book-theme-1.1.4/tests/test_build/build__pagetoc--page-multipletitles.html 2025-12-12 14:56:11.217220439 -0700
@@ -1,4 +1,4 @@
-<div class="bd-sidebar-secondary bd-toc">
+<div class="bd-sidebar-secondary bd-toc" id="pst-secondary-sidebar">
<div class="sidebar-secondary-items sidebar-secondary__inner">
<div class="sidebar-secondary-item">
<div class="page-toc tocsection onthispage">
--- sphinx-book-theme-1.1.4/tests/test_build/build__pagetoc--page-onetitle.html.orig 2025-02-20 09:20:37.000000000 -0700
+++ sphinx-book-theme-1.1.4/tests/test_build/build__pagetoc--page-onetitle.html 2025-12-12 15:00:05.326048537 -0700
@@ -1,4 +1,4 @@
-<div class="bd-sidebar-secondary bd-toc">
+<div class="bd-sidebar-secondary bd-toc" id="pst-secondary-sidebar">
<div class="sidebar-secondary-items sidebar-secondary__inner">
<div class="sidebar-secondary-item">
<div class="page-toc tocsection onthispage">
--- sphinx-book-theme-1.1.4/tests/test_build/header__repo-buttons--all-off.html.orig 2025-02-20 09:20:37.000000000 -0700
+++ sphinx-book-theme-1.1.4/tests/test_build/header__repo-buttons--all-off.html 2025-12-12 14:50:49.132763829 -0700
@@ -37,22 +37,18 @@
</i>
</span>
</button>
- <script>
- document.write(`
- <button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
- <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
- <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
- </button>
-`);
- </script>
- <script>
- document.write(`
- <button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="fa-solid fa-magnifying-glass fa-lg"></i>
- </button>
-`);
- </script>
+ <button aria-label="Color mode" class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" data-bs-placement="bottom" data-bs-title="Color mode" data-bs-toggle="tooltip">
+ <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light">
+ </i>
+ <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark">
+ </i>
+ <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings">
+ </i>
+ </button>
+ <button aria-label="Search" class="btn btn-sm pst-navbar-icon search-button search-button__button pst-js-only" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Search">
+ <i class="fa-solid fa-magnifying-glass fa-lg">
+ </i>
+ </button>
</div>
</div>
</div>
--- sphinx-book-theme-1.1.4/tests/test_build/header__repo-buttons--all-on.html.orig 2025-02-20 09:20:37.000000000 -0700
+++ sphinx-book-theme-1.1.4/tests/test_build/header__repo-buttons--all-on.html 2025-12-12 14:48:37.294382809 -0700
@@ -78,22 +78,18 @@
</i>
</span>
</button>
- <script>
- document.write(`
- <button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
- <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
- <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
- </button>
-`);
- </script>
- <script>
- document.write(`
- <button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="fa-solid fa-magnifying-glass fa-lg"></i>
- </button>
-`);
- </script>
+ <button aria-label="Color mode" class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" data-bs-placement="bottom" data-bs-title="Color mode" data-bs-toggle="tooltip">
+ <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light">
+ </i>
+ <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark">
+ </i>
+ <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings">
+ </i>
+ </button>
+ <button aria-label="Search" class="btn btn-sm pst-navbar-icon search-button search-button__button pst-js-only" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Search">
+ <i class="fa-solid fa-magnifying-glass fa-lg">
+ </i>
+ </button>
</div>
</div>
</div>
--- sphinx-book-theme-1.1.4/tests/test_build/header__repo-buttons--custom-branch.html.orig 2025-02-20 09:20:37.000000000 -0700
+++ sphinx-book-theme-1.1.4/tests/test_build/header__repo-buttons--custom-branch.html 2025-12-12 14:51:46.612299706 -0700
@@ -61,22 +61,18 @@
</i>
</span>
</button>
- <script>
- document.write(`
- <button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
- <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
- <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
- </button>
-`);
- </script>
- <script>
- document.write(`
- <button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="fa-solid fa-magnifying-glass fa-lg"></i>
- </button>
-`);
- </script>
+ <button aria-label="Color mode" class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" data-bs-placement="bottom" data-bs-title="Color mode" data-bs-toggle="tooltip">
+ <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light">
+ </i>
+ <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark">
+ </i>
+ <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings">
+ </i>
+ </button>
+ <button aria-label="Search" class="btn btn-sm pst-navbar-icon search-button search-button__button pst-js-only" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Search">
+ <i class="fa-solid fa-magnifying-glass fa-lg">
+ </i>
+ </button>
</div>
</div>
</div>
--- sphinx-book-theme-1.1.4/tests/test_build/header__repo-buttons--one-on.html.orig 2025-02-20 09:20:37.000000000 -0700
+++ sphinx-book-theme-1.1.4/tests/test_build/header__repo-buttons--one-on.html 2025-12-12 14:49:48.797923063 -0700
@@ -43,22 +43,18 @@
</i>
</span>
</button>
- <script>
- document.write(`
- <button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
- <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
- <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
- </button>
-`);
- </script>
- <script>
- document.write(`
- <button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
- <i class="fa-solid fa-magnifying-glass fa-lg"></i>
- </button>
-`);
- </script>
+ <button aria-label="Color mode" class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" data-bs-placement="bottom" data-bs-title="Color mode" data-bs-toggle="tooltip">
+ <i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light">
+ </i>
+ <i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark">
+ </i>
+ <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings">
+ </i>
+ </button>
+ <button aria-label="Search" class="btn btn-sm pst-navbar-icon search-button search-button__button pst-js-only" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Search">
+ <i class="fa-solid fa-magnifying-glass fa-lg">
+ </i>
+ </button>
</div>
</div>
</div>

View file

@ -0,0 +1,78 @@
%global giturl https://github.com/executablebooks/sphinx-book-theme
Name: python-sphinx-book-theme
Version: 1.1.4
Release: %autorelease
Summary: Interactive book theme for Sphinx
License: BSD-3-Clause
BuildArch: noarch
URL: https://jupyterbook.org/
VCS: git:%{giturl}.git
Source0: %{giturl}/archive/v%{version}/sphinx-book-theme-%{version}.tar.gz
# Source1 and Source2 created with ./prepare_vendor.sh
Source1: sphinx-book-theme-%{version}-vendor.tar.xz
Source2: sphinx-book-theme-%{version}-vendor-licenses.txt
# Compatibility with docutils 0.22.3
Patch: %{giturl}/pull/919.patch
# Adapt the tests to newer sphinx components
Patch: %{name}-test.patch
BuildSystem: pyproject
BuildOption(generate_buildrequires): -x test
BuildOption(install): -L sphinx_book_theme
BuildRequires: nodejs-devel
BuildRequires: nodejs-npm
BuildRequires: yarnpkg
%global _description %{expand:
This is a lightweight Sphinx theme designed to mimic the look-and-feel of
an interactive book. It has the following primary features:
- Bootstrap 5 for visual elements and functionality
- Flexible content layout that is inspired by beautiful online books,
such as the Edward Tufte CSS guide
- Visual classes designed for Jupyter Notebooks. Cell inputs, outputs,
and interactive functionality are all supported.
- Launch buttons for online interactivity. For pages that are built with
computational material, connect your site to an online BinderHub for
interactive content.}
%description %_description
%package -n python3-sphinx-book-theme
Summary: Interactive book theme for Sphinx
%description -n python3-sphinx-book-theme %_description
%prep
%autosetup -n sphinx-book-theme-%{version} -a1 -p1
cp -p %{SOURCE2} .
rm src/sphinx_book_theme/theme/sphinx_book_theme/static/.gitignore
# Relax strict version requirements
sed -i 's/==/>=/g' pyproject.toml
# Do not run code coverage tests during an RPM build
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -i '/coverage/d;/pytest-cov/d' pyproject.toml
# Substitute the installed nodejs version for the requested version
%global nodejs_version %(%{_bindir}/node -v | sed s/v//)
sed -i 's,^\(node-version = \)".*",\1"%{nodejs_version}",' pyproject.toml
%build -p
export YARN_CACHE_FOLDER="$PWD/.package-cache"
yarn install --offline
nodeenv --node=system --prebuilt --clean-src $PWD/.nodeenv
%check
%pytest -v
%files -n python3-sphinx-book-theme -f %{pyproject_files}
%doc CHANGELOG.md README.md
%license LICENSE sphinx-book-theme-%{version}-vendor-licenses.txt
%changelog
%autochangelog

2
sources Normal file
View file

@ -0,0 +1,2 @@
SHA512 (sphinx-book-theme-1.1.4-vendor.tar.xz) = 4efb856b81f7fa379a816af701d94b8399d97b6600c5602be84ab151d87a99cbe623355e9b048b4ce4962f2ca90bc3f6ecf5e192a1cfd26fa12fce0c2fdc8f10
SHA512 (sphinx-book-theme-1.1.4.tar.gz) = 1fcc19f9080050b7ab7eba2b6fe0df9218ba87fe7ea2dd9bfa1cbd43d9fa777723ab0d882f94077f32564b22a8e95a6317fc490263a5a4f14766bb122c73b5bd

View file

@ -0,0 +1,15 @@
yarn run v1.22.22
$ /tmp/node_modules/.bin/license-checker --summary
├─ MIT: 400
├─ ISC: 38
├─ Apache-2.0: 19
├─ BSD-2-Clause: 15
├─ BSD-3-Clause: 8
├─ CC0-1.0: 2
├─ CC-BY-4.0: 1
├─ (BSD-3-Clause OR GPL-2.0): 1
├─ CC-BY-3.0: 1
├─ (MIT AND CC-BY-3.0): 1
└─ 0BSD: 1
Done in 0.71s.