summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2016-09-24 10:05:06 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2016-09-24 10:05:06 (GMT)
commit1ef45a30aae240a89893e86e2509d5400da9753f (patch)
tree6913e03e1f2ed74224063cd0799a48a9f215579f /Modules
parent08147a7feabba4113c29f8e898ebe3047180e4bf (diff)
downloadCMake-1ef45a30aae240a89893e86e2509d5400da9753f.zip
CMake-1ef45a30aae240a89893e86e2509d5400da9753f.tar.gz
CMake-1ef45a30aae240a89893e86e2509d5400da9753f.tar.bz2
Revert "CPack/DEB: Make package description variable precedence match RPM"
This reverts commit 332b089ad213a1aa89658fffd8f68c9064c6d3db as multiline descriptions require special formatting.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackDeb.cmake43
1 files changed, 21 insertions, 22 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 423bb00..1a7b923 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -156,18 +156,16 @@
# * Default : :code:`CPACK_PACKAGE_CONTACT`
#
# .. variable:: CPACK_DEBIAN_PACKAGE_DESCRIPTION
-# CPACK_DEBIAN_<COMPONENT>_PACKAGE_DESCRIPTION
+# CPACK_COMPONENT_<COMPONENT>_DESCRIPTION
#
# The Debian package description
#
# * Mandatory : YES
# * Default :
#
-# - :variable:`CPACK_COMPONENT_<compName>_DESCRIPTION` (component based installers only) if set,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_FILE` if set to non default location,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` if set,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_FILE` default value if set,
-# - or "no package description available"
+# - :variable:`CPACK_DEBIAN_PACKAGE_DESCRIPTION` if set or
+# - :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`
+#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_SECTION
# CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
@@ -831,23 +829,24 @@ function(cpack_deb_prepare_package_vars)
endif()
# Description: (mandatory)
- if(CPACK_DEB_PACKAGE_COMPONENT)
- if(CPACK_DEBIAN_${_local_component_name}_PACKAGE_DESCRIPTION)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_DESCRIPTION}")
- elseif(CPACK_COMPONENT_${_local_component_name}_DESCRIPTION)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_COMPONENT_${_local_component_name}_DESCRIPTION}")
+ if(NOT CPACK_DEB_PACKAGE_COMPONENT)
+ if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif()
- endif()
-
- if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- if(CPACK_PACKAGE_DESCRIPTION_FILE AND NOT "${CPACK_PACKAGE_DESCRIPTION_FILE}" STREQUAL "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
- file(READ "${CPACK_PACKAGE_DESCRIPTION_FILE}" CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- elseif(CPACK_PACKAGE_DESCRIPTION_SUMMARY)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
- elseif(CPACK_PACKAGE_DESCRIPTION_FILE) # use default package description file content
- file(READ "${CPACK_PACKAGE_DESCRIPTION_FILE}" CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- else()
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "no package description available")
+ else()
+ set(component_description_var CPACK_COMPONENT_${_local_component_name}_DESCRIPTION)
+
+ # component description overrides package description
+ if(${component_description_var})
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${${component_description_var}})
+ elseif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION or ${component_description_var}")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif()
endif()