diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..0e611ec
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ latextest
+
diff --git a/asciidoc.changes b/asciidoc.changes
index ae11ec1..d802fc6 100644
--- a/asciidoc.changes
+++ b/asciidoc.changes
@@ -1,3 +1,11 @@
+-------------------------------------------------------------------
+Mon May 2 09:31:19 UTC 2022 - Stephan Kulow
+
+- Add a subpackage that brings in the requirements for building pdf (too much
+ for default, recommends won't help in building OBS packages)
+- Adding multibuild flavor to verify the latex dependencies are complete
+- Motivated by nut failing to build pdf in SP4
+
-------------------------------------------------------------------
Sat Apr 30 11:07:26 UTC 2022 - Ferdinand Thiessen
diff --git a/asciidoc.spec b/asciidoc.spec
index fe3b2d1..e4f9d5f 100644
--- a/asciidoc.spec
+++ b/asciidoc.spec
@@ -1,5 +1,5 @@
#
-# spec file for package asciidoc
+# spec file
#
# Copyright (c) 2022 SUSE LLC
#
@@ -16,7 +16,12 @@
#
-Name: asciidoc
+%define flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" != ""
+%define name_suffix -%{flavor}
+%endif
+
+Name: asciidoc%{?name_suffix}
Version: 10.1.4
Release: 0
Summary: Text-Based Document Generation
@@ -33,10 +38,13 @@ BuildRequires: python3-setuptools
BuildRequires: python3-xml
Requires: docbook-xsl-stylesheets
Requires: python3-xml
-Recommends: dblatex
+Recommends: %{name}-latex-backend
# a2x needs /usr/bin/xsltproc
Recommends: libxslt
BuildArch: noarch
+%if "%{flavor}" == "latextest"
+BuildRequires: asciidoc-latex-backend
+%endif
%description
AsciiDoc is a text document format for writing short documents,
@@ -49,11 +57,39 @@ Summary: Examples and Documents for asciidoc
%description examples
This package contains examples and documents of asciidoc.
+%package latex-backend
+Summary: Provide latex backend dependencies
+Requires: %{name} = %{version}
+Requires: dblatex
+# some of them are actually required by dblatex, but it's easier to keep them all in here
+Requires: texlive-metafont-bin
+Requires: tex(8r.enc)
+Requires: tex(fancybox.sty)
+Requires: tex(mathrsfs.sty)
+Requires: tex(pcrr8c.tfm)
+Requires: tex(phvr8t.tfm)
+Requires: tex(ptmr8t.tfm)
+Requires: tex(ptmri7t.tfm)
+Requires: tex(rsfs10.tfm)
+Requires: tex(upquote.sty)
+Requires: tex(zptmcm7v.tfm)
+Requires: tex(zptmcm7y.tfm)
+
+%description latex-backend
+AsciiDoc can generate pdf from asciidoc format through dblatex. For that it needs quite some
+latex dependencies that we don't want to have by default. So this package is optional.
+
%prep
-%setup -q
+%setup -q -n asciidoc-%{version}
# do not use env
find ./ -name \*.py -exec sed -i -e 's:/usr/bin/env\ :%{_bindir}/:g' {} \;
+%if "%{flavor}" == "latextest"
+%build
+a2x --verbose --xsltproc-opts --nonet --attribute=badges --attribute=external_title -a toc -a numbered --attribute=pdf_format --format=pdf -a docinfo1 doc/a2x.1.txt
+
+%else
+
%build
%python3_build
@@ -83,4 +119,9 @@ python3 tests/testasciidoc.py run
%files examples
%doc doc
+%files latex-backend
+%license COPYRIGHT
+
+%endif
+
%changelog