summaryrefslogtreecommitdiffstats
path: root/Modules/CPackRPM.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CPackRPM.cmake')
-rw-r--r--Modules/CPackRPM.cmake27
1 files changed, 24 insertions, 3 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 722ee15..2e69195 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -958,10 +958,20 @@ function(cpack_rpm_prepare_relocation_paths)
foreach(RELOCATION_PATH ${RPM_RELOCATION_PATHS})
if(IS_ABSOLUTE "${RELOCATION_PATH}")
set(PREPARED_RELOCATION_PATH "${RELOCATION_PATH}")
+ elseif(PATH_PREFIX STREQUAL "/")
+ # don't prefix path with a second slash as "//" is treated as network path
+ # by get_filename_component() so it remains in path even inside rpm
+ # package where it may cause problems with relocation
+ set(PREPARED_RELOCATION_PATH "/${RELOCATION_PATH}")
else()
set(PREPARED_RELOCATION_PATH "${PATH_PREFIX}/${RELOCATION_PATH}")
endif()
+ # handle cases where path contains extra slashes (e.g. /a//b/ instead of
+ # /a/b)
+ get_filename_component(PREPARED_RELOCATION_PATH
+ "${PREPARED_RELOCATION_PATH}" ABSOLUTE)
+
if(EXISTS "${WDIR}/${PREPARED_RELOCATION_PATH}")
string(APPEND TMP_RPM_PREFIXES "Prefix: ${PREPARED_RELOCATION_PATH}\n")
list(APPEND RPM_USED_PACKAGE_PREFIXES "${PREPARED_RELOCATION_PATH}")
@@ -1044,7 +1054,7 @@ function(cpack_rpm_prepare_content_list)
endif()
if(NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
- set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include)
+ set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/libx32 /usr/include)
if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.")
@@ -2130,6 +2140,11 @@ function(cpack_rpm_generate_package)
set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/usr/src/debug/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}")
endif()
+ # handle cases where path contains extra slashes (e.g. /a//b/ instead of
+ # /a/b)
+ get_filename_component(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX
+ "${CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX}" ABSOLUTE)
+
if(CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE AND GENERATE_SPEC_PARTS)
file(WRITE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_COMPONENT}.files"
"${CPACK_RPM_INSTALL_FILES}")
@@ -2141,7 +2156,9 @@ function(cpack_rpm_generate_package)
if(CPACK_RPM_DEBUGINFO_PACKAGE)
# only add current package files to debuginfo list if debuginfo
# generation is enabled for current package
- set(install_files_ "${CPACK_RPM_INSTALL_FILES}")
+ string(STRIP "${CPACK_RPM_INSTALL_FILES}" install_files_)
+ string(REPLACE "\n" ";" install_files_ "${install_files_}")
+ string(REPLACE "\"" "" install_files_ "${install_files_}")
else()
unset(install_files_)
endif()
@@ -2199,7 +2216,11 @@ function(cpack_rpm_generate_package)
cpack_rpm_debugsymbol_check("${install_files_}" "${WDIR}")
else()
- cpack_rpm_debugsymbol_check("${CPACK_RPM_INSTALL_FILES}" "${WDIR}")
+ string(STRIP "${CPACK_RPM_INSTALL_FILES}" install_files_)
+ string(REPLACE "\n" ";" install_files_ "${install_files_}")
+ string(REPLACE "\"" "" install_files_ "${install_files_}")
+
+ cpack_rpm_debugsymbol_check("${install_files_}" "${WDIR}")
endif()
if(TMP_DEBUGINFO_ADDITIONAL_SOURCES)