Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build all manuals regardless of enabled features #2804

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 24 additions & 16 deletions docs/man/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@

set(manuals
set(core
gendiff.1 rpm2cpio.8
rpm.8 rpmbuild.8 rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8
rpmdeps.8 rpmgraph.8 rpmlua.8 rpm-misc.8 rpmsort.8
)
set(extra
rpm2archive.8 rpm-plugins.8 rpm-plugin-prioreset.8 rpm-plugin-syslog.8
rpm-plugin-audit.8 rpm-plugin-dbus-announce.8
rpm-plugin-systemd-inhibit.8 rpm-plugin-fapolicyd.8 rpm-plugin-ima.8
rpm-plugin-selinux.8 rpm-plugin-unshare.8
)

# Build all manuals
set(manuals ${core} ${extra})
if (PANDOC)
foreach(man ${manuals})
add_custom_command(OUTPUT ${man} COMMAND ${PANDOC}
${CMAKE_CURRENT_SOURCE_DIR}/${man}.md
-s -t man -o ${man} DEPENDS ${man}.md)
endforeach()
add_custom_target(man ALL DEPENDS ${manuals})
endif()

# Install manuals for the enabled features
set(manuals ${core})
if (WITH_ARCHIVE)
list(APPEND manuals rpm2archive.8)
endif()

if (ENABLE_PLUGINS)
list(APPEND manuals rpm-plugins.8
rpm-plugin-prioreset.8 rpm-plugin-syslog.8)
Expand All @@ -32,19 +49,13 @@ if (ENABLE_PLUGINS)
list(APPEND manuals rpm-plugin-unshare.8)
endif()
endif()

foreach(man ${manuals})
unset(fn)
if (EXISTS ${PANDOC})
add_custom_command(OUTPUT ${man} COMMAND ${PANDOC}
${CMAKE_CURRENT_SOURCE_DIR}/${man}.md
-s -t man -o ${man} DEPENDS ${man}.md)
if (PANDOC)
set(fn ${CMAKE_CURRENT_BINARY_DIR}/${man})
else()
elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${man})
# dist tarballs have pre-built manuals in the source dir
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${man})
set(fn ${CMAKE_CURRENT_SOURCE_DIR}/${man})
endif()
set(fn ${CMAKE_CURRENT_SOURCE_DIR}/${man})
endif()
if (fn)
get_filename_component(ext ${fn} EXT)
Expand All @@ -53,9 +64,6 @@ foreach(man ${manuals})
DESTINATION ${CMAKE_INSTALL_MANDIR}/${section})
endif()
endforeach()
if (fn)
add_custom_target(man ALL DEPENDS ${manuals})
else()
if (NOT fn)
message(WARNING "pandoc not available and not a dist tarball, man pages not available")
endif()