Tests: CpackRPM test component architecture

Test creating rpms of type "noarch", native, and "armv7hf"
This commit is contained in:
Joshua A Clayton 2015-02-19 00:01:16 -08:00 committed by Brad King
parent 3aa9f89dbb
commit f174b919d6
2 changed files with 14 additions and 0 deletions

View File

@ -11,6 +11,12 @@ if(CPACK_GENERATOR MATCHES "RPM")
set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_COMPONENT_INSTALL "ON")
set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries")
# test a "noarch" rpm
set(CPACK_RPM_headers_PACKAGE_ARCHITECTURE "noarch")
# test cross-built rpm
set(CPACK_RPM_applications_PACKAGE_ARCHITECTURE "armv7hf")
# test package summary override # test package summary override
set(CPACK_RPM_PACKAGE_SUMMARY "default summary") set(CPACK_RPM_PACKAGE_SUMMARY "default summary")
set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary")

View File

@ -161,21 +161,25 @@ if(CPackGen MATCHES "RPM")
set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*") set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*")
set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*") set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*")
set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(check_file_match_expected_architecture "Architecture: ${CPACK_RPM_applications_PACKAGE_ARCHITECTURE}")
set(spec_regex "*libraries*") set(spec_regex "*libraries*")
elseif(check_file_headers_match) elseif(check_file_headers_match)
set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*")
set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
set(check_file_match_expected_architecture "Architecture: ${CPACK_RPM_libraries_PACKAGE_ARCHITECTURE}")
set(spec_regex "*headers*") set(spec_regex "*headers*")
elseif(check_file_applications_match) elseif(check_file_applications_match)
set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*")
set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
set(check_file_match_expected_architecture "Architecture: ${CPACK_RPM_headers_PACKAGE_ARCHITECTURE}")
set(spec_regex "*applications*") set(spec_regex "*applications*")
elseif(check_file_Unspecified_match) elseif(check_file_Unspecified_match)
set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
set(check_file_match_expected_description ".*DESCRIPTION.*") set(check_file_match_expected_description ".*DESCRIPTION.*")
set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
set(check_file_match_expected_architecture "Architecture: ${CPACK_RPM_Unspecified_PACKAGE_ARCHITECTURE}")
set(spec_regex "*Unspecified*") set(spec_regex "*Unspecified*")
else() else()
message(FATAL_ERROR "error: unexpected rpm package '${check_file}'") message(FATAL_ERROR "error: unexpected rpm package '${check_file}'")
@ -204,6 +208,10 @@ if(CPackGen MATCHES "RPM")
message(FATAL_ERROR "error: '${check_file}' rpm package relocation path does not match expected value - regex '${check_file_match_expected_relocation_path}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'") message(FATAL_ERROR "error: '${check_file}' rpm package relocation path does not match expected value - regex '${check_file_match_expected_relocation_path}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'")
endif() endif()
string(REGEX MATCH ${check_file_match_expected_architecture} check_file_match_architecture ${check_file_content})
if (NOT check_file_match_architecture)
message(FATAL_ERROR "error: '${check_file}' Architecture does not match expected value - '${check_file_match_expected_architecture}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'")
endif()
endforeach() endforeach()
elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") elseif(${CPackComponentWay} STREQUAL "IgnoreGroup")
endif() endif()