-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meson: add support for building the manpages
Not as brief as the pipeline and pattern matching that (auto)make can do, although it's fully functional ;-) v2: - move man/meson.build - move script under scripts/ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
- Loading branch information
Showing
5 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
scdoc = find_program('scdoc') | ||
|
||
_man_pages = [ | ||
[ '5', 'depmod.d' ], | ||
[ '5', 'modprobe.d' ], | ||
[ '5', 'modules.dep' ], | ||
[ '8', 'depmod' ], | ||
[ '8', 'insmod' ], | ||
[ '8', 'kmod' ], | ||
[ '8', 'lsmod' ], | ||
[ '8', 'modinfo' ], | ||
[ '8', 'modprobe' ], | ||
[ '8', 'rmmod' ], | ||
] | ||
foreach tuple : _man_pages | ||
section = tuple[0] | ||
man = tuple[1] | ||
|
||
custom_target( | ||
'man_@0@_@1@'.format(section, man), | ||
command : [ | ||
build_scdoc, | ||
scdoc, | ||
'@INPUT@', | ||
's|@SYSCONFDIR@|@0@|g;'.format(sysconfdir) + | ||
's|@DISTCONFDIR@|@0@|g;'.format(distconfdir) + | ||
's|@MODULE_DIRECTORY@|@0@|g;'.format(moduledir), | ||
], | ||
input : '@0@.@1@.scd'.format(man, section), | ||
output : '@0@.@1@'.format(man, section), | ||
capture : true, | ||
build_by_default : get_option('manpages'), | ||
install : true, | ||
install_dir : join_paths(get_option('mandir'), 'man@0@'.format(section)) | ||
) | ||
endforeach | ||
|
||
_man_aliases = [ | ||
['5', 'modules.dep.bin', 'modules.dep.5' ], | ||
] | ||
|
||
foreach tuple : _man_aliases | ||
section = tuple[0] | ||
man = tuple[1] | ||
dest = tuple[2] | ||
|
||
custom_target( | ||
'man_@0@_@1@'.format(section, man), | ||
command : ['echo', '.so @0@'.format(dest)], | ||
output : '@0@.@1@'.format(man, section), | ||
capture : true, | ||
build_by_default : get_option('manpages'), | ||
install : true, | ||
install_dir : join_paths(get_option('mandir'), 'man@0@'.format(section)) | ||
) | ||
endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
SCDOC=$1 | ||
INPUT=$2 | ||
SED_PATTERN=$3 | ||
|
||
cat $INPUT | sed -e $SED_PATTERN | $SCDOC |