diff options
author | Brad King <brad.king@kitware.com> | 2017-03-27 13:13:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-03-27 13:13:31 (GMT) |
commit | 89e2c92f546c3d1b702b2c0ca206eabfc3f7caab (patch) | |
tree | ce1fc1adbf299d4e347424e104be3e00fac2d7db | |
parent | 42b7d132a8a20f06fec3a8a7d1dc1820f95e6896 (diff) | |
parent | f237f5f851df64e009f97304e6569f7e259d44e6 (diff) | |
download | CMake-89e2c92f546c3d1b702b2c0ca206eabfc3f7caab.zip CMake-89e2c92f546c3d1b702b2c0ca206eabfc3f7caab.tar.gz CMake-89e2c92f546c3d1b702b2c0ca206eabfc3f7caab.tar.bz2 |
Merge topic 'cpack-rpm-debuginfo-honor-package-filename'
f237f5f8 CPack/RPM: support for debuginfo package renaming
6c09c5d6 CPack/RPM honor package file name on debuginfo enabled
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !620
-rw-r--r-- | Help/release/dev/cpack-rpm-debuginfo-honor-package-filename.rst | 5 | ||||
-rw-r--r-- | Modules/CPackRPM.cmake | 44 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake | 10 |
4 files changed, 62 insertions, 5 deletions
diff --git a/Help/release/dev/cpack-rpm-debuginfo-honor-package-filename.rst b/Help/release/dev/cpack-rpm-debuginfo-honor-package-filename.rst new file mode 100644 index 0000000..1c6eb2b --- /dev/null +++ b/Help/release/dev/cpack-rpm-debuginfo-honor-package-filename.rst @@ -0,0 +1,5 @@ +cpack-rpm-debuginfo-honor-package-filename +------------------------------------------ + +* The :module:`CPackRPM` module learned to modify debuginfo package name. + See :variable:`CPACK_RPM_DEBUGINFO_FILE_NAME` variable. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 3766a3d..cc54032 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -817,6 +817,30 @@ # is set then :variable:`CPACK_RPM_DEBUGINFO_PACKAGE` is automatically set to # ``ON`` when :variable:`CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE` is set. # +# .. variable:: CPACK_RPM_DEBUGINFO_FILE_NAME +# CPACK_RPM_<component>_DEBUGINFO_FILE_NAME +# +# Debuginfo package file name. +# +# * Mandatory : NO +# * Default : rpmbuild tool generated package file name +# +# Alternatively provided debuginfo package file name must end with ``.rpm`` +# suffix and should differ from file names of other generated packages. +# +# Variable may contain ``@cpack_component@`` placeholder which will be +# replaced by component name if component packaging is enabled otherwise it +# deletes the placeholder. +# +# Setting the variable to ``RPM-DEFAULT`` may be used to explicitly set +# filename generation to default. +# +# .. note:: +# +# :variable:`CPACK_RPM_FILE_NAME` also supports rpmbuild tool generated package +# file name - disabled by default but can be enabled by setting the variable to +# ``RPM-DEFAULT``. +# # Packaging of sources (SRPM) # ^^^^^^^^^^^^^^^^^^^^^^^^^^^ # @@ -2640,11 +2664,27 @@ mv %_topdir/tmpBBroot $RPM_BUILD_ROOT unset(expected_filenames_) unset(filenames_) if(CPACK_RPM_DEBUGINFO_PACKAGE AND NOT CPACK_RPM_FILE_NAME STREQUAL "RPM-DEFAULT") - string(TOLOWER "${CPACK_RPM_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.*\\.rpm" efn_) - list(APPEND expected_filenames_ "${efn_}") + list(APPEND expected_filenames_ + "${CPACK_RPM_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.*\\.rpm") list(APPEND filenames_ "${CPACK_RPM_FILE_NAME}") endif() + if(CPACK_RPM_DEBUGINFO_PACKAGE) + cpack_rpm_variable_fallback("CPACK_RPM_DEBUGINFO_FILE_NAME" + "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_DEBUGINFO_FILE_NAME" + "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT_UPPER}_DEBUGINFO_FILE_NAME" + "CPACK_RPM_DEBUGINFO_FILE_NAME") + + if(CPACK_RPM_DEBUGINFO_FILE_NAME AND + NOT CPACK_RPM_DEBUGINFO_FILE_NAME STREQUAL "RPM-DEFAULT") + list(APPEND expected_filenames_ + "${CPACK_RPM_PACKAGE_NAME}-debuginfo-${CPACK_PACKAGE_VERSION}.*\\.rpm") + string(REPLACE "@cpack_component@" "${CPACK_RPM_PACKAGE_COMPONENT}" + CPACK_RPM_DEBUGINFO_FILE_NAME "${CPACK_RPM_DEBUGINFO_FILE_NAME}") + list(APPEND filenames_ "${CPACK_RPM_DEBUGINFO_FILE_NAME}") + endif() + endif() + # check if other files have to be renamed file(GLOB rename_files_ "${CPACK_RPM_DIRECTORY}/SPECS/*.rpm_name") if(rename_files_) diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake index 06e56d3..3d8de74 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake @@ -3,14 +3,16 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "5") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) +set(EXPECTED_FILE_1_NAME "Debuginfo") set(EXPECTED_FILE_1_COMPONENT "applications") set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/test_prog") -set(EXPECTED_FILE_2 "debuginfo*-headers.rpm") +set(EXPECTED_FILE_2 "TestDinfo-pkg*-headers.rpm") set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt") -set(EXPECTED_FILE_3 "debuginfo*-libs.rpm") +set(EXPECTED_FILE_3 "TestDinfo-pkg*-libs.rpm") set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/libtest_lib.so") +set(EXPECTED_FILE_4_NAME "Debuginfo") set(EXPECTED_FILE_4_COMPONENT "applications-debuginfo") set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*") -set(EXPECTED_FILE_5_COMPONENT "libs-debuginfo") +set(EXPECTED_FILE_5 "libs-DebugInfoPackage.rpm") set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*") diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake index 0642d83..f1b6738 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake @@ -25,6 +25,16 @@ install(TARGETS test_lib DESTINATION bas COMPONENT libs) set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) + +# test that components with debuginfo enabled still honor +# CPACK_PACKAGE_FILE_NAME setting +set(CPACK_RPM_PACKAGE_NAME "Debuginfo") +set(CPACK_PACKAGE_FILE_NAME "TestDinfo-pkg") set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) +# test debuginfo package rename +set(CPACK_RPM_DEBUGINFO_FILE_NAME + "@cpack_component@-DebugInfoPackage.rpm") +set(CPACK_RPM_APPLICATIONS_DEBUGINFO_FILE_NAME "RPM-DEFAULT") + set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src") |