summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-10-22 17:37:42 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-10-22 17:37:42 (GMT)
commite5feae98383ef72ce2ae0e849fbd6ca47172a9f3 (patch)
treedec869e58a02892b7a947b6dd819022e2ac26de0 /Tests
parentfc9041d0249c113cb812d69ee0b8f1411f1eea15 (diff)
parent603ef7fd9d87f55da803b13ddad8f093c6fba3d7 (diff)
downloadCMake-e5feae98383ef72ce2ae0e849fbd6ca47172a9f3.zip
CMake-e5feae98383ef72ce2ae0e849fbd6ca47172a9f3.tar.gz
CMake-e5feae98383ef72ce2ae0e849fbd6ca47172a9f3.tar.bz2
Merge topic 'cpack-rpm-component-descriptions'
603ef7fd CPackRPM: Add component based packaging description and summary
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in9
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake59
2 files changed, 67 insertions, 1 deletions
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
index 450c204..8c01b32 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
@@ -8,6 +8,13 @@ endif()
if(CPACK_GENERATOR MATCHES "RPM")
set(CPACK_RPM_COMPONENT_INSTALL "ON")
set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries")
+
+ # test package summary override
+ set(CPACK_RPM_PACKAGE_SUMMARY "default summary")
+ set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary")
+
+ # test package description override
+ set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description")
endif()
if(CPACK_GENERATOR MATCHES "DEB")
@@ -20,4 +27,4 @@ endif()
#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE)
#set(CPACK_COMPONENTS_GROUPING)
set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
-#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) \ No newline at end of file
+#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 0b6d07d..4d56218 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -123,3 +123,62 @@ if(expected_file_mask)
message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})")
endif()
endif()
+
+# Validate content
+if(CPackGen MATCHES "RPM")
+ find_program(RPM_EXECUTABLE rpm)
+ if(NOT RPM_EXECUTABLE)
+ message(FATAL_ERROR "error: missing rpm executable required by the test")
+ endif()
+
+ set(CPACK_RPM_PACKAGE_SUMMARY "default summary")
+ set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary")
+ set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description")
+ set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION
+ "An extremely useful application that makes use of MyLib")
+ set(CPACK_COMPONENT_HEADERS_DESCRIPTION
+ "C/C\\+\\+ header files for use with MyLib")
+
+ if(${CPackComponentWay} STREQUAL "IgnoreGroup")
+ foreach(check_file ${expected_file})
+ string(REGEX MATCH ".*libraries.*" check_file_libraries_match ${check_file})
+ string(REGEX MATCH ".*headers.*" check_file_headers_match ${check_file})
+ string(REGEX MATCH ".*applications.*" check_file_applications_match ${check_file})
+ string(REGEX MATCH ".*Unspecified.*" check_file_Unspecified_match ${check_file})
+
+ execute_process(COMMAND ${RPM_EXECUTABLE} -pqi ${check_file}
+ OUTPUT_VARIABLE check_file_content
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(check_file_libraries_match)
+ set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*")
+ set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*")
+ elseif(check_file_headers_match)
+ set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
+ set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*")
+ elseif(check_file_applications_match)
+ set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
+ set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*")
+ elseif(check_file_Unspecified_match)
+ set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
+ set(check_file_match_expected_description ".*DESCRIPTION.*")
+ else()
+ message(FATAL_ERROR "error: unexpected rpm package '${check_file}'")
+ endif()
+
+ string(REGEX MATCH ${check_file_match_expected_summary} check_file_match_summary ${check_file_content})
+
+ if(NOT check_file_match_summary)
+ message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'")
+ endif()
+
+ string(REGEX MATCH ${check_file_match_expected_description} check_file_match_description ${check_file_content})
+
+ if(NOT check_file_match_description)
+ message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'")
+ endif()
+ endforeach()
+ elseif(${CPackComponentWay} STREQUAL "IgnoreGroup")
+ endif()
+endif()