From 47182ab876260c20554d8c5e3e8f453264a47b53 Mon Sep 17 00:00:00 2001 From: Markus Rickert Date: Sun, 8 Nov 2015 22:10:12 +0100 Subject: [PATCH 1/6] CPackDeb: set section control field per component --- Modules/CPackDeb.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 875a5345f..2c1f2362b 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -100,6 +100,7 @@ # # # .. variable:: CPACK_DEBIAN_PACKAGE_SECTION +# CPACK_DEBIAN__PACKAGE_SECTION # # * Mandatory : YES # * Default : 'devel' @@ -590,18 +591,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) + 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() From 24012e3c15c127fe570a222fc8cde37cf2a27023 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 8 Nov 2015 22:17:27 +0100 Subject: [PATCH 2/6] CPackDeb: additional CPACK_DEBIAN_PACKAGE_SECTION documentation --- Modules/CPackDeb.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 2c1f2362b..e2c23120c 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -102,9 +102,14 @@ # .. variable:: CPACK_DEBIAN_PACKAGE_SECTION # CPACK_DEBIAN__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. From a60574f1bfbb5a153b7e55cf5183be93ac50bea0 Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 8 Nov 2015 22:35:30 +0100 Subject: [PATCH 3/6] CPackDeb: set priority control field per component --- Modules/CPackDeb.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index e2c23120c..722dca45d 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -120,12 +120,16 @@ # # # .. variable:: CPACK_DEBIAN_PACKAGE_PRIORITY +# CPACK_DEBIAN__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 # @@ -599,7 +603,7 @@ function(cpack_deb_prepare_package_vars) # 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(value_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION) + foreach(value_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION PRIORITY) set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${value_type_}") # if set, overrides the global variable From a45a4b2d86bf7d03d690433c3b1299ace1e6dbe0 Mon Sep 17 00:00:00 2001 From: Markus Rickert Date: Sun, 8 Nov 2015 23:44:00 +0100 Subject: [PATCH 4/6] CPackDeb: set package control field per component --- Modules/CPackDeb.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 722dca45d..7e9eb869a 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -27,6 +27,7 @@ # However as a handy reminder here comes the list of specific variables: # # .. variable:: CPACK_DEBIAN_PACKAGE_NAME +# CPACK_DEBIAN__PACKAGE_NAME # # The Debian package summary # @@ -603,7 +604,7 @@ function(cpack_deb_prepare_package_vars) # 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(value_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION PRIORITY) + 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 variable @@ -704,10 +705,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) - else() - set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "") + if(CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME) + string(TOLOWER "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME) + else() + 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 From 57672e7275fc12534b5b13f9c922fe569936c81a Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 8 Nov 2015 23:46:13 +0100 Subject: [PATCH 5/6] CPackDeb: CPACK_DEBIAN_PACKAGE_NAME documentation improvement --- Modules/CPackDeb.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 7e9eb869a..2aaef6161 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -29,10 +29,18 @@ # .. variable:: CPACK_DEBIAN_PACKAGE_NAME # CPACK_DEBIAN__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 - +# for component-based installations. +# +# See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source # # # .. variable:: CPACK_DEBIAN_PACKAGE_VERSION From 04a2a923481bcc1cc734e1ed58d8505370ec909b Mon Sep 17 00:00:00 2001 From: Domen Vrankar Date: Sun, 8 Nov 2015 23:46:13 +0100 Subject: [PATCH 6/6] Help: Add notes for topic 'cpack-deb-new-component-vars' --- Help/release/dev/cpack-deb-new-component-vars.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Help/release/dev/cpack-deb-new-component-vars.rst diff --git a/Help/release/dev/cpack-deb-new-component-vars.rst b/Help/release/dev/cpack-deb-new-component-vars.rst new file mode 100644 index 000000000..e30afdbc1 --- /dev/null +++ b/Help/release/dev/cpack-deb-new-component-vars.rst @@ -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__PACKAGE_SECTION` + and :variable:`CPACK_DEBIAN__PACKAGE_PRIORITY`.