File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 2
2
# Wrapper for CPackRPM.cmake
3
3
#
4
4
5
+ IF (NOT DEFINED RPM_RECOMMENDS )
6
+ EXECUTE_PROCESS (COMMAND rpm --recommends ERROR_QUIET RESULT_VARIABLE RPM_RECOMMENDS )
7
+ MESSAGE ("CPackRPM:Debug: Testing rpm --recommends: ${RPM_RECOMMENDS} " )
8
+ ENDIF ()
9
+
5
10
#
6
11
# Support for per-component LICENSE and VENDOR
7
12
#
@@ -47,6 +52,20 @@ if (acc)
47
52
file (WRITE ${${base_var}} "${acc} " )
48
53
endif ()
49
54
55
+ #
56
+ # Support for the Recommends: tag.
57
+ # We don't use Suggests: so here he hijack Suggests: variable
58
+ # to implement Recommends:
59
+ #
60
+ IF (CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_RECOMMENDS )
61
+ IF (RPM_RECOMMENDS EQUAL 0 ) # exit code 0 means ok
62
+ SET (TMP_RPM_SUGGESTS "Recommends: ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT} _PACKAGE_RECOMMENDS}" )
63
+ ELSE () # rpm is too old to recommend
64
+ SET (CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES
65
+ "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT} _PACKAGE_REQUIRES} ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT} _PACKAGE_RECOMMENDS}" )
66
+ ENDIF ()
67
+ ENDIF ()
68
+
50
69
# load the original CPackRPM.cmake
51
70
set (orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} )
52
71
unset (CMAKE_MODULE_PATH )
You can’t perform that action at this time.
0 commit comments