summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackRPM.cmake28
1 files changed, 26 insertions, 2 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 026c45a..26209a7 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -194,6 +194,25 @@ IF(NOT RPMBUILD_EXECUTABLE)
MESSAGE(FATAL_ERROR "RPM package requires rpmbuild executable")
ENDIF(NOT RPMBUILD_EXECUTABLE)
+# Display lsb_release output if DEBUG mode enable
+# This will help to diagnose problem with CPackRPM
+# because we will know on which kind of Linux we are
+IF(CPACK_RPM_PACKAGE_DEBUG)
+ find_program(LSB_RELEASE_EXECUTABLE lsb_release)
+ if(LSB_RELEASE_EXECUTABLE)
+ execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -a
+ OUTPUT_VARIABLE _TMP_LSB_RELEASE_OUTPUT
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(REGEX REPLACE "\n" ", "
+ LSB_RELEASE_OUTPUT
+ ${_TMP_LSB_RELEASE_OUTPUT})
+ else (LSB_RELEASE_EXECUTABLE)
+ set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
+ endif(LSB_RELEASE_EXECUTABLE)
+ MESSAGE("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
+ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+
# We may use RPM version in the future in order
# to shut down warning about space in buildtree
# some recent RPM version should support space in different places.
@@ -621,13 +640,18 @@ IF(RPMBUILD_EXECUTABLE)
--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}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
+ RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT
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)
+ IF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
+ FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
+ FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
+ MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
- ENDIF(CPACK_RPM_PACKAGE_DEBUG)
+ MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
+ ENDIF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
ELSE(RPMBUILD_EXECUTABLE)
IF(ALIEN_EXECUTABLE)
MESSAGE(FATAL_ERROR "RPM packaging through alien not done (yet)")