From b14a18c7818030d53eab09df9cd93f0cbd33941c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20C=2E=20Morency?= Date: Mon, 16 Jun 2008 18:59:49 -0700 Subject: [PATCH] * Gzip and install man pages --- CMakeLists.txt | 29 +++++++++++++++++++++++++---- awesomeConfig.cmake | 9 +++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3694b553..056b0dee8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,24 +78,37 @@ SET( AWE_MAN_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/awesome.1.txt ${CMAKE_CURRENT_SOURCE_DIR}/awesome-client.1.txt ${CMAKE_CURRENT_SOURCE_DIR}/awesomerc.5.txt ) +SET( AWE_MAN1_NAME ${CMAKE_CURRENT_BINARY_DIR}/awesome.1.gz + ${CMAKE_CURRENT_BINARY_DIR}/awesome-client.1.gz ) +SET( AWE_MAN5_NAME ${CMAKE_CURRENT_BINARY_DIR}/awesomerc.5.gz ) IF( AWESOME_GENERATE_MAN ) FOREACH( txtfile ${AWE_MAN_SRCS}) STRING( REGEX REPLACE ".txt\$" ".xml" xmlfile ${txtfile} ) - STRING( REGEX REPLACE ".xml\$" "" manfile ${xmlfile} ) + STRING( REGEX REPLACE ".xml\$" ".gz" gzipman ${xmlfile} ) + STRING( REPLACE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} gzipman ${gzipman} ) + STRING( REGEX REPLACE ".gz\$" "" manfile ${gzipman} ) ADD_CUSTOM_COMMAND( OUTPUT ${xmlfile} COMMAND ${ASCIIDOC_EXECUTABLE} -d manpage -b docbook -o ${xmlfile} ${txtfile} DEPENDS ${txtfile} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) ADD_CUSTOM_COMMAND( OUTPUT ${manfile} COMMAND ${XMLTO_EXECUTABLE} man ${xmlfile} DEPENDS ${xmlfile} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - SET( AWE_MAN_FILES ${AWE_MAN_FILES} ${manfile} ) + ADD_CUSTOM_COMMAND( OUTPUT ${gzipman} + COMMAND ${GZIP_EXECUTABLE} -f ${manfile} + DEPENDS ${manfile} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + SET( AWE_MAN_FILES ${AWE_MAN_FILES} ${gzipman} ) ENDFOREACH( txtfile) - - ADD_CUSTOM_TARGET( man ALL DEPENDS ${AWE_MAN_FILES} ) + ADD_CUSTOM_TARGET( man ALL DEPENDS ${AWE_MAN_FILES} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) ENDIF( AWESOME_GENERATE_MAN ) ADD_EXECUTABLE( ${PROJECT_AWE_NAME} ${AWE_SRCS} ) @@ -125,6 +138,14 @@ INSTALL( FILES ${AWE_CONF_FILES} DESTINATION ${AWESOME_CONF_PATH} ) +INSTALL( FILES ${AWE_MAN1_NAME} + DESTINATION ${AWESOME_MAN1_PATH} + ) + +INSTALL( FILES ${AWE_MAN5_NAME} + DESTINATION ${AWESOME_MAN5_PATH} + ) + INSTALL( DIRECTORY ${AWE_ICON_PATH} DESTINATION ${AWESOME_ICON_PATH} ) diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index 5da9dc8e3..27c671360 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -81,12 +81,11 @@ ENDIF ( DOXYGEN_EXECUTABLE ) # Check for programs needed for man pages FIND_PROGRAM( ASCIIDOC_EXECUTABLE asciidoc ) FIND_PROGRAM( XMLTO_EXECUTABLE xmlto ) +FIND_PROGRAM( GZIP_EXECUTABLE gzip ) -IF( ASCIIDOC_EXECUTABLE ) - IF( XMLTO_EXECUTABLE ) +IF( ASCIIDOC_EXECUTABLE AND XMLTO_EXECUTABLE AND GZIP_EXECUTABLE ) SET( AWESOME_GENERATE_MAN TRUE ) - ENDIF( XMLTO_EXECUTABLE ) -ENDIF( ASCIIDOC_EXECUTABLE ) +ENDIF( ASCIIDOC_EXECUTABLE AND XMLTO_EXECUTABLE AND GZIP_EXECUTABLE ) # Set awesome informations and path SET( AWESOME_VERSION_INTERNAL devel ) @@ -99,6 +98,8 @@ SET( AWESOME_SHARE ${CMAKE_INSTALL_PREFIX}/share ) SET( AWESOME_LUA_LIB_PATH ${AWESOME_SHARE}/${PROJECT_AWE_NAME}/lib ) SET( AWESOME_ICON_PATH ${AWESOME_SHARE}/${PROJECT_AWE_NAME}/icons ) SET( AWESOME_CONF_PATH ${AWESOME_ETC}/${PROJECT_AWE_NAME} ) +SET( AWESOME_MAN1_PATH /usr/share/man/man1 ) +SET( AWESOME_MAN5_PATH /usr/share/man/man5 ) # Configure awesome config.h from template CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in