Commit 694f4364 authored by Sergei Golubchik's avatar Sergei Golubchik

CPackRPM support for Recommends:

this breaks support for Suggests: but we don't use it anyway
parent 2b856ecd
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
# Wrapper for CPackRPM.cmake # Wrapper for CPackRPM.cmake
# #
IF(NOT DEFINED RPM_RECOMMENDS)
EXECUTE_PROCESS(COMMAND rpm --recommends ERROR_QUIET RESULT_VARIABLE RPM_RECOMMENDS)
MESSAGE("CPackRPM:Debug: Testing rpm --recommends: ${RPM_RECOMMENDS}")
ENDIF()
# #
# Support for per-component LICENSE and VENDOR # Support for per-component LICENSE and VENDOR
# #
...@@ -47,6 +52,20 @@ if (acc) ...@@ -47,6 +52,20 @@ if (acc)
file(WRITE ${${base_var}} "${acc}") file(WRITE ${${base_var}} "${acc}")
endif() endif()
#
# Support for the Recommends: tag.
# We don't use Suggests: so here he hijack Suggests: variable
# to implement Recommends:
#
IF (CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_RECOMMENDS)
IF (RPM_RECOMMENDS EQUAL 0) # exit code 0 means ok
SET(TMP_RPM_SUGGESTS "Recommends: ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_RECOMMENDS}")
ELSE() # rpm is too old to recommend
SET(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES
"${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES} ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_RECOMMENDS}")
ENDIF()
ENDIF()
# load the original CPackRPM.cmake # load the original CPackRPM.cmake
set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
unset(CMAKE_MODULE_PATH) unset(CMAKE_MODULE_PATH)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment