summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/changelog30
-rw-r--r--debian/control27
-rw-r--r--debian/copyright46
-rw-r--r--debian/gbp.conf2
-rw-r--r--debian/links2
-rw-r--r--debian/patches/checksum_at_runtime.patch70
-rw-r--r--debian/patches/series3
-rw-r--r--debian/patches/sphinx_7.1.patch45
-rw-r--r--debian/patches/sphinx_7.2.patch34
-rwxr-xr-xdebian/rules6
-rw-r--r--debian/salsa-ci.yml2
-rw-r--r--debian/source/format1
-rw-r--r--debian/source/lintian-overrides2
-rw-r--r--debian/upstream/metadata4
-rw-r--r--debian/watch2
15 files changed, 276 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..d77af03
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,30 @@
+sphinxcontrib-jquery (4.1-5) unstable; urgency=medium
+
+ * Update sphinx_7.2.patch to stop monkey-patching _StrPath, to make the
+ tests pass with Python 3.12 (closes: #1058446).
+
+ -- Dmitry Shachnev <mitya57@debian.org> Tue, 12 Dec 2023 22:08:34 +0300
+
+sphinxcontrib-jquery (4.1-4) unstable; urgency=medium
+
+ * Add a patch to make the tests pass with Sphinx 7.2.
+
+ -- Dmitry Shachnev <mitya57@debian.org> Sun, 29 Oct 2023 19:45:32 +0300
+
+sphinxcontrib-jquery (4.1-3) unstable; urgency=medium
+
+ * Add a patch to fix tests with Sphinx 7.1 (closes: #1042592).
+
+ -- Dmitry Shachnev <mitya57@debian.org> Thu, 03 Aug 2023 12:52:38 +0300
+
+sphinxcontrib-jquery (4.1-2) unstable; urgency=medium
+
+ * Upload to unstable.
+
+ -- Dmitry Shachnev <mitya57@debian.org> Sat, 17 Jun 2023 19:02:35 +0300
+
+sphinxcontrib-jquery (4.1-1) experimental; urgency=medium
+
+ * Initial release (closes: #1033605).
+
+ -- Dmitry Shachnev <mitya57@debian.org> Sat, 13 May 2023 20:53:01 +0300
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..d8ad36c
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,27 @@
+Source: sphinxcontrib-jquery
+Section: python
+Priority: optional
+Maintainer: Debian Python Team <team+python@tracker.debian.org>
+Uploaders: Dmitry Shachnev <mitya57@debian.org>
+Homepage: https://github.com/sphinx-contrib/jquery
+Build-Depends: debhelper-compat (= 13),
+ dh-python,
+ flit (>= 3.7),
+ pybuild-plugin-pyproject,
+ python3-all,
+ python3-pytest,
+ python3-sphinx (>= 1.8)
+Rules-Requires-Root: no
+Standards-Version: 4.6.2
+Vcs-Git: https://salsa.debian.org/python-team/packages/sphinxcontrib-jquery.git
+Vcs-Browser: https://salsa.debian.org/python-team/packages/sphinxcontrib-jquery
+Testsuite: autopkgtest-pkg-pybuild
+
+Package: python3-sphinxcontrib.jquery
+Architecture: all
+Depends: libjs-jquery (>= 3.6.0), ${misc:Depends}, ${python3:Depends}
+Description: extension to include jQuery on newer Sphinx releases
+ sphinxcontrib-jquery ensures that jQuery is always installed for use in
+ Sphinx themes or extensions.
+ .
+ To use it, add sphinxcontrib.jquery as a Sphinx extension.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..627f37a
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,46 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: sphinxcontrib-jquery
+
+Files: *
+Copyright: 2022 Adam Turner
+License: 0BSD
+
+Files: sphinxcontrib/jquery/jquery*.js
+Copyright: 2006-2021 OpenJS Foundation and other contributors
+License: Expat
+
+Files: debian/*
+Copyright: 2023 Dmitry Shachnev <mitya57@debian.org>
+License: 0BSD
+
+License: 0BSD
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..3879982
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-branch=debian/master
diff --git a/debian/links b/debian/links
new file mode 100644
index 0000000..0ebbfc9
--- /dev/null
+++ b/debian/links
@@ -0,0 +1,2 @@
+usr/share/javascript/jquery/jquery.js usr/lib/python3/dist-packages/sphinxcontrib/jquery/jquery-3.6.0.js
+usr/share/javascript/jquery/jquery.min.js usr/lib/python3/dist-packages/sphinxcontrib/jquery/jquery.js
diff --git a/debian/patches/checksum_at_runtime.patch b/debian/patches/checksum_at_runtime.patch
new file mode 100644
index 0000000..e10ba80
--- /dev/null
+++ b/debian/patches/checksum_at_runtime.patch
@@ -0,0 +1,70 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Tue, 28 Mar 2023 14:23:03 +0300
+Subject: Caclulate integrity checksum on runtime rather than hardcoding it
+
+We are using packaged jQuery, checksum of which may change at any time.
+
+Forwarded: not-needed
+---
+ sphinxcontrib/jquery/__init__.py | 7 +++++++
+ tests/test_jquery_installed.py | 9 +--------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/sphinxcontrib/jquery/__init__.py b/sphinxcontrib/jquery/__init__.py
+index e060cd7..9b369a8 100644
+--- a/sphinxcontrib/jquery/__init__.py
++++ b/sphinxcontrib/jquery/__init__.py
+@@ -1,5 +1,7 @@
+ from os import makedirs, path
+ import shutil
++import base64
++import hashlib
+
+ import sphinx
+
+@@ -29,6 +31,11 @@ def add_js_files(app, config):
+ # does not trigger the hash check but instead blocks the request
+ # when viewing documentation locally through the ``file://`` URIs.
+ if config.jquery_use_sri:
++ if filename == "jquery.js":
++ with open("/usr/share/javascript/jquery/jquery.min.js", "rb") as f:
++ checksum = hashlib.file_digest(f, hashlib.sha384)
++ encoded = base64.b64encode(checksum.digest()).decode("ascii")
++ integrity = f"sha384-{encoded}"
+ app.add_js_file(filename, priority=100, integrity=integrity)
+ else:
+ app.add_js_file(filename, priority=100)
+diff --git a/tests/test_jquery_installed.py b/tests/test_jquery_installed.py
+index 08c25ba..d0537d0 100644
+--- a/tests/test_jquery_installed.py
++++ b/tests/test_jquery_installed.py
+@@ -38,10 +38,6 @@ def test_jquery_installed_sphinx_ge_60_use_sri(blank_app):
+ out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"], "jquery_use_sri": True})
+
+ text = out_dir.joinpath("index.html").read_text(encoding="utf-8")
+- checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else ''
+- assert ('<script '
+- 'integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" '
+- f'src="_static/jquery.js{checksum}"></script>') in text
+ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else ''
+ assert ('<script '
+ 'integrity="sha384-lSZeSIVKp9myfKbDQ3GkN/KHjUc+mzg17VKDN4Y2kUeBSJioB9QSM639vM9fuY//" '
+@@ -58,9 +54,6 @@ def test_jquery_installed_sphinx_ge_60(blank_app):
+ out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"]})
+
+ text = out_dir.joinpath("index.html").read_text(encoding="utf-8")
+- checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else ''
+- assert ('<script '
+- f'src="_static/jquery.js{checksum}"></script>') in text
+ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else ''
+ assert ('<script '
+ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}"></script>') in text
+@@ -90,7 +83,7 @@ def test_jquery_installed_sphinx_lt_60(blank_app):
+ assert static_dir.joinpath('_sphinx_javascript_frameworks_compat.js').is_file()
+
+
+-@pytest.mark.parametrize(('filename', 'integrity'), _FILES, ids=[*dict(_FILES)])
++@pytest.mark.parametrize(('filename', 'integrity'), _FILES[1:], ids=[*dict(_FILES[1:])])
+ def test_integrity(filename, integrity):
+ checksum = hashlib.sha384(Path(_ROOT_DIR, filename).read_bytes())
+ encoded = base64.b64encode(checksum.digest()).decode(encoding='ascii')
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..3ae31c6
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+sphinx_7.1.patch
+checksum_at_runtime.patch
+sphinx_7.2.patch
diff --git a/debian/patches/sphinx_7.1.patch b/debian/patches/sphinx_7.1.patch
new file mode 100644
index 0000000..39a4363
--- /dev/null
+++ b/debian/patches/sphinx_7.1.patch
@@ -0,0 +1,45 @@
+From: Dmitry Shachnev <mitya57@debian.org>
+Date: Mon, 31 Jul 2023 15:22:24 +0300
+Subject: Make the tests pass with Sphinx 7.1
+
+Forwarded: https://github.com/sphinx-contrib/jquery/pull/26
+---
+ tests/test_jquery_installed.py | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/tests/test_jquery_installed.py b/tests/test_jquery_installed.py
+index a402bd4..08c25ba 100644
+--- a/tests/test_jquery_installed.py
++++ b/tests/test_jquery_installed.py
+@@ -38,12 +38,14 @@ def test_jquery_installed_sphinx_ge_60_use_sri(blank_app):
+ out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"], "jquery_use_sri": True})
+
+ text = out_dir.joinpath("index.html").read_text(encoding="utf-8")
++ checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else ''
+ assert ('<script '
+ 'integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK" '
+- 'src="_static/jquery.js"></script>') in text
++ f'src="_static/jquery.js{checksum}"></script>') in text
++ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else ''
+ assert ('<script '
+ 'integrity="sha384-lSZeSIVKp9myfKbDQ3GkN/KHjUc+mzg17VKDN4Y2kUeBSJioB9QSM639vM9fuY//" '
+- 'src="_static/_sphinx_javascript_frameworks_compat.js"></script>') in text
++ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}"></script>') in text
+
+ static_dir = out_dir / '_static'
+ assert static_dir.joinpath('jquery.js').is_file()
+@@ -56,10 +58,12 @@ def test_jquery_installed_sphinx_ge_60(blank_app):
+ out_dir = blank_app(confoverrides={"extensions": ["sphinxcontrib.jquery"]})
+
+ text = out_dir.joinpath("index.html").read_text(encoding="utf-8")
++ checksum = '?v=5d32c60e' if sphinx.version_info[:2] >= (7, 1) else ''
+ assert ('<script '
+- 'src="_static/jquery.js"></script>') in text
++ f'src="_static/jquery.js{checksum}"></script>') in text
++ checksum = '?v=2cd50e6c' if sphinx.version_info[:2] >= (7, 1) else ''
+ assert ('<script '
+- 'src="_static/_sphinx_javascript_frameworks_compat.js"></script>') in text
++ f'src="_static/_sphinx_javascript_frameworks_compat.js{checksum}"></script>') in text
+
+ static_dir = out_dir / '_static'
+ assert static_dir.joinpath('jquery.js').is_file()
diff --git a/debian/patches/sphinx_7.2.patch b/debian/patches/sphinx_7.2.patch
new file mode 100644
index 0000000..0efc5ad
--- /dev/null
+++ b/debian/patches/sphinx_7.2.patch
@@ -0,0 +1,34 @@
+From: Daniel Garcia Moreno <daniel.garcia@suse.com>
+Date: Mon, 4 Sep 2023 13:55:55 +0200
+Subject: Make the tests pass with Sphinx 7.2
+
+This patch adapts the tests to work with Sphinx 7.2.
+Modified for Debian to keep support for older Sphinx versions.
+
+Origin: https://github.com/sphinx-contrib/jquery/pull/27
+---
+ tests/test_jquery_installed.py | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/tests/test_jquery_installed.py b/tests/test_jquery_installed.py
+index d0537d0..fba60fc 100644
+--- a/tests/test_jquery_installed.py
++++ b/tests/test_jquery_installed.py
+@@ -25,10 +25,13 @@ def run_blank_app(srcdir, **kwargs):
+
+ @pytest.fixture(scope="function")
+ def blank_app(tmpdir, monkeypatch):
+- def inner(**kwargs):
+- return run_blank_app(path(tmpdir), **kwargs)
+-
+- monkeypatch.setattr("sphinx.application.abspath", lambda x: x)
++ if sphinx.version_info >= (7, 2):
++ def inner(**kwargs):
++ return run_blank_app(Path(tmpdir), **kwargs)
++ else:
++ def inner(**kwargs):
++ return run_blank_app(path(tmpdir), **kwargs)
++ monkeypatch.setattr("sphinx.application.abspath", lambda x: x)
+ yield inner
+
+
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..a86c031
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,6 @@
+#!/usr/bin/make -f
+
+export PYBUILD_NAME=sphinxcontrib.jquery
+
+%:
+ dh $@ --with python3 --buildsystem=pybuild
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
new file mode 100644
index 0000000..26871b9
--- /dev/null
+++ b/debian/salsa-ci.yml
@@ -0,0 +1,2 @@
+include:
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
new file mode 100644
index 0000000..75b10ca
--- /dev/null
+++ b/debian/source/lintian-overrides
@@ -0,0 +1,2 @@
+# non-minified version is in sphinxcontrib/jquery/jquery-3.6.0.js
+sphinxcontrib-jquery source: source-is-missing [sphinxcontrib/jquery/jquery.js]
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
new file mode 100644
index 0000000..ea51068
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1,4 @@
+Bug-Database: https://github.com/sphinx-contrib/jquery/issues
+Bug-Submit: https://github.com/sphinx-contrib/jquery/issues/new
+Repository: https://github.com/sphinx-contrib/jquery.git
+Repository-Browse: https://github.com/sphinx-contrib/jquery
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..7a903dc
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=4
+https://pypi.debian.net/@PACKAGE@/@PACKAGE@-@ANY_VERSION@@ARCHIVE_EXT@