[Cmake-commits] CMake branch, next, updated. v3.4.0-rc3-1222-ged645b3

Domen Vrankar domen.vrankar at gmail.com
Tue Nov 3 18:24:14 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ed645b3a720e7d3df63aa39da3883a994e74a298 (commit)
       via  76f0fd05a5fc25eb8a3c86aae18371c02417f0b0 (commit)
       via  0cb1469e2babd1af11d2c290c6dc24c7c313422a (commit)
      from  6dfbd02e6455d25b98672cd366408f8746557fc5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed645b3a720e7d3df63aa39da3883a994e74a298
commit ed645b3a720e7d3df63aa39da3883a994e74a298
Merge: 6dfbd02 76f0fd0
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Tue Nov 3 18:24:13 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 3 18:24:13 2015 -0500

    Merge topic 'cpack-deb-config-file-source-field' into next
    
    76f0fd05 CPackDEB: added config file optional Source field
    0cb1469e CPackDEB: minor documentation and debug logging fixes

diff --cc Tests/CMakeLists.txt
index e13dc79,d42a322..f381758
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@@ -1033,10 -1033,10 +1033,11 @@@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=de
        set(DEB_CONFIGURATIONS_TO_TEST "components-lintian-dpkgdeb-checks"
                                       "components-description1"
                                       "components-description2"
+                                      "components-source"
                                       "components-shlibdeps1"
                                       "components-depend1"
 -                                     "components-depend2")
 +                                     "components-depend2"
 +                                     "compression")
        set(CPackGen "DEB")
        set(CPackRun_CPackGen "-DCPackGen=${CPackGen}")
  

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76f0fd05a5fc25eb8a3c86aae18371c02417f0b0
commit 76f0fd05a5fc25eb8a3c86aae18371c02417f0b0
Author:     Raffi Enficiaud <raffi.enficiaud at mines-paris.org>
AuthorDate: Wed Nov 4 00:19:58 2015 +0100
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Wed Nov 4 00:19:58 2015 +0100

    CPackDEB: added config file optional Source field

diff --git a/Help/release/dev/cpack-deb-config-file-source-field.rst b/Help/release/dev/cpack-deb-config-file-source-field.rst
new file mode 100644
index 0000000..806aeac
--- /dev/null
+++ b/Help/release/dev/cpack-deb-config-file-source-field.rst
@@ -0,0 +1,6 @@
+cpack-deb-config-file-source-field
+----------------------------------
+
+* The :module:`CPackDeb` module learned to set optional config
+  file `Source` field - monolithic and per-component variable.
+  See :variable:`CPACK_DEBIAN_PACKAGE_SOURCE`.
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 84c9243..ba21029 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -354,7 +354,28 @@
 #    set by Debian policy
 #    https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
 #
-
+# .. variable:: CPACK_DEBIAN_PACKAGE_SOURCE
+#               CPACK_DEBIAN_<COMPONENT>_PACKAGE_SOURCE
+#
+#  Sets the `Source` field of the binary Debian package.
+#  When the binary package name is not the same as the source package name
+#  (in particular when several components/binaries are generated from one
+#  source) the source from which the binary has been generated should be
+#  indicated with the field `Source`.
+#
+#  * Mandatory : NO
+#  * Default   :
+#
+#    - An empty string for non-component based installations
+#    - :variable:`CPACK_DEBIAN_PACKAGE_SOURCE` for component-based
+#      installations.
+#
+#  See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
+#
+#  .. note::
+#
+#    This value is not interpreted. It is possible to pass an optional
+#    revision number of the referenced source package as well.
 
 #=============================================================================
 # Copyright 2007-2009 Kitware, Inc.
@@ -554,6 +575,15 @@ function(cpack_deb_prepare_package_vars)
       )
   endif()
 
+  # Source: (optional)
+  # in case several packages are constructed from a unique source
+  # (multipackaging), the source may be indicated as well.
+  # The source might contain a version if the generated package
+  # version is different from the source version
+  if(NOT CPACK_DEBIAN_PACKAGE_SOURCE)
+    set(CPACK_DEBIAN_PACKAGE_SOURCE "")
+  endif()
+
   # have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES),
   # this returns the successful find_package() calls, maybe this can help
   # Depends:
@@ -563,7 +593,7 @@ function(cpack_deb_prepare_package_vars)
   # if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_${dependency_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)
+    foreach(dependency_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE)
       set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${dependency_type_}")
 
       # if set, overrides the global dependency
@@ -681,6 +711,7 @@ function(cpack_deb_prepare_package_vars)
      message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = '${CPACK_PACKAGE_INSTALL_DIRECTORY}'")
      message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = '${CPACK_TEMPORARY_PACKAGE_FILE_NAME}'")
      message("CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION = '${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}'")
+     message("CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_SOURCE       = '${CPACK_DEBIAN_PACKAGE_SOURCE}'")
   endif()
 
   # For debian source packages:
@@ -719,6 +750,8 @@ function(cpack_deb_prepare_package_vars)
   set(GEN_CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA}" PARENT_SCOPE)
   set(GEN_CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION
       "${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}" PARENT_SCOPE)
+  set(GEN_CPACK_DEBIAN_PACKAGE_SOURCE
+     "${CPACK_DEBIAN_PACKAGE_SOURCE}" PARENT_SCOPE)
   set(GEN_WDIR "${WDIR}" PARENT_SCOPE)
 endfunction()
 
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 04efb71..13c8d8f 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -339,6 +339,9 @@ int cmCPackDebGenerator::createDeb()
       this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PROVIDES");
   const char* debian_pkg_replaces =
       this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_REPLACES");
+  const char* debian_pkg_source =
+      this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE");
+
 
     { // the scope is needed for cmGeneratedFileStream
     cmGeneratedFileStream out(ctlfilename.c_str());
@@ -347,6 +350,10 @@ int cmCPackDebGenerator::createDeb()
     out << "Section: " << debian_pkg_section << "\n";
     out << "Priority: " << debian_pkg_priority << "\n";
     out << "Architecture: " << debian_pkg_arch << "\n";
+    if(debian_pkg_source && *debian_pkg_source)
+      {
+      out << "Source: " << debian_pkg_source << "\n";
+      }
     if(debian_pkg_dep && *debian_pkg_dep)
       {
       out << "Depends: " << debian_pkg_dep << "\n";
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index ae61bca..d42a322 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1033,6 +1033,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
       set(DEB_CONFIGURATIONS_TO_TEST "components-lintian-dpkgdeb-checks"
                                      "components-description1"
                                      "components-description2"
+                                     "components-source"
                                      "components-shlibdeps1"
                                      "components-depend1"
                                      "components-depend2")
diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-source.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-source.cmake.in
new file mode 100644
index 0000000..352f10b
--- /dev/null
+++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-source.cmake.in
@@ -0,0 +1,33 @@
+#
+# Activate component packaging
+#
+
+if(CPACK_GENERATOR MATCHES "DEB")
+   set(CPACK_DEB_COMPONENT_INSTALL "ON")
+endif()
+
+#
+# Choose grouping way
+#
+set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
+
+# setting dependencies
+set(CPACK_DEBIAN_PACKAGE_DEPENDS                "depend-default")
+set(CPACK_DEBIAN_HEADERS_PACKAGE_DEPENDS        "depend-headers")
+
+# this time we set shlibdeps to on
+set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+set(CPACK_DEBIAN_HEADERS_PACKAGE_SHLIBDEPS OFF)
+set(CPACK_DEBIAN_LIBRARIES_PACKAGE_SHLIBDEPS OFF)
+
+# we also set the dependencies of APPLICATION component to empty, and let
+# shlibdeps do the job for this component. Otherwise the default will
+# override
+set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_DEPENDS        "")
+
+# this sets the generated packages source to the desired one, in case
+# several packages are generated from a unique source (the case with
+# multicomponents packaging).
+
+set(CPACK_DEBIAN_PACKAGE_SOURCE "test-source")
+set(CPACK_DEBIAN_APPLICATIONS_PACKAGE_SOURCE "test-other-source")
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
new file mode 100644
index 0000000..51fa3ad
--- /dev/null
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
@@ -0,0 +1,75 @@
+if(NOT CPackComponentsDEB_SOURCE_DIR)
+  message(FATAL_ERROR "CPackComponentsDEB_SOURCE_DIR not set")
+endif()
+
+include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
+
+
+# expected results
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/MyLib-*.deb")
+set(expected_count 3)
+
+set(config_verbose -V)
+set(actual_output)
+run_cpack(actual_output
+          CPack_output
+          CPack_error
+          EXPECTED_FILE_MASK "${expected_file_mask}"
+          CONFIG_ARGS ${config_args}
+          CONFIG_VERBOSE ${config_verbose})
+
+
+if(NOT actual_output)
+  message(STATUS "expected_count='${expected_count}'")
+  message(STATUS "expected_file_mask='${expected_file_mask}'")
+  message(STATUS "actual_output_files='${actual_output}'")
+  message(FATAL_ERROR "error: expected_files do not exist: CPackComponentsDEB test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+endif()
+
+list(LENGTH actual_output actual_count)
+if(NOT actual_count EQUAL expected_count)
+  message(STATUS "actual_count='${actual_count}'")
+  message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})")
+endif()
+
+
+# dpkg-deb checks for the summary of the packages
+find_program(DPKGDEB_EXECUTABLE dpkg-deb)
+if(DPKGDEB_EXECUTABLE)
+  set(dpkgdeb_output_errors_all "")
+  foreach(_f IN LISTS actual_output)
+
+    # extracts the metadata from the package
+    run_dpkgdeb(dpkg_output
+                FILENAME "${_f}"
+                )
+
+    dpkgdeb_return_specific_metaentry(dpkg_package_name
+                                      DPKGDEB_OUTPUT "${dpkg_output}"
+                                      METAENTRY "Package:")
+
+    dpkgdeb_return_specific_metaentry(dpkg_package_source
+                                      DPKGDEB_OUTPUT "${dpkg_output}"
+                                      METAENTRY "Source:")
+
+    message(STATUS "package='${_f}', source='${dpkg_package_source}'")
+
+    if(NOT ("${dpkg_package_name}" STREQUAL "mylib-applications"))
+      if(NOT ("${dpkg_package_source}" STREQUAL "test-source"))
+          set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
+                                        "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n")
+      endif()
+    else()
+      if(NOT ("${dpkg_package_source}" STREQUAL "test-other-source"))
+          set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
+                                        "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n")
+      endif()
+    endif()
+  endforeach()
+
+  if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+    message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
+  endif()
+else()
+  message("dpkg-deb executable not found - skipping dpkg-deb test")
+endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0cb1469e2babd1af11d2c290c6dc24c7c313422a
commit 0cb1469e2babd1af11d2c290c6dc24c7c313422a
Author:     Raffi Enficiaud <raffi.enficiaud at mines-paris.org>
AuthorDate: Wed Nov 4 00:16:11 2015 +0100
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Wed Nov 4 00:16:11 2015 +0100

    CPackDEB: minor documentation and debug logging fixes

diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 60e0d1f..84c9243 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -8,7 +8,7 @@
 # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 #
 # CPackDeb may be used to create Deb package using CPack.
-# CPackDeb is a CPack generator thus it uses the CPACK_XXX variables
+# CPackDeb is a CPack generator thus it uses the `CPACK_XXX` variables
 # used by CPack : https://cmake.org/Wiki/CMake:CPackConfiguration.
 # CPackDeb generator should work on any linux host but it will produce
 # better deb package when Debian specific tools 'dpkg-xxx' are usable on
@@ -18,7 +18,7 @@
 # :code:`CPACK_DEBIAN_XXX` variables.
 #
 # :code:`CPACK_DEBIAN_<COMPONENT>_XXXX` variables may be used in order to have
-# **component** specific values.  Note however that <COMPONENT> refers to the
+# **component** specific values.  Note however that `<COMPONENT>` refers to the
 # **grouping name** written in upper case. It may be either a component name or
 # a component GROUP name.
 #
@@ -570,8 +570,8 @@ function(cpack_deb_prepare_package_vars)
       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_}}'")
+          message("CPackDeb Debug: component '${_local_component_name}' ${dependency_type_} "
+            "dependencies set to '${CPACK_DEBIAN_PACKAGE_${dependency_type_}}'")
         endif()
       endif()
     endforeach()
@@ -672,15 +672,15 @@ function(cpack_deb_prepare_package_vars)
 
   # Print out some debug information if we were asked for that
   if(CPACK_DEBIAN_PACKAGE_DEBUG)
-     message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY          = ${CPACK_TOPLEVEL_DIRECTORY}")
-     message("CPackDeb:Debug: CPACK_TOPLEVEL_TAG                = ${CPACK_TOPLEVEL_TAG}")
-     message("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY         = ${CPACK_TEMPORARY_DIRECTORY}")
-     message("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME            = ${CPACK_OUTPUT_FILE_NAME}")
-     message("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH            = ${CPACK_OUTPUT_FILE_PATH}")
-     message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME           = ${CPACK_PACKAGE_FILE_NAME}")
-     message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
-     message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
-     message("CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION = ${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}")
+     message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY          = '${CPACK_TOPLEVEL_DIRECTORY}'")
+     message("CPackDeb:Debug: CPACK_TOPLEVEL_TAG                = '${CPACK_TOPLEVEL_TAG}'")
+     message("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY         = '${CPACK_TEMPORARY_DIRECTORY}'")
+     message("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME            = '${CPACK_OUTPUT_FILE_NAME}'")
+     message("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH            = '${CPACK_OUTPUT_FILE_PATH}'")
+     message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME           = '${CPACK_PACKAGE_FILE_NAME}'")
+     message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY   = '${CPACK_PACKAGE_INSTALL_DIRECTORY}'")
+     message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = '${CPACK_TEMPORARY_PACKAGE_FILE_NAME}'")
+     message("CPackDeb:Debug: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION = '${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}'")
   endif()
 
   # For debian source packages:

-----------------------------------------------------------------------

Summary of changes:
 .../dev/cpack-deb-config-file-source-field.rst     |    6 ++
 Modules/CPackDeb.cmake                             |   63 +++++++++++++++-----
 Source/CPack/cmCPackDebGenerator.cxx               |    7 +++
 Tests/CMakeLists.txt                               |    1 +
 ...=> MyLibCPackConfig-components-source.cmake.in} |   10 +++-
 ...> RunCPackVerifyResult-components-source.cmake} |   36 ++++-------
 6 files changed, 82 insertions(+), 41 deletions(-)
 create mode 100644 Help/release/dev/cpack-deb-config-file-source-field.rst
 copy Tests/CPackComponentsDEB/{MyLibCPackConfig-components-depend2.cmake.in => MyLibCPackConfig-components-source.cmake.in} (71%)
 copy Tests/CPackComponentsDEB/{RunCPackVerifyResult-components-depend1.cmake => RunCPackVerifyResult-components-source.cmake} (58%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list