[tracker/wip/carlosg/fix-manpages-install: 3/3] manpages: Fix installation of manpage files




commit 0cd3d0f099e1e11cd6a009762e2b55d956c8554c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 7 11:23:57 2020 +0200

    manpages: Fix installation of manpage files
    
    The xsltproc step has two small gotchas: the output does not happen on
    stdout, so we are capturing empty stdout, and installing an empty file instead
    of our nice manpages.
    
    But also, the target filename gets determined by the XSL based on the input,
    so a manpage filename is as defined in its NAME section. This means we cannot
    do filename changes to add the version this late in the stage.
    
    Furthermore, the tracker-xdg-portal-3 manpage follows a different naming scheme
    (i.e. not "tracker3-*").
    
    Handle this all at once, specify per manpage target files that do match the
    xsltproc output, and ensure the file gets generated at the current build dir.

 docs/manpages/meson.build | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
index ffaf40e03..f90c757cf 100644
--- a/docs/manpages/meson.build
+++ b/docs/manpages/meson.build
@@ -1,16 +1,20 @@
 manpages = [
-    'endpoint',
-    'export',
-    'import',
-    'sparql',
-    'sql',
-    'xdg-portal',
+    ['endpoint', 'tracker3-endpoint', 1],
+    ['export', 'tracker3-export', 1],
+    ['import', 'tracker3-import', 1],
+    ['sparql', 'tracker3-sparql', 1],
+    ['sql', 'tracker3-sql', 1],
+    ['xdg-portal', 'tracker-xdg-portal-3', 1],
 ]
 
 foreach m : manpages
-  manpage_src = 'tracker-@0  1 txt'.format(m)
-  manpage_xml = 'tracker-@0  1 xml'.format(m)
-  manpage = 'tracker@0@-@1@.1'.format(tracker_api_major, m)
+  src = m[0]
+  dst = m[1]
+  section = m[2]
+
+  manpage_src = 'tracker-@0@.@1@.txt'.format(src, section)
+  manpage_xml = '@0@.@1@.xml'.format(dst, section)
+  manpage = '@0@.@1@'.format(dst, section)
 
   xml = custom_target(manpage_xml,
     command: [asciidoc,
@@ -26,12 +30,12 @@ foreach m : manpages
 
   custom_target(manpage,
     command: [xsltproc,
+              '--output', '@OUTPUT@',
               '--stringparam', 'man.authors.section.enabled', '0',
               '/etc/asciidoc/docbook-xsl/manpage.xsl', '@INPUT@'],
-    capture: true,
     input: xml,
     output: manpage,
     install: true,
-    install_dir: get_option('mandir') / 'man1',
+    install_dir: get_option('mandir') / 'man@0@'.format(section),
   )
 endforeach


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]