summaryrefslogtreecommitdiffstats
path: root/Modules/CPackDeb.cmake
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2015-09-09 21:57:58 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2015-09-09 21:57:58 (GMT)
commit4de7c8126b43d93f781afaf0b990cc8814105017 (patch)
tree1627a3b1d24c931e31d68ff9d89700bcbd0cd72e /Modules/CPackDeb.cmake
parentf281c6214ba932e5a5c9d8bae67313fc8bfa8ec9 (diff)
downloadCMake-4de7c8126b43d93f781afaf0b990cc8814105017.zip
CMake-4de7c8126b43d93f781afaf0b990cc8814105017.tar.gz
CMake-4de7c8126b43d93f781afaf0b990cc8814105017.tar.bz2
CPack/Deb: enable per component setting of dependencies
Diffstat (limited to 'Modules/CPackDeb.cmake')
-rw-r--r--Modules/CPackDeb.cmake76
1 files changed, 60 insertions, 16 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 75e9966..6c94d8e 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -78,6 +78,7 @@
#
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
#
+#
# .. variable:: CPACK_DEBIAN_PACKAGE_MAINTAINER
#
# The Debian package maintainer
@@ -164,6 +165,7 @@
# * Default : -
#
# .. variable:: CPACK_DEBIAN_PACKAGE_PREDEPENDS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS
#
# Sets the `Pre-Depends` field of the Debian package.
# Like :variable:`Depends <CPACK_DEBIAN_PACKAGE_DEPENDS>`, except that it
@@ -172,11 +174,16 @@
# pre-dependency.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_PREDEPENDS` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
# .. variable:: CPACK_DEBIAN_PACKAGE_ENHANCES
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES
#
# Sets the `Enhances` field of the Debian package.
# Similar to :variable:`Suggests <CPACK_DEBIAN_PACKAGE_SUGGESTS>` but works
@@ -184,11 +191,16 @@
# functionality of another package.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_ENHANCES` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
# .. variable:: CPACK_DEBIAN_PACKAGE_BREAKS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS
#
# Sets the `Breaks` field of the Debian package.
# When a binary package (P) declares that it breaks other packages (B),
@@ -199,12 +211,17 @@
# packages (B) cannot be reconfigured again.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_BREAKS` for component-based
+# installations.
#
# See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-breaks
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_CONFLICTS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS
#
# Sets the `Conflicts` field of the Debian package.
# When one binary package declares a conflict with another using a `Conflicts`
@@ -212,7 +229,11 @@
# the same time.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_CONFLICTS` for component-based
+# installations.
#
# See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts
#
@@ -225,48 +246,68 @@
# time.
#
# .. variable:: CPACK_DEBIAN_PACKAGE_PROVIDES
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES
#
# Sets the `Provides` field of the Debian package.
# A virtual package is one which appears in the `Provides` control field of
# another package.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_PROVIDES` for component-based
+# installations.
#
# See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_REPLACES
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES
#
# Sets the `Replaces` field of the Debian package.
# Packages can declare in their control file that they should overwrite
# files in certain other packages, or completely replace other packages.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_REPLACES` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_RECOMMENDS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS
#
# Sets the `Recommends` field of the Debian package.
# Allows packages to declare a strong, but not absolute, dependency on other
# packages.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_RECOMMENDS` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_SUGGESTS
+# CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS
#
# Sets the `Suggests` field of the Debian package.
# Allows packages to declare a suggested package install grouping.
#
# * Mandatory : NO
-# * Default : -
+# * Default :
+#
+# - An empty string for non-component based installations
+# - :variable:`CPACK_DEBIAN_PACKAGE_SUGGESTS` for component-based
+# installations.
#
# See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
#
@@ -496,18 +537,21 @@ function(cpack_deb_prepare_package_vars)
# You should set: DEBIAN_PACKAGE_DEPENDS
# TODO: automate 'objdump -p | grep NEEDED'
- # if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_DEPENDS
+ # if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_${dependency_type_}
# automatic dependency discovery will be performed afterwards.
if(CPACK_DEB_PACKAGE_COMPONENT)
- set(_component_depends_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_DEPENDS")
+ foreach(dependency_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES)
+ set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${dependency_type_}")
- # if set, overrides the global dependency
- if(DEFINED ${_component_depends_var})
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "${${_component_depends_var}}")
- if(CPACK_DEBIAN_PACKAGE_DEBUG)
- message("CPackDeb Debug: component '${_local_component_name}' dependencies set to '${CPACK_DEBIAN_PACKAGE_DEPENDS}'")
+ # if set, overrides the global dependency
+ if(DEFINED ${_component_var})
+ set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${${_component_var}}")
+ if(CPACK_DEBIAN_PACKAGE_DEBUG)
+ message("CPackDeb Debug: component '${_local_component_name}' ${dependency_type_}"
+ "dependencies set to '${CPACK_DEBIAN_PACKAGE_${dependency_}}'")
+ endif()
endif()
- endif()
+ endforeach()
endif()
# at this point, the CPACK_DEBIAN_PACKAGE_DEPENDS is properly set