summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2016-05-23 17:51:33 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2016-05-23 17:55:46 (GMT)
commitadbd3985f89f19d9de867a75321465d6e181908d (patch)
treed910cf142bdc41d81a8d1402b4ddb6e3b5d53a67 /Tests
parentc75d91a05c9f442582726e3e80fec41d016da76f (diff)
downloadCMake-adbd3985f89f19d9de867a75321465d6e181908d.zip
CMake-adbd3985f89f19d9de867a75321465d6e181908d.tar.gz
CMake-adbd3985f89f19d9de867a75321465d6e181908d.tar.bz2
CPack/Deb possibility to change package name
This patch preserves backward compatibility of deb package names with previous CMake versions but similarly to CPack/RPM allows to change package name format and supports DEB-DEFAULT setting that produces proper Debian package names.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CPackComponentsDEB/CMakeLists.txt2
-rw-r--r--Tests/CPackComponentsForAll/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CPack/CUSTOM_NAMES.cmake (renamed from Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake)4
-rw-r--r--Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake9
-rw-r--r--Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake6
-rw-r--r--Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake10
-rw-r--r--Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake2
-rw-r--r--Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB_EXTRA.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake1
-rw-r--r--Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake (renamed from Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake)0
-rw-r--r--Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake5
-rw-r--r--Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt3
-rw-r--r--Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt3
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake2
19 files changed, 43 insertions, 13 deletions
diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt
index 093b23f..9d4b5e9 100644
--- a/Tests/CPackComponentsDEB/CMakeLists.txt
+++ b/Tests/CPackComponentsDEB/CMakeLists.txt
@@ -130,6 +130,8 @@ configure_file(${CPackComponentsDEB_SOURCE_DIR}/MyLibCPackConfig-${CPackDEBConfi
@ONLY)
set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsDEB_BINARY_DIR}/MyLibCPackConfig-${CPackDEBConfiguration}.cmake)
+# set CPACK_DEBIAN_FILE_NAME to use default package name format
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
# Include CPack to introduce the appropriate targets
include(CPack)
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index 05c13a4..3440843 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -165,6 +165,9 @@ set(CPACK_RPM_RELOCATION_PATHS "${CMAKE_INSTALL_INCLUDEDIR}"
"${CMAKE_INSTALL_LIBDIR}" "${CMAKE_INSTALL_BINDIR}" "other_relocatable"
"${CMAKE_INSTALL_LIBDIR}/inside_relocatable_two/depth_two/different_relocatable")
+# set CPACK_DEBIAN_FILE_NAME to use default package name format
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
+
# We may use the CPack specific config file in order
# to tailor CPack behavior on a CPack generator specific way
# (Behavior would be different for RPM or TGZ or DEB ...)
diff --git a/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake
index ba53a87..c89df89 100644
--- a/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake
+++ b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake
@@ -1,9 +1,5 @@
set(CPACK_RPM_COMPONENT_INSTALL "ON")
-set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
-set(CPACK_RPM_PKG_2_PACKAGE_NAME "second")
-set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm")
-
install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1)
install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2)
install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3)
diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake
index 2720fe9..4b4ac8d 100644
--- a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake
@@ -1,2 +1,3 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
diff --git a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake
new file mode 100644
index 0000000..2acf45b
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake
@@ -0,0 +1,9 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "3")
+set(EXPECTED_FILE_1 "custom_names-pkg_1_0.1.1-1_*.deb")
+set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$")
+set(EXPECTED_FILE_2 "second*.deb")
+set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$")
+set(EXPECTED_FILE_3 "pkg_3_abc.deb")
+set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$")
diff --git a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake
new file mode 100644
index 0000000..c64f161
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake
@@ -0,0 +1,6 @@
+set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEB_COMPONENT_INSTALL "ON")
+
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
+set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second")
+set(CPACK_DEBIAN_PKG_3_FILE_NAME "pkg_3_abc.deb")
diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake
index c182e30..a6f08fe 100644
--- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake
@@ -1,14 +1,14 @@
set(whitespaces_ "[\t\n\r ]*")
set(EXPECTED_FILES_COUNT "5")
-set(EXPECTED_FILE_1 "dependencies-applications_0.1.1-1_*.deb")
+set(EXPECTED_FILE_1 "dependencies-0.1.1-*-applications.deb")
set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/test_prog$")
-set(EXPECTED_FILE_2 "dependencies-applications_auto_0.1.1-1_*.deb")
+set(EXPECTED_FILE_2 "dependencies-0.1.1-*-applications_auto.deb")
set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo_auto${whitespaces_}.*/usr/foo_auto/test_prog$")
-set(EXPECTED_FILE_3 "dependencies-headers_0.1.1-1_*.deb")
+set(EXPECTED_FILE_3 "dependencies-0.1.1-*-headers.deb")
set(EXPECTED_FILE_CONTENT_3 "^.*/usr/bar${whitespaces_}.*/usr/bar/CMakeLists.txt$")
-set(EXPECTED_FILE_4 "dependencies-libs_0.1.1-1_*.deb")
+set(EXPECTED_FILE_4 "dependencies-0.1.1-*-libs.deb")
# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it
set(EXPECTED_FILE_CONTENT_4 "^.*/usr/bas${whitespaces_}.*/usr/bas/libtest_lib\\..*$")
-set(EXPECTED_FILE_5 "dependencies-libs_auto_0.1.1-1_*.deb")
+set(EXPECTED_FILE_5 "dependencies-0.1.1-*-libs_auto.deb")
set(EXPECTED_FILE_CONTENT_5 "^.*/usr/bas_auto${whitespaces_}.*/usr/bas_auto/libtest_lib\\..*$")
diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
index 96a9f14..5f82cc6 100644
--- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
@@ -1,5 +1,7 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+#intentionaly commented out to test old file naming
+#set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
# false by default
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE)
diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake
index 8821ab9..4e9a2e7 100644
--- a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake
@@ -1 +1,2 @@
set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
diff --git a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake
index 8821ab9..4e9a2e7 100644
--- a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake
@@ -1 +1,2 @@
set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
diff --git a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake
index a1da1a3..25bd2e7 100644
--- a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake
@@ -1,5 +1,6 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_SECTION "default")
set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second")
diff --git a/Tests/RunCMake/CPack/DEB_EXTRA.cmake b/Tests/RunCMake/CPack/DEB_EXTRA.cmake
index 3c291d5..189d123 100644
--- a/Tests/RunCMake/CPack/DEB_EXTRA.cmake
+++ b/Tests/RunCMake/CPack/DEB_EXTRA.cmake
@@ -34,5 +34,6 @@ set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA
set(CPACK_PACKAGE_NAME "deb_extra")
set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEB_COMPONENT_INSTALL ON)
diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake
index efb0211..1aeb06f 100644
--- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake
+++ b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake
@@ -1,5 +1,6 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON")
diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake
index 1f70386..f58c876 100644
--- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake
+++ b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake
@@ -1,5 +1,6 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=")
diff --git a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake
index 780e57e..780e57e 100644
--- a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake
diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake
new file mode 100644
index 0000000..575aa01
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake
@@ -0,0 +1,5 @@
+set(CPACK_RPM_COMPONENT_INSTALL "ON")
+
+set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
+set(CPACK_RPM_PKG_2_PACKAGE_NAME "second")
+set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm")
diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt
new file mode 100644
index 0000000..9bfba7e
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt
@@ -0,0 +1,3 @@
+^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_1.spec
+CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/second.spec
+CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_3.spec$
diff --git a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt b/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt
deleted file mode 100644
index d3ba7b0..0000000
--- a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_1.spec
-CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/second.spec
-CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_3.spec$
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 759295f..59c52f8 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -10,7 +10,7 @@ run_cpack_test(DEB_EXTRA "DEB" false)
run_cpack_test(DEPENDENCIES "RPM;DEB" true)
run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true)
run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB;TGZ" true)
-run_cpack_test(RPM_CUSTOM_NAMES "RPM" true)
+run_cpack_test(CUSTOM_NAMES "RPM;DEB" true)
run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false)
run_cpack_test(RPM_DIST "RPM" false)
run_cpack_test(INSTALL_SCRIPTS "RPM" false)