Merge topic 'cpack-deb-new-component-vars'

04a2a923 Help: Add notes for topic 'cpack-deb-new-component-vars'
57672e72 CPackDeb: CPACK_DEBIAN_PACKAGE_NAME documentation improvement
a45a4b2d CPackDeb: set package control field per component
a60574f1 CPackDeb: set priority control field per component
24012e3c CPackDeb: additional CPACK_DEBIAN_PACKAGE_SECTION documentation
47182ab8 CPackDeb: set section control field per component
This commit is contained in:
Brad King 2015-11-09 10:06:35 -05:00 committed by CMake Topic Stage
commit 9ad0ae1c01
2 changed files with 41 additions and 14 deletions

View File

@ -0,0 +1,7 @@
cpack-deb-new-component-vars
----------------------------
* The :module:`CPackDeb` module learned to set Package, Section
and Priority control fields per-component.
See :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION`
and :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY`.

View File

@ -27,11 +27,20 @@
# However as a handy reminder here comes the list of specific variables:
#
# .. variable:: CPACK_DEBIAN_PACKAGE_NAME
# CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME
#
# The Debian package summary
# Set Package control field (variable is automatically transformed to lower
# case).
#
# * Mandatory : YES
# * Default : :variable:`CPACK_PACKAGE_NAME` (lower case)
# * Default :
#
# - :variable:`CPACK_PACKAGE_NAME` for non-component based
# installations
# - :variable:`CPACK_DEBIAN_PACKAGE_NAME` suffixed with -<COMPONENT>
# for component-based installations.
#
# See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_VERSION
@ -100,10 +109,16 @@
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_SECTION
# CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
#
# Set Section control field e.g. admin, devel, doc, ...
#
# * Mandatory : YES
# * Default : 'devel'
#
# See https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
#
#
# .. variable:: CPACK_DEBIAN_COMPRESSION_TYPE
#
# The compression used for creating the Debian package.
@ -114,12 +129,16 @@
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_PRIORITY
# CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY
#
# The Debian package priority
# Set Priority control field e.g. required, important, standard, optional,
# extra
#
# * Mandatory : YES
# * Default : 'optional'
#
# See https://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_HOMEPAGE
#
@ -590,18 +609,18 @@ 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_${dependency_type_}
# if per-component variable, overrides the global CPACK_DEBIAN_PACKAGE_${variable_type_}
# automatic dependency discovery will be performed afterwards.
if(CPACK_DEB_PACKAGE_COMPONENT)
foreach(dependency_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE)
set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${dependency_type_}")
foreach(value_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION PRIORITY NAME)
set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${value_type_}")
# if set, overrides the global dependency
# if set, overrides the global variable
if(DEFINED ${_component_var})
set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${${_component_var}}")
set(CPACK_DEBIAN_PACKAGE_${value_type_} "${${_component_var}}")
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message("CPackDeb Debug: component '${_local_component_name}' ${dependency_type_} "
"dependencies set to '${CPACK_DEBIAN_PACKAGE_${dependency_type_}}'")
message("CPackDeb Debug: component '${_local_component_name}' ${value_type_} "
"value set to '${CPACK_DEBIAN_PACKAGE_${value_type_}}'")
endif()
endif()
endforeach()
@ -694,10 +713,11 @@ function(cpack_deb_prepare_package_vars)
endif()
endforeach()
set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
if(CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME)
string(TOLOWER "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
else()
set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
string(TOLOWER "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_DEB_PACKAGE_COMPONENT}" CPACK_DEBIAN_PACKAGE_NAME)
endif()
endif()
# Print out some debug information if we were asked for that