From d817469b78402d9053c4344d23c82eb6f917b62e Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Mon, 16 Jan 2017 11:34:32 +0100 Subject: [PATCH] Install man pages * man pages are only build/installed if WITH_MANPAGES is enabled * create a new cmake function install_freerdp_man to unified install man pages * install all man pages using the new function * update the nightly packages accordingly --- CMakeLists.txt | 1 + client/Wayland/CMakeLists.txt | 1 + client/X11/CMakeLists.txt | 6 +----- cmake/InstallFreeRDPMan.cmake | 9 +++++++++ packaging/deb/freerdp-nightly/freerdp-nightly.install | 4 ++++ packaging/rpm/freerdp-nightly.spec | 4 ++++ server/shadow/CMakeLists.txt | 1 + winpr/CMakeLists.txt | 9 +-------- winpr/tools/hash-cli/CMakeLists.txt | 1 + winpr/tools/makecert-cli/CMakeLists.txt | 1 + 10 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 cmake/InstallFreeRDPMan.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c4334f5de..654aa5e26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,7 @@ include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) include(GNUInstallDirsWrapper) include(CMakePackageConfigHelpers) +include(InstallFreeRDPMan) # Soname versioning set(BUILD_NUMBER 0) diff --git a/client/Wayland/CMakeLists.txt b/client/Wayland/CMakeLists.txt index 6a39a2f76..bc66f2843 100644 --- a/client/Wayland/CMakeLists.txt +++ b/client/Wayland/CMakeLists.txt @@ -40,3 +40,4 @@ install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT cli set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Wayland") configure_file(wlfreerdp.1.in ${CMAKE_CURRENT_BINARY_DIR}/wlfreerdp.1) +install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/wlfreerdp.1 1) diff --git a/client/X11/CMakeLists.txt b/client/X11/CMakeLists.txt index 3bd5b0a5f..bde78f759 100644 --- a/client/X11/CMakeLists.txt +++ b/client/X11/CMakeLists.txt @@ -111,11 +111,7 @@ if(WITH_MANPAGES) add_custom_target(xfreerdp.manpage ALL DEPENDS xfreerdp.1) - if(OPENBSD) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1 DESTINATION man/man1) - else() - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1 DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1) - endif() + install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1 1) else() message(WARNING "WITH_MANPAGES was set, but xsltproc was not found. man-pages will not be installed") endif() diff --git a/cmake/InstallFreeRDPMan.cmake b/cmake/InstallFreeRDPMan.cmake new file mode 100644 index 000000000..8190ea126 --- /dev/null +++ b/cmake/InstallFreeRDPMan.cmake @@ -0,0 +1,9 @@ +function(install_freerdp_man manpage section) + if(WITH_MANPAGES) + if(OPENBSD) + install(FILES ${manpage} DESTINATION man/man${section}) + else() + install(FILES ${manpage} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man${section}) + endif() + endif() +endfunction() diff --git a/packaging/deb/freerdp-nightly/freerdp-nightly.install b/packaging/deb/freerdp-nightly/freerdp-nightly.install index b12d909a4..cd909794f 100644 --- a/packaging/deb/freerdp-nightly/freerdp-nightly.install +++ b/packaging/deb/freerdp-nightly/freerdp-nightly.install @@ -1,4 +1,8 @@ opt/freerdp-nightly/lib/*.so.* opt/freerdp-nightly/bin +opt/freerdp-master/share/man/man1/freerdp-shadow-cli.1* +opt/freerdp-master/share/man/man1/winpr-makecert.1* +opt/freerdp-master/share/man/man1/winpr-hash.1* +opt/freerdp-master/share/man/man1/wlfreerdp.1* opt/freerdp-nightly/share/man/man1/xfreerdp.1* opt/freerdp-nightly/share/man/man7/wlog.7* diff --git a/packaging/rpm/freerdp-nightly.spec b/packaging/rpm/freerdp-nightly.spec index 210197195..1cb3583d1 100644 --- a/packaging/rpm/freerdp-nightly.spec +++ b/packaging/rpm/freerdp-nightly.spec @@ -139,6 +139,10 @@ export NO_BRP_CHECK_RPATH true %{INSTALL_PREFIX}/%{_lib}/*.so.* %{INSTALL_PREFIX}/bin/ %{INSTALL_PREFIX}/share/man/man1/xfreerdp.1* +%{INSTALL_PREFIX}/share/man/man1/freerdp-shadow-cli.1* +%{INSTALL_PREFIX}/share/man/man1/winpr-makecert.1* +%{INSTALL_PREFIX}/share/man/man1/winpr-hash.1* +%{INSTALL_PREFIX}/share/man/man1/wlfreerdp.1* %{INSTALL_PREFIX}/share/man/man7/wlog.7* %files devel diff --git a/server/shadow/CMakeLists.txt b/server/shadow/CMakeLists.txt index 80f4bf38e..e8bfdf71a 100644 --- a/server/shadow/CMakeLists.txt +++ b/server/shadow/CMakeLists.txt @@ -339,6 +339,7 @@ set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/shadow") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-shadow.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc @ONLY) configure_file(freerdp-shadow-cli.1.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow-cli.1) +install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow-cli.1 1) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index ae1fbc862..a14d59630 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -176,14 +176,7 @@ if(BUILD_TESTING) add_subdirectory(test) endif() -if(WITH_MANPAGES) - if(OPENBSD) - install(FILES wlog.7 DESTINATION man/man7) - else() - install(FILES wlog.7 DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man7) - endif() -endif(WITH_MANPAGES) - +install_freerdp_man(wlog.7 7) # Exporting if(${CMAKE_VERSION} VERSION_GREATER "2.8.10") diff --git a/winpr/tools/hash-cli/CMakeLists.txt b/winpr/tools/hash-cli/CMakeLists.txt index c16f86067..9f8c7a8a0 100644 --- a/winpr/tools/hash-cli/CMakeLists.txt +++ b/winpr/tools/hash-cli/CMakeLists.txt @@ -51,3 +51,4 @@ endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools") configure_file(winpr-hash.1.in ${CMAKE_CURRENT_BINARY_DIR}/winpr-hash.1) +install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/winpr-hash.1 1) diff --git a/winpr/tools/makecert-cli/CMakeLists.txt b/winpr/tools/makecert-cli/CMakeLists.txt index c818d5d3c..74afa09ea 100644 --- a/winpr/tools/makecert-cli/CMakeLists.txt +++ b/winpr/tools/makecert-cli/CMakeLists.txt @@ -52,3 +52,4 @@ if (WITH_DEBUG_SYMBOLS AND MSVC) endif() configure_file(winpr-makecert.1.in ${CMAKE_CURRENT_BINARY_DIR}/winpr-makecert.1) +install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/winpr-makecert.1 1)