Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
1395c364f4
!7 Upgrade to 0.3.12
From: @starlet-dx 
Reviewed-by: @wk333 
Signed-off-by: @wk333
2024-01-16 02:36:48 +00:00
starlet-dx
02e91d5882 Upgrade to 0.3.12 2024-01-16 09:39:42 +08:00
openeuler-ci-bot
d4795643fe
!6 Fix build failure due to python-setuptools updated to version 66.0
From: @wang--ge 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-05-08 08:27:41 +00:00
wang--ge
b171fe8a1e fix build failure due to python-setuptools updated to version 66.0 2023-05-08 15:11:10 +08:00
openeuler-ci-bot
5e6e1e7fea
!5 [sync] PR-4: 增加安装依赖texlive-everysel
From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-03-02 01:02:06 +00:00
caodongxia
7bc32ba8df add requires texlive-everysel-9
(cherry picked from commit 50caed9e5eb526b854b2de2a813a867a24ee5a79)
2023-03-01 18:35:27 +08:00
openeuler-ci-bot
4c99ea28b8 !3 update to 0.3.11 (use python3 as build requires)
From: @kkkl12
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2020-11-15 20:48:44 +08:00
kkkl12
3858e9a784 update to 0.3.11 2020-11-13 15:25:37 +08:00
openeuler-ci-bot
8c70715861 !2 fix yaml file
Merge pull request !2 from Minjie.Ma/master
2020-07-20 15:02:03 +08:00
maminjie
8c35695350 fix yaml file 2020-07-17 21:23:58 +08:00
11 changed files with 325 additions and 54 deletions

View File

@ -1,12 +0,0 @@
diff -up dblatex-0.2.7/setup.py.external_which dblatex-0.2.7/setup.py
--- dblatex-0.2.7/setup.py.external_which 2007-04-26 21:08:56.000000000 +0200
+++ dblatex-0.2.7/setup.py 2007-07-22 19:35:05.000000000 +0200
@@ -147,7 +147,7 @@ os.environ["SGML_CATALOG_FILES"] = cat
def find_programs(utils):
sys.path.append("lib")
- from contrib.which import which
+ import which
util_paths = {}
missed = []
for util in utils:

Binary file not shown.

View File

@ -0,0 +1,44 @@
From 0d8a7080f7fdc158a635e939e06bc7884a034ab1 Mon Sep 17 00:00:00 2001
Message-Id: <0d8a7080f7fdc158a635e939e06bc7884a034ab1.1569226914.git.github@grubix.eu>
In-Reply-To: <49b85799a8f0674ac5eb6f2dfc37b23208d9754a.1569226914.git.github@grubix.eu>
References: <49b85799a8f0674ac5eb6f2dfc37b23208d9754a.1569226914.git.github@grubix.eu>
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
Date: Tue, 26 Jun 2018 17:38:43 +0200
Subject: [PATCH 12/13] Disable Debian
Signed-off-by: Michael J Gruber <github@grubix.eu>
---
setup.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/setup.py b/setup.py
index 379323b..86619ec 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@ from distutils.command.sdist import sdist
from distutils import log
from subprocess import Popen, PIPE
sys.path.append("lib")
-from contrib.debian.installer import DebianInstaller
+#from contrib.debian.installer import DebianInstaller
#
# Build the command line script
@@ -373,10 +373,10 @@ class Install(install):
raise OSError("not found: %s" % ", ".join(mis_stys))
def run(self):
- if self.install_layout == "deb":
- db = DebianInstaller(self)
- else:
- db = None
+# if self.install_layout == "deb":
+# db = DebianInstaller(self)
+# else:
+ db = None
if not(db) and not(self.nodeps):
try:
--
2.23.0.369.g5d0cb2d495

View File

@ -0,0 +1,33 @@
From ed7d6c2fa6e7848295893d455789ecb3e692b49f Mon Sep 17 00:00:00 2001
Message-Id: <ed7d6c2fa6e7848295893d455789ecb3e692b49f.1613646685.git.github@grubix.eu>
From: Michael J Gruber <github@grubix.eu>
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 <github@grubix.eu>
---
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

View File

@ -0,0 +1,42 @@
From af5dc6ec530b107a4a0bd6ac9b2e80b0e7d36077 Mon Sep 17 00:00:00 2001
Message-Id: <af5dc6ec530b107a4a0bd6ac9b2e80b0e7d36077.1569226914.git.github@grubix.eu>
In-Reply-To: <49b85799a8f0674ac5eb6f2dfc37b23208d9754a.1569226914.git.github@grubix.eu>
References: <49b85799a8f0674ac5eb6f2dfc37b23208d9754a.1569226914.git.github@grubix.eu>
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
Date: Tue, 26 Jun 2018 17:41:19 +0200
Subject: [PATCH 13/13] Use which from shutil
Signed-off-by: Michael J Gruber <github@grubix.eu>
---
setup.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/setup.py b/setup.py
index 86619ec..799c1d2 100644
--- a/setup.py
+++ b/setup.py
@@ -208,17 +208,15 @@ class Build(build):
def find_programs(utils):
- sys.path.append("lib")
- from contrib.which import which
+ import shutil
util_paths = {}
missed = []
for util in utils:
- try:
- path = which.which(util)
+ path = shutil.which(util)
+ if path:
util_paths[util] = path
- except which.WhichError:
+ else:
missed.append(util)
- sys.path.remove("lib")
return (util_paths, missed)
def kpsewhich(tex_file):
--
2.23.0.369.g5d0cb2d495

View File

@ -0,0 +1,62 @@
From f5ce76603178e5465a744cb4feed4686489bebb9 Mon Sep 17 00:00:00 2001
Message-ID: <f5ce76603178e5465a744cb4feed4686489bebb9.1688648379.git.github@grubix.eu>
From: Michael J Gruber <github@grubix.eu>
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

View File

@ -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

View File

@ -1,26 +0,0 @@
--- dblatex-0.3.4/setup.py 2012-06-02 16:43:42.000000000 -0700
+++ dblatex-0.3.4/setup.py_disable_debian 2012-12-03 21:30:30.843851029 -0800
@@ -23,7 +23,7 @@ from distutils.command.sdist import sdis
from distutils import log
from subprocess import Popen, PIPE
sys.path.append("lib")
-from contrib.debian.installer import DebianInstaller
+#from contrib.debian.installer import DebianInstaller
#
# Build the command line script
@@ -365,10 +365,10 @@ class Install(install):
raise OSError("not found: %s" % ", ".join(mis_stys))
def run(self):
- if self.install_layout == "deb":
- db = DebianInstaller(self)
- else:
- db = None
+# if self.install_layout == "deb":
+# db = DebianInstaller(self)
+# else:
+ db = None
if not(db) and not(self.nodeps):
try:

View File

@ -1,25 +1,31 @@
Name: dblatex
Version: 0.3.10
Release: 8
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}.tar.bz2
Source0: http://downloads.sourceforge.net/%{name}/%{name}3-%{version}.tar.bz2
Source1: COPYING-docbook-xsl
Patch0000: dblatex-0.2.7-external-which.patch
Patch0001: dblatex-disable-debian.patch
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: python2-devel python2-which libxslt texlive-base texlive-collection-latex texlive-collection-xetex
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
BuildRequires: texlive-fancybox texlive-jknapltx texlive-multirow texlive-overpic texlive-pdfpages texlive-subfigure
BuildRequires: texlive-stmaryrd texlive-wasysym
Buildrequires: /usr/bin/pathfix.py
Requires: texlive-base texlive-collection-latex texlive-collection-xetex texlive-collection-htmlxml
Requires: texlive-passivetex texlive-xmltex texlive-xmltex-bin texlive-anysize texlive-appendix texlive-bibtopic
Requires: texlive-changebar texlive-ec texlive-fancybox texlive-jknapltx texlive-multirow texlive-overpic
Requires: texlive-pdfpages texlive-subfigure texlive-stmaryrd texlive-wasysym texlive-xmltex-bin libxslt
Requires: texlive-collection-fontsrecommended docbook-dtds
Requires: texlive-collection-fontsrecommended docbook-dtds texlive-everysel
Recommends: ImageMagick texlive-epstopdf-bin transfig inkscape
@ -35,15 +41,15 @@ Summary: Introduce how to use dblatex
Introduce how to use dblatex
%prep
%autosetup -n %{name}-%{version} -p1
%autosetup -n %{name}3-%{version} -p1
rm -rf lib/contrib
%build
%{__python2} setup.py build
%{__python3} setup.py build
%install
%{__python2} setup.py install --root $RPM_BUILD_ROOT
%{__python3} setup.py install --root $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_datadir}/texlive/texmf-dist/tex/latex/dblatex
for file in ` find $RPM_BUILD_ROOT%{_datadir}/dblatex/latex/ -name '*.sty' ` ; do
@ -66,17 +72,14 @@ cp -p %{SOURCE1} COPYING-docbook-xsl
%files
%doc COPYRIGHT COPYING-docbook-xsl
%{python2_sitelib}/dbtexmf/
%{python2_sitelib}/dblatex-*.egg-info
%{python3_sitelib}/dbtexmf/
%{python3_sitelib}/dblatex-*.egg-info
%{_bindir}/dblatex
%{_datadir}/dblatex/
%{_datadir}/texlive/texmf-dist/tex/latex/dblatex/
%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/
@ -85,5 +88,17 @@ cp -p %{SOURCE1} COPYING-docbook-xsl
%{_mandir}/man1/dblatex.1*
%changelog
* Tue Jan 16 2024 yaoxin <yao_xin001@hoperun.com> - 0.3.12-1
- Upgrade to 0.3.12
* Mon May 8 2023 Ge Wang<wang__ge@126.com> - 0.3.11-3
- Fix build failure due to python-setuptools updated to version 66.0.0
* Wed Mar 1 2023 caodongxia<caodongxia@h-partners.com> - 0.3.11-2
- Add requires texlive-everysel
* Fri Nov 13 2020 liuweibo<liuweibo10@huawei.com> - 0.3.11-1
- Update to 0.3.11
* Fri Nov 22 2019 yangjian<yangjian79@huawei.com> - 0.3.10-8
- Package init

View File

@ -1,4 +1,4 @@
version_control: hg
src_repo: http://hg.code.sf.net/p/dblatex/dblatex
tag_prefix: ^v
seperator: _
seperator: "."

BIN
dblatex3-0.3.12.tar.bz2 Normal file

Binary file not shown.