diff options
author | Alexander Adam <alexander.adam@megware.com> | 2016-11-05 10:08:52 (GMT) |
---|---|---|
committer | Domen Vrankar <domen.vrankar@gmail.com> | 2016-11-05 10:42:08 (GMT) |
commit | d8e83ab979b0ccfc4887dbf48c088a72dffb2e96 (patch) | |
tree | 6c35cef42e9d1ff71ce798ec27e82488ca940c6b /Modules | |
parent | f52bcc2ac1b3dddeca2320d8320a9406101c732d (diff) | |
download | CMake-d8e83ab979b0ccfc4887dbf48c088a72dffb2e96.zip CMake-d8e83ab979b0ccfc4887dbf48c088a72dffb2e96.tar.gz CMake-d8e83ab979b0ccfc4887dbf48c088a72dffb2e96.tar.bz2 |
CPack/RPM omit unsupported tags
Omit tags that are not supported by provided rpmbuild
as some tags get added/removed in later versions of
the tool.
Closes: #13423
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CPackRPM.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 2483a13..20005ed 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -1844,6 +1844,12 @@ function(cpack_rpm_generate_package) set(CPACK_RPM_PACKAGE_RELOCATABLE FALSE) # disable relocatable option if building source RPM endif() + execute_process( + COMMAND "${RPMBUILD_EXECUTABLE}" --querytags + OUTPUT_VARIABLE RPMBUILD_TAG_LIST + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REPLACE "\n" ";" RPMBUILD_TAG_LIST "${RPMBUILD_TAG_LIST}") + # Check if additional fields for RPM spec header are given # There may be some COMPONENT specific variables as well # If component specific var is not provided we use the global one @@ -1852,6 +1858,7 @@ function(cpack_rpm_generate_package) if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}") endif() + if(CPACK_RPM_PACKAGE_COMPONENT) cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}" "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}" @@ -1859,9 +1866,20 @@ function(cpack_rpm_generate_package) endif() if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if(NOT _RPM_SPEC_HEADER IN_LIST RPMBUILD_TAG_LIST) + cmake_policy(POP) + message(AUTHOR_WARNING "CPackRPM:Warning: ${_RPM_SPEC_HEADER} not " + "supported in provided rpmbuild. Tag will not be used.") + continue() + endif() + cmake_policy(POP) + if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") endif() + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) endif() @@ -2416,6 +2434,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_PROVIDES\@ \@TMP_RPM_OBSOLETES\@ \@TMP_RPM_CONFLICTS\@ +\@TMP_RPM_SUGGESTS\@ \@TMP_RPM_AUTOPROV\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ @@ -2470,6 +2489,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_PROVIDES\@ \@TMP_RPM_OBSOLETES\@ \@TMP_RPM_CONFLICTS\@ +\@TMP_RPM_SUGGESTS\@ \@TMP_RPM_AUTOPROV\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ |