1From 731c8d7e1f9edb527785d61f74031a5e5846554b Mon Sep 17 00:00:00 2001
2From: James Hilliard <james.hilliard1@gmail.com>
3Date: Sun, 25 Jul 2021 16:30:59 -0600
4Subject: [PATCH] Add option to disable xmlto manual generation.
5
6Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
7[james.hilliard1@gmail.com: backport from upstream commit
895e0b461f5a46c74b00287aca65732ea2fc9d69b]
9---
10 Makefile.am  | 7 ++++++-
11 configure.ac | 5 +++++
12 2 files changed, 11 insertions(+), 1 deletion(-)
13
14diff --git a/Makefile.am b/Makefile.am
15index 843ba30d..7facab94 100644
16--- a/Makefile.am
17+++ b/Makefile.am
18@@ -209,9 +209,11 @@ else
19 systemd_CLEANFILES=
20 endif
21
22+if XMLTO
23 man_MANS=					\
24 	man/system-config-printer.1		\
25 	man/system-config-printer-applet.1
26+endif
27
28 dbus_DATA =					\
29 	dbus/com.redhat.NewPrinterNotification.conf		\
30@@ -274,7 +276,6 @@ EXTRA_DIST=\
31 	$(bin_SCRIPTS) \
32 	setup.py \
33 	$(EXPORT_MODULES) \
34-	man/system-config-printer.xml \
35 	$(dbus_DATA) \
36 	$(dbusinterfaces_DATA) \
37 	$(dbusservices_DATA) \
38@@ -297,12 +298,16 @@ EXTRA_DIST=\
39 	test_PhysicalDevice.py \
40 	$(appdata_in_files)
41
42+if XMLTO
43+EXTRA_DIST+=man/system-config-printer.xml
44+
45 # The man pages are generated from DocBook XML.
46 .stamp-man-pages-built: $(top_srcdir)/man/system-config-printer.xml
47 	xmlto man -o man $<
48 	touch .stamp-man-pages-built
49
50 $(man_MANS): .stamp-man-pages-built
51+endif
52
53 html:	$(EXPORT_MODULES) $(EXPORT_MODULES_GEN)
54 	rm -rf html
55diff --git a/configure.ac b/configure.ac
56index 811f897a..a2a66889 100644
57--- a/configure.ac
58+++ b/configure.ac
59@@ -75,6 +75,11 @@ if test "x$with_systemdsystemunitdir" != xno; then
60 fi
61 AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
62
63+AC_ARG_WITH(xmlto,
64+        [AC_HELP_STRING([--with-xmlto],
65+                [Enable xmlto manual generation @<:@default=yes@:>@])])
66+AM_CONDITIONAL([XMLTO], [test x$with_xmlto != xno])
67+
68 ALL_LINGUAS="ar as ast bg bn_IN bn br bs ca cs cy da de el en_GB es et fa fi fr fur gu he hi hr hu id is it ja kn ko lt lv mai ml mr ms nb nds nl nn oc or pa pl pt_BR pt ro ru si sk sl sr@latin sr sv ta te th tr uk vi zh_CN zh_TW"
69 AC_CONFIG_FILES([
70 Makefile
71--
722.25.1
73
74