]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
meson: More flexible doc handling 4125/head
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 30 May 2022 19:59:58 +0000 (15:59 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 30 May 2022 20:00:12 +0000 (16:00 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
doc/ja/meson.build
doc/ko/meson.build
doc/meson.build
meson.build

index c7a6441201d8cca5ccb873c6ec5490fff4626a75..ec6d8b559496e95ee4d50928bd307c4b0fd7ff55 100644 (file)
@@ -57,13 +57,6 @@ if want_mans
         input: 'see_also.sgml.in',
         output: 'see_also.sgml')
 
-    # Config
-    docconf = configuration_data()
-    docconf.set('docdtd', '"-//OASIS//DTD DocBook XML" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"')
-    docconf.set('builddir', '.')
-    docconf.set('LXC_GENERATE_DATE', generate_date)
-    docconf.set_quoted('PACKAGE_VERSION', meson.project_version())
-
     # Initial templating.
     foreach page : PAGES
         sgml = configure_file(
@@ -74,7 +67,7 @@ if want_mans
         configure_file(
             input: sgml,
             output: page[0] + '.' + page[1],
-            command: ['docbook2x-man', '--encoding=UTF-8', page[0] + '.sgml'],
+            command: [sgml2man, '--encoding=UTF-8', page[0] + '.sgml'],
             install: true,
             install_dir: join_paths(mandir, 'ja', 'man' + page[1]))
     endforeach
index bd01f60884d29f89d71adf0e81304b68b6f8a50c..97390f570c178f0d424d7fb8fccfe461e05ac358 100644 (file)
@@ -50,13 +50,6 @@ if want_mans
         input: 'see_also.sgml.in',
         output: 'see_also.sgml')
 
-    # Config
-    docconf = configuration_data()
-    docconf.set('docdtd', '"-//OASIS//DTD DocBook XML" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"')
-    docconf.set('builddir', '.')
-    docconf.set('LXC_GENERATE_DATE', generate_date)
-    docconf.set_quoted('PACKAGE_VERSION', meson.project_version())
-
     # Initial templating.
     foreach page : PAGES
         sgml = configure_file(
@@ -67,7 +60,7 @@ if want_mans
         configure_file(
             input: sgml,
             output: page[0] + '.' + page[1],
-            command: ['docbook2x-man', '--encoding=UTF-8', page[0] + '.sgml'],
+            command: [sgml2man, '--encoding=UTF-8', page[0] + '.sgml'],
             install: true,
             install_dir: join_paths(mandir, 'ko', 'man' + page[1]))
     endforeach
index af773975cbc9b040a2fa8b4f22719c84ce1b3818..7f87bac231f6fbe46d51d33ae4d295441ea134c2 100644 (file)
@@ -57,13 +57,6 @@ if want_mans
         input: 'see_also.sgml.in',
         output: 'see_also.sgml')
 
-    # Config
-    docconf = configuration_data()
-    docconf.set('docdtd', '"-//OASIS//DTD DocBook XML" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"')
-    docconf.set('builddir', '.')
-    docconf.set('LXC_GENERATE_DATE', generate_date)
-    docconf.set_quoted('PACKAGE_VERSION', meson.project_version())
-
     # Initial templating.
     foreach page : PAGES
         sgml = configure_file(
@@ -74,7 +67,7 @@ if want_mans
         configure_file(
             input: sgml,
             output: page[0] + '.' + page[1],
-            command: ['docbook2x-man', '--encoding=UTF-8', page[0] + '.sgml'],
+            command: [sgml2man, '--encoding=UTF-8', page[0] + '.sgml'],
             install: true,
             install_dir: join_paths(mandir, 'man' + page[1]))
     endforeach
index fd549b30f35b059d42dc6248676dab58a74d59bd..53fb21e67e874bead0d9f395fd82cd769463c56e 100644 (file)
@@ -212,6 +212,20 @@ generate_date = run_command(date, '--utc', '--date=@' + time_epoch, '+%Y-%m-%d',
 time_epoch = time_epoch.to_int()
 conf.set('TIME_EPOCH', time_epoch)
 
+## Manpages.
+sgml2man = find_program('docbook2X2man', 'docbook2x-man', 'db2x_docbook2man', 'docbook2man', 'docbook-to-man', required: false)
+docbook2man = find_program('docbook2man', required: false)
+
+docconf = configuration_data()
+docconf.set('builddir', '.')
+docconf.set('LXC_GENERATE_DATE', generate_date)
+docconf.set('PACKAGE_VERSION', version_data.get('LXC_VERSION'))
+if sgml2man.found() and docbook2man.found() and sgml2man.full_path() == docbook2man.full_path()
+    docconf.set('docdtd', '"-//Davenport//DTD DocBook V3.0//EN"')
+else
+    docconf.set('docdtd', '"-//OASIS//DTD DocBook XML" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"')
+endif
+
 ## Threads.
 threads = dependency('threads')