--- /afs/cern.ch/user/b/bvonhall/Downloads/cmake-2.8.12.2/Modules/CPackRPM.cmake	2014-01-16 18:15:08.000000001 +0100
+++ CPackRPM.cmake	2014-03-31 11:48:11.113950282 +0200
@@ -469,6 +469,32 @@
   endif()
 endif()
 
+
+# Add inter-component dependencies
+if(CPACK_RPM_PACKAGE_COMPONENT)
+    if(DEFINED CPACK_COMPONENT_${CPACK_RPM_PACKAGE_COMPONENT}_DEPENDS)
+        if(CPACK_RPM_PACKAGE_DEBUG)
+            message("CPackRPM:Debug: Inter-component dependency for component ${CPACK_RPM_PACKAGE_COMPONENT} defined")
+        endif()
+	    # add the package requirements to list of component's requirements
+	    if(DEFINED CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES) # add coma if non empty
+	        SET(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES},") 
+	    endif()
+	    SET(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES} ${CPACK_RPM_PACKAGE_REQUIRES}")
+
+	    #  for each element in the list of inter-component dependencies
+	    foreach(_DEPENDS ${CPACK_COMPONENT_${CPACK_RPM_PACKAGE_COMPONENT}_DEPENDS})
+	        # Prepare the library name (<project>-<component>) and add it to the requirements
+	        SET(_DEPENDENCY "${CPACK_RPM_PACKAGE_NAME}-${_DEPENDS}")
+	        SET(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES}, ${_DEPENDENCY}")
+	    endforeach()
+    endif()
+endif()
+if(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: List of requirements after inter-component dependencies have been applied : ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES}")
+endif()
+
+
 # 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
@@ -522,8 +548,10 @@
   endif()
 endforeach()
 
+
+ 
 # CPACK_RPM_SPEC_INSTALL_POST
-# May be used to define a RPM post intallation script
+# May be used to define a RPM post intallation script 
 # for example setting it to "/bin/true" may prevent
 # rpmbuild from stripping binaries.
 if(CPACK_RPM_SPEC_INSTALL_POST)
