diff --git a/dblatex-0.3.11-replace-inkscape-by-rsvg.patch b/dblatex-0.3.11-replace-inkscape-by-rsvg.patch new file mode 100644 index 0000000..34d555e --- /dev/null +++ b/dblatex-0.3.11-replace-inkscape-by-rsvg.patch @@ -0,0 +1,33 @@ +From ed7d6c2fa6e7848295893d455789ecb3e692b49f Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michael J Gruber +Date: Thu, 18 Feb 2021 12:09:29 +0100 +Subject: [PATCH] replace inkscape by rsvg + +Inkscape broke headless commandline usage and appears not be fixing it, +see: https://gitlab.com/inkscape/inkscape/-/issues/1342 + +Switch to rsvg as recommended by upstream, see: +https://sourceforge.net/p/dblatex/mailman/message/37005820/ + +Signed-off-by: Michael J Gruber +--- + lib/dbtexmf/core/imagedata.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/dbtexmf/core/imagedata.py b/lib/dbtexmf/core/imagedata.py +index 32b7746..7c13e79 100644 +--- a/lib/dbtexmf/core/imagedata.py ++++ b/lib/dbtexmf/core/imagedata.py +@@ -181,7 +181,7 @@ class FigConverter(ImageConverter): + class SvgConverter(ImageConverter): + def __init__(self, imgsrc, imgdst="", docformat="", backend=""): + ImageConverter.__init__(self, imgsrc="svg", imgdst=imgdst) +- self.add_command(["inkscape", "-z", "-D", "--export-%(dst)s=%(output)s", ++ self.add_command(["rsvg-convert", "-a", "-f", "%(dst)s", "-o", "%(output)s", + "%(input)s"]) + + +-- +2.30.1.672.g8d3081386a + diff --git a/dblatex-0.3.11py3.tar.bz2 b/dblatex-0.3.11py3.tar.bz2 deleted file mode 100644 index b57fb55..0000000 Binary files a/dblatex-0.3.11py3.tar.bz2 and /dev/null differ diff --git a/dblatex-0.3.12-adjust-submodule-imports.patch b/dblatex-0.3.12-adjust-submodule-imports.patch new file mode 100644 index 0000000..9a09ede --- /dev/null +++ b/dblatex-0.3.12-adjust-submodule-imports.patch @@ -0,0 +1,62 @@ +From f5ce76603178e5465a744cb4feed4686489bebb9 Mon Sep 17 00:00:00 2001 +Message-ID: +From: Michael J Gruber +Date: Thu, 6 Jul 2023 14:58:03 +0200 +Subject: [PATCH] Python 3.12 compatibility: adjust submodule imports + +importlib imports behave differently in py 3.11 and py 3.12: py 3.12 +requires explicit imports of the submodules. + +While fixing this, reduce the imports to the used submodules. Currently, +the base is still imported automatically. +--- + lib/dbtexmf/core/dbtex.py | 3 ++- + lib/dbtexmf/dblatex/grubber/plugins.py | 3 ++- + lib/dbtexmf/xslt/xslt.py | 3 ++- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/lib/dbtexmf/core/dbtex.py b/lib/dbtexmf/core/dbtex.py +index adac781..4cf9591 100644 +--- a/lib/dbtexmf/core/dbtex.py ++++ b/lib/dbtexmf/core/dbtex.py +@@ -15,7 +15,8 @@ try: + except ImportError: + from urllib.request import pathname2url + import glob +-import importlib ++import importlib.machinery ++import importlib.util + from optparse import OptionParser + from io import open + +diff --git a/lib/dbtexmf/dblatex/grubber/plugins.py b/lib/dbtexmf/dblatex/grubber/plugins.py +index 047f2bb..6b4ecb4 100644 +--- a/lib/dbtexmf/dblatex/grubber/plugins.py ++++ b/lib/dbtexmf/dblatex/grubber/plugins.py +@@ -4,7 +4,8 @@ + Mechanisms to dynamically load extra modules to help the LaTeX compilation. + All the modules must be derived from the TexModule class. + """ +-import importlib ++import importlib.machinery ++import importlib.util + + from os.path import * + from dbtexmf.dblatex.grubber.msg import _, msg +diff --git a/lib/dbtexmf/xslt/xslt.py b/lib/dbtexmf/xslt/xslt.py +index 57c99a2..7cc2038 100644 +--- a/lib/dbtexmf/xslt/xslt.py ++++ b/lib/dbtexmf/xslt/xslt.py +@@ -2,7 +2,8 @@ + # Very simple plugin loader for Xslt classes + # + import os +-import importlib ++import importlib.machinery ++import importlib.util + import glob + import sys + +-- +2.41.0.411.gd9071d4297 + diff --git a/dblatex-0.3.12-replace-imp-by-importlib.patch b/dblatex-0.3.12-replace-imp-by-importlib.patch new file mode 100644 index 0000000..0531733 --- /dev/null +++ b/dblatex-0.3.12-replace-imp-by-importlib.patch @@ -0,0 +1,113 @@ +diff --git a/lib/dbtexmf/core/dbtex.py b/lib/dbtexmf/core/dbtex.py +index b3ec732..adac781 100644 +--- a/lib/dbtexmf/core/dbtex.py ++++ b/lib/dbtexmf/core/dbtex.py +@@ -15,7 +15,7 @@ try: + except ImportError: + from urllib.request import pathname2url + import glob +-import imp ++import importlib + from optparse import OptionParser + from io import open + +@@ -540,15 +540,14 @@ class DbTexCommand: + + def load_plugin(self, pathname): + moddir, modname = os.path.split(pathname) +- try: +- filemod, path, descr = imp.find_module(modname, [moddir]) +- except ImportError: +- try: +- filemod, path, descr = imp.find_module(modname) +- except ImportError: +- failed_exit("Error: '%s' module not found" % modname) +- mod = imp.load_module(modname, filemod, path, descr) +- filemod.close() ++ spec = importlib.machinery.PathFinder.find_spec(modname, [moddir]) ++ if not spec: ++ spec = importlib.machinery.PathFinder.find_spec(modname) ++ if not spec: ++ failed_exit("Error: '%s' module not found" % modname) ++ mod = importlib.util.module_from_spec(spec) ++ spec.loader.exec_module(mod) ++ sys.modules[modname] = mod + return mod + + def run_setup(self, options): +diff --git a/lib/dbtexmf/dblatex/grubber/plugins.py b/lib/dbtexmf/dblatex/grubber/plugins.py +index 9e333c9..047f2bb 100644 +--- a/lib/dbtexmf/dblatex/grubber/plugins.py ++++ b/lib/dbtexmf/dblatex/grubber/plugins.py +@@ -4,7 +4,7 @@ + Mechanisms to dynamically load extra modules to help the LaTeX compilation. + All the modules must be derived from the TexModule class. + """ +-import imp ++import importlib + + from os.path import * + from dbtexmf.dblatex.grubber.msg import _, msg +@@ -108,17 +108,16 @@ class Plugins (object): + """ + if name in self.modules: + return 2 +- try: +- file, path, descr = imp.find_module(name, [""]) +- except ImportError: ++ spec = importlib.machinery.PathFinder.find_spec(name, [""]) ++ if not spec: + if not self.path: + return 0 +- try: +- file, path, descr = imp.find_module(name, self.path) +- except ImportError: +- return 0 +- module = imp.load_module(name, file, path, descr) +- file.close() ++ spec = importlib.machinery.PathFinder.find_spec(name, self.path) ++ if not spec: ++ return 0 ++ module = importlib.util.module_from_spec(spec) ++ spec.loader.exec_module(module) ++ sys.modules[name] = module + self.modules[name] = module + return 1 + +diff --git a/lib/dbtexmf/xslt/xslt.py b/lib/dbtexmf/xslt/xslt.py +index 0350e30..57c99a2 100644 +--- a/lib/dbtexmf/xslt/xslt.py ++++ b/lib/dbtexmf/xslt/xslt.py +@@ -2,20 +2,21 @@ + # Very simple plugin loader for Xslt classes + # + import os +-import imp ++import importlib + import glob ++import sys + + def load(modname): +- try: +- file, path, descr = imp.find_module(modname, [""]) +- except ImportError: +- try: +- file, path, descr = imp.find_module(modname, +- [os.path.dirname(__file__)]) +- except ImportError: +- raise ValueError("Xslt '%s' not found" % modname) +- mod = imp.load_module(modname, file, path, descr) +- file.close() ++ spec = importlib.machinery.PathFinder.find_spec(modname, [""]) ++ if not spec: ++ spec = importlib.machinery.PathFinder.find_spec(modname, ++ [os.path.dirname(__file__)]) ++ if not spec: ++ raise ValueError("Xslt '%s' not found" % modname) ++ ++ mod = importlib.util.module_from_spec(spec) ++ spec.loader.exec_module(mod) ++ sys.modules[modname] = mod + o = mod.Xslt() + return o + diff --git a/dblatex.spec b/dblatex.spec index 5641e6f..bdc35e7 100644 --- a/dblatex.spec +++ b/dblatex.spec @@ -1,14 +1,19 @@ Name: dblatex -Version: 0.3.11 -Release: 3 +Version: 0.3.12 +Release: 1 Summary: DocBook to LaTeX/ConTeXt Publishing BuildArch: noarch License: GPLv2+ and GPLv2 and LPPL and DMIT and Public Domain URL: http://dblatex.sourceforge.net/ -Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}py3.tar.bz2 +Source0: http://downloads.sourceforge.net/%{name}/%{name}3-%{version}.tar.bz2 Source1: COPYING-docbook-xsl Patch0000: dblatex-0.3.11-disable-debian.patch Patch0001: dblatex-0.3.11-which-shutil.patch +Patch0002: dblatex-0.3.11-replace-inkscape-by-rsvg.patch +# Patch3 sent upstream: https://sourceforge.net/p/dblatex/patches/12/ +Patch0003: dblatex-0.3.12-replace-imp-by-importlib.patch +# Patch4 sent upstream: https://sourceforge.net/p/dblatex/patches/13/ +Patch0004: dblatex-0.3.12-adjust-submodule-imports.patch BuildRequires: python3-devel python3-setuptools libxslt texlive-base texlive-collection-latex texlive-collection-xetex BuildRequires: texlive-collection-htmlxml texlive-xmltex-bin texlive-anysize texlive-appendix texlive-changebar @@ -36,10 +41,8 @@ Summary: Introduce how to use dblatex Introduce how to use dblatex %prep -%autosetup -n %{name}-%{version}py3 -p1 +%autosetup -n %{name}3-%{version} -p1 rm -rf lib/contrib -sed -i 's/0.3.11py3/0.3.11/g' docs/version.xml -sed -i 's/0.3.11py3/0.3.11/g' xsl/version.xsl %build %{__python3} setup.py build @@ -77,9 +80,6 @@ cp -p %{SOURCE1} COPYING-docbook-xsl %dir %{_sysconfdir}/dblatex %exclude %{_datadir}/doc/ %exclude %{_datadir}/dblatex/latex/{misc,contrib/example,style} -%exclude %{_datadir}/dblatex/latex/misc/bibtopic.sty -%exclude %{_datadir}/dblatex/latex/misc/enumitem.sty -%exclude %{_datadir}/dblatex/latex/misc/ragged2e.sty %exclude %{_datadir}/dblatex/latex/misc/passivetex/ %exclude %{_datadir}/dblatex/latex/misc/xelatex/ @@ -88,6 +88,9 @@ cp -p %{SOURCE1} COPYING-docbook-xsl %{_mandir}/man1/dblatex.1* %changelog +* Tue Jan 16 2024 yaoxin - 0.3.12-1 +- Upgrade to 0.3.12 + * Mon May 8 2023 Ge Wang - 0.3.11-3 - Fix build failure due to python-setuptools updated to version 66.0.0 diff --git a/dblatex3-0.3.12.tar.bz2 b/dblatex3-0.3.12.tar.bz2 new file mode 100644 index 0000000..af9e03c Binary files /dev/null and b/dblatex3-0.3.12.tar.bz2 differ