Debian Codegraph @

man/meson.build

raw
1 scdoc = find_program('scdoc')
2
3 _man_pages = [
4 ['5', 'depmod.d'],
5 ['5', 'modprobe.d'],
6 ['5', 'modules.dep'],
7 ['8', 'depmod'],
8 ['8', 'insmod'],
9 ['8', 'kmod'],
10 ['8', 'lsmod'],
11 ['8', 'modinfo'],
12 ['8', 'modprobe'],
13 ['8', 'rmmod'],
14 ]
15 foreach tuple : _man_pages
16 section = tuple[0]
17 man = tuple[1]
18
19 custom_target(
20 'man_@0@_@1@'.format(section, man),
21 command : [
22 build_scdoc,
23 scdoc,
24 '@INPUT@',
25 's|@SYSCONFDIR@|@0@|g;'.format(sysconfdir) +
26 's|@DISTCONFDIR@|@0@|g;'.format(distconfdir) +
27 's|@MODULE_DIRECTORY@|@0@|g;'.format(moduledir),
28 ],
29 input : '@0@.@[email protected]'.format(man, section),
30 output : '@0@.@1@'.format(man, section),
31 capture : true,
32 build_by_default : get_option('manpages'),
33 install : true,
34 install_dir : get_option('mandir') / 'man@0@'.format(section)
35 )
36 endforeach
37
38 _man_aliases = [
39 ['5', 'modprobe.conf', 'modprobe.d.5'],
40 ['5', 'modules.dep.bin', 'modules.dep.5'],
41 ]
42
43 foreach tuple : _man_aliases
44 section = tuple[0]
45 man = tuple[1]
46 dest = tuple[2]
47
48 custom_target(
49 'man_@0@_@1@'.format(section, man),
50 command : ['echo', '.so @0@'.format(dest)],
51 output : '@0@.@1@'.format(man, section),
52 capture : true,
53 build_by_default : get_option('manpages'),
54 install : true,
55 install_dir : get_option('mandir') / 'man@0@'.format(section)
56 )
57 endforeach