feat: Add man page generation to Meson build

This commit implements the man page portion of step 8 of the Meson migration plan.

It adds the necessary 'meson.build' files to the 'man' and 'man/man3' directories to find 'pod2man' and generate the man pages from the '.pod' source files. The generated man pages are also installed.

Signed-off-by: Gemini <gemini@google.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2025-08-04 15:00:15 +04:00
parent 4bfb164c8a
commit 6162498a0e
3 changed files with 41 additions and 1 deletions

37
man/man3/meson.build Normal file
View File

@ -0,0 +1,37 @@
pod_files = [
'TPM_IO_Hash_Start.pod',
'TPM_IO_TpmEstablished_Get.pod',
'TPM_Malloc.pod',
'TPMLIB_CancelCommand.pod',
'TPMLIB_ChooseTPMVersion.pod',
'TPMLIB_DecodeBlob.pod',
'TPMLIB_GetInfo.pod',
'TPMLIB_GetTPMProperty.pod',
'TPMLIB_GetVersion.pod',
'TPMLIB_MainInit.pod',
'TPMLIB_Process.pod',
'TPMLIB_RegisterCallbacks.pod',
'TPMLIB_SetBufferSize.pod',
'TPMLIB_SetDebugFD.pod',
'TPMLIB_SetProfile.pod',
'TPMLIB_SetState.pod',
'TPMLIB_ValidateState.pod',
'TPMLIB_VolatileAll_Store.pod',
'TPMLIB_WasManufactured.pod',
]
pod2man = find_program('pod2man', required: true)
foreach pod : pod_files
base_name = pod.split('.')[0]
target_name = base_name + '.3'
custom_target(target_name,
input: pod,
output: target_name,
command: [pod2man, '-r', 'libtpms', '-c', '""', '-n', base_name, '--section=3', '@INPUT@', '@OUTPUT@'],
capture: false,
install: true,
install_dir: get_option('mandir') / 'man3'
)
endforeach

1
man/meson.build Normal file
View File

@ -0,0 +1 @@
subdir('man3')

View File

@ -67,6 +67,8 @@ configure_file(
configuration: conf_data
)
# Add subdirectories to the build
# Add subdirectories to the build
subdir('include')
subdir('src')
subdir('src')
subdir('man')