diff options
author | David Cole <david.cole@kitware.com> | 2010-11-23 21:11:33 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2010-11-23 21:11:33 (GMT) |
commit | 525b528625ad489c75faa79d3113b96cfa41a96a (patch) | |
tree | 6e20c0c2313058dac0d7d58d2c69940881a60945 /Modules | |
parent | 651120b7afa90268b2317b4ad8eaa98150d3ccce (diff) | |
parent | 66e86b4770dcda3b5e79776c4cda6e60646189f1 (diff) | |
download | CMake-525b528625ad489c75faa79d3113b96cfa41a96a.zip CMake-525b528625ad489c75faa79d3113b96cfa41a96a.tar.gz CMake-525b528625ad489c75faa79d3113b96cfa41a96a.tar.bz2 |
Merge topic 'CPackRPM-ComponentSupport'
66e86b4 CPack fix kwstyle breakage and make CPackRPM backward compatible
2c84d16 CPackRPM add basic component support to CPackRPM
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CPackRPM.cmake | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index e2d78802..ab909f4 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -331,7 +331,7 @@ ELSE(CPACK_RPM_COMPRESSION_TYPE) ENDIF(CPACK_RPM_COMPRESSION_TYPE) if(CPACK_PACKAGE_RELOCATABLE) - set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) + set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) endif(CPACK_PACKAGE_RELOCATABLE) if(CPACK_RPM_PACKAGE_RELOCATABLE) if(CPACK_RPM_PACKAGE_DEBUG) @@ -453,6 +453,17 @@ SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}") #STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}") SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}") + +# Are we packaging components ? +IF(CPACK_RPM_PACKAGE_COMPONENT) + SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}") + SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}") + SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}") +ELSE(CPACK_RPM_PACKAGE_COMPONENT) + SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "") + SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "") + SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}") +ENDIF(CPACK_RPM_PACKAGE_COMPONENT) # Use files tree to construct files command (spec file) # We should not forget to include symlinks (thus -o -type l) # We must remove the './' due to the local search and escape the @@ -460,10 +471,10 @@ SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}") # Then we must authorize any man pages extension (adding * at the end) # because rpmbuild may automatically compress those files EXECUTE_PROCESS(COMMAND find -type f -o -type l - COMMAND sed {s:.*/man.*/.*:&*:} - COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/} - WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}" - OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES) + COMMAND sed {s:.*/man.*/.*:&*:} + COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/} + WORKING_DIRECTORY "${WDIR}" + OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES) if (CPACK_ABSOLUTE_DESTINATION_FILES) IF(CPACK_RPM_PACKAGE_DEBUG) @@ -494,7 +505,7 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES) endif(CPACK_ABSOLUTE_DESTINATION_FILES) # The name of the final spec file to be used by rpmbuild -SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec") +SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec") # Print out some debug information if we were asked for that IF(CPACK_RPM_PACKAGE_DEBUG) @@ -517,7 +528,7 @@ ENDIF(CPACK_RPM_PACKAGE_DEBUG) IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE) FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in "# -*- rpm-spec -*- -BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@ +BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@ Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@ Name: \@CPACK_RPM_PACKAGE_NAME\@ Version: \@CPACK_RPM_PACKAGE_VERSION\@ @@ -608,15 +619,15 @@ IF(RPMBUILD_EXECUTABLE) # Now call rpmbuild using the SPECFILE EXECUTE_PROCESS( COMMAND "${RPMBUILD_EXECUTABLE}" -bb - --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}" + --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" "${CPACK_RPM_BINARY_SPECFILE}" - WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}" - ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err" - OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out") + WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}" + ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err" + OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out") IF(CPACK_RPM_PACKAGE_DEBUG) MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ") - MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err") - MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out") + MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err") + MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out") ENDIF(CPACK_RPM_PACKAGE_DEBUG) ELSE(RPMBUILD_EXECUTABLE) IF(ALIEN_EXECUTABLE) |