diff options
Diffstat (limited to 'Tests/RunCMake/CPack')
4 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 092fb47..3077340 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -22,3 +22,4 @@ run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false "COMPONENT") run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true "CUSTOM") run_cpack_source_test(SOURCE_PACKAGE "RPM") run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC") +run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC") diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake new file mode 100644 index 0000000..aabe537 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/ExpectedFiles.cmake @@ -0,0 +1,2 @@ +set(EXPECTED_FILES_COUNT "1") +set(EXPECTED_FILE_CONTENT_1_LIST "/usr/one;/usr/one/foo.txt;/usr/one/two;/usr/one/two/bar.txt;/usr/three;/usr/three/baz.txt;/usr/three/qux.txt") diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake new file mode 100644 index 0000000..57444ed --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/VerifyResult.cmake @@ -0,0 +1,12 @@ +execute_process(COMMAND ${RPM_EXECUTABLE} -qpd ${FOUND_FILE_1} + WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" + OUTPUT_VARIABLE DOC_FILES_ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + +string(REPLACE "\n" ";" DOC_FILES_ "${DOC_FILES_}") + +set(DOC_FILES_WANTED_ "/usr/one/foo.txt;/usr/one/two/bar.txt;/usr/three/baz.txt") +if (NOT "${DOC_FILES_}" STREQUAL "${DOC_FILES_WANTED_}") + message(FATAL_ERROR "USER_FILELIST handling error: Check filelist in spec file. Doc files were: ${DOC_FILES_}. Should have been ${DOC_FILES_WANTED_}") +endif() diff --git a/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake b/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake new file mode 100644 index 0000000..acfee42 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/USER_FILELIST/test.cmake @@ -0,0 +1,13 @@ +install(FILES CMakeLists.txt DESTINATION one RENAME foo.txt) +install(FILES CMakeLists.txt DESTINATION one/two RENAME bar.txt) +install(FILES CMakeLists.txt DESTINATION three RENAME baz.txt) +install(FILES CMakeLists.txt DESTINATION three RENAME qux.txt) + +# We are verifying the USER_FILELIST works by comparing what +# ends up with a %doc tag in the final rpm with what we expect +# from this USER_FILELIST. +set(CPACK_RPM_USER_FILELIST + "%doc /usr/one/foo.txt" + "%doc %attr(640,root,root) /usr/one/two/bar.txt" + "%attr(600, -, root) %doc /usr/three/baz.txt" +) |