diff --git a/doc/ja/meson.build b/doc/ja/meson.build index c7a644120..ec6d8b559 100644 --- a/doc/ja/meson.build +++ b/doc/ja/meson.build @@ -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 diff --git a/doc/ko/meson.build b/doc/ko/meson.build index bd01f6088..97390f570 100644 --- a/doc/ko/meson.build +++ b/doc/ko/meson.build @@ -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 diff --git a/doc/meson.build b/doc/meson.build index af773975c..7f87bac23 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -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 diff --git a/meson.build b/meson.build index fd549b30f..53fb21e67 100644 --- a/meson.build +++ b/meson.build @@ -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')