summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CPack/DEB
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CPack/DEB')
-rw-r--r--Tests/RunCMake/CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake7
-rw-r--r--Tests/RunCMake/CPack/DEB/LONG_FILENAMES-VerifyResult.cmake26
-rw-r--r--Tests/RunCMake/CPack/DEB/LONG_FILENAMES-specifics.cmake3
-rw-r--r--Tests/RunCMake/CPack/DEB/Prerequirements.cmake7
5 files changed, 48 insertions, 0 deletions
diff --git a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake
new file mode 100644
index 0000000..dd72cf7
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-ExpectedFiles.cmake
@@ -0,0 +1,5 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_1 "long_filenames_0.1.1-1_*.deb")
+set(EXPECTED_FILE_CONTENT_1 "^.*/usr/${whitespaces_}.*/usr/foo/${whitespaces_}.*/usr/foo/llllllllll_oooooooooo_nnnnnnnnnn_gggggggggg_ffffffffff_iiiiiiiiii_llllllllll_eeeeeeeeee_nnnnnnnnnn_aaaaaaaaaa_mmmmmmmmmm_eeeeeeeeee.txt$")
diff --git a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake
new file mode 100644
index 0000000..0c1d77e
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-Prerequirements.cmake
@@ -0,0 +1,7 @@
+function(get_test_prerequirements found_var)
+ find_program(FAKEROOT_EXECUTABLE NAMES fakeroot)
+
+ if(FAKEROOT_EXECUTABLE)
+ set(${found_var} true PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-VerifyResult.cmake
new file mode 100644
index 0000000..0452343
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-VerifyResult.cmake
@@ -0,0 +1,26 @@
+# create structure required by non root dpkg install
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/updates")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/info")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/available" "")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir/status" "")
+
+# some programs used by fakeroot require sbin in path so we should not
+# leave this to chance (programs: ldconfig and start-stop-daemon)
+set(ENV{PATH} "$ENV{PATH}:/usr/local/sbin:/usr/sbin:/sbin")
+
+execute_process(COMMAND ${FAKEROOT_EXECUTABLE} ${DPKG_EXECUTABLE}
+ -i --force-not-root --root=${CMAKE_CURRENT_BINARY_DIR}/root_dir
+ --admindir=${CMAKE_CURRENT_BINARY_DIR}/root_dir/admindir
+ --log=${CMAKE_CURRENT_BINARY_DIR}/root_dir/dpkg.log
+ ${FOUND_FILE_1}
+ RESULT_VARIABLE install_result_
+ ERROR_VARIABLE install_error_
+ OUTPUT_QUIET
+ )
+
+if(install_result_)
+ message(FATAL_ERROR "LONG_FILENAMES package error - result:"
+ " '${install_result_}'; text: '${install_error_}'")
+endif()
diff --git a/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-specifics.cmake b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-specifics.cmake
new file mode 100644
index 0000000..39a6be4
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/LONG_FILENAMES-specifics.cmake
@@ -0,0 +1,3 @@
+set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
+set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
diff --git a/Tests/RunCMake/CPack/DEB/Prerequirements.cmake b/Tests/RunCMake/CPack/DEB/Prerequirements.cmake
index 197b99d..cb9a277 100644
--- a/Tests/RunCMake/CPack/DEB/Prerequirements.cmake
+++ b/Tests/RunCMake/CPack/DEB/Prerequirements.cmake
@@ -5,4 +5,11 @@ function(get_test_prerequirements found_var config_file)
file(WRITE "${config_file}" "set(DPKG_EXECUTABLE \"${DPKG_EXECUTABLE}\")")
set(${found_var} true PARENT_SCOPE)
endif()
+
+ # optional tool for some tests
+ find_program(FAKEROOT_EXECUTABLE fakeroot)
+ if(FAKEROOT_EXECUTABLE)
+ file(APPEND "${config_file}"
+ "\nset(FAKEROOT_EXECUTABLE \"${FAKEROOT_EXECUTABLE}\")")
+ endif()
endfunction()