From 48cf30d3e2fe95426f8fd1046f381ea299ba83d9 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Mon, 7 Aug 2017 11:49:52 +0200 Subject: Converted manpage to Restructured Text --- meson.build | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 1aff672..315f330 100644 --- a/meson.build +++ b/meson.build @@ -25,6 +25,8 @@ if not cc.compiles(code, args: [ '-O0', '-Werror=unused-result' ]) endif +rst2man = find_program('rst2man', required: false) + cfg = configuration_data() cfg.set_quoted('PACKAGE_VERSION', meson.project_version()) @@ -39,9 +41,6 @@ else cfg.set_quoted('IDMAP_DEFAULT', 'none') endif -configure_file(input: 'sshfs.1.in', - output: 'sshfs.1', - configuration : cfg) configure_file(output: 'config.h', configuration : cfg) @@ -56,9 +55,14 @@ executable('sshfs', sshfs_sources, install: true, install_dir: get_option('bindir')) -# This is a little ugly. Is there a better way to tell Meson that the -# manpage is in the build directory? -install_man(join_paths(meson.current_build_dir(), 'sshfs.1')) +if rst2man.found() + custom_target('manpages', input: [ 'sshfs.rst' ], output: [ 'sshfs.1' ], + command: [rst2man, '@INPUT@', '@OUTPUT@'], install: true, + install_dir: join_paths(get_option('mandir'), '1')) +else + message('rst2man not found, not building manual page.') +endif + subdir('test') -- cgit v1.2.3