[Cmake-commits] CMake branch, next, updated. v3.2.0-rc1-625-g253d609

Brad King brad.king at kitware.com
Mon Feb 23 10:58:16 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  253d6095f73a8d42101e9e2c197b341bec57ab0c (commit)
       via  f174b919d65d8aefbe8dec26e2b31c7525805f8d (commit)
       via  3aa9f89dbb88d957a662effdbc284c95aef1a8a9 (commit)
       via  761562fea6a987bb898f5a349993cf5765dedbea (commit)
      from  c3f41d07ce79d23e4bdc79b74fb13463a4241c79 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=253d6095f73a8d42101e9e2c197b341bec57ab0c
commit 253d6095f73a8d42101e9e2c197b341bec57ab0c
Merge: c3f41d0 f174b91
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Feb 23 10:58:15 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Feb 23 10:58:15 2015 -0500

    Merge topic 'rpm_package_architecture' into next
    
    f174b919 Tests: CpackRPM test component architecture
    3aa9f89d CPackRPM: Support rpm architecture in components
    761562fe CPackRPM: Fix CPACK_RPM_PACKAGE_ARCHITECTURE


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f174b919d65d8aefbe8dec26e2b31c7525805f8d
commit f174b919d65d8aefbe8dec26e2b31c7525805f8d
Author:     Joshua A Clayton <stillcompiling at gmail.com>
AuthorDate: Thu Feb 19 00:01:16 2015 -0800
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 23 10:48:36 2015 -0500

    Tests: CpackRPM test component architecture
    
    Test creating rpms of type "noarch", native, and "armv7hf"

diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
index de0ee46..4119b8d 100644
--- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in
@@ -11,6 +11,12 @@ if(CPACK_GENERATOR MATCHES "RPM")
   set(CPACK_RPM_COMPONENT_INSTALL "ON")
   set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries")
 
+  # test a "noarch" rpm
+  set(CPACK_RPM_headers_PACKAGE_ARCHITECTURE "noarch")
+
+  # test cross-built rpm
+  set(CPACK_RPM_applications_PACKAGE_ARCHITECTURE "armv7hf")
+
   # test package summary override
   set(CPACK_RPM_PACKAGE_SUMMARY "default summary")
   set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary")
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 68d846f..5be9d17 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -161,21 +161,25 @@ if(CPackGen MATCHES "RPM")
         set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*")
         set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*")
         set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+        set(check_file_match_expected_architecture "Architecture: ${CPACK_RPM_applications_PACKAGE_ARCHITECTURE}")
         set(spec_regex "*libraries*")
       elseif(check_file_headers_match)
         set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
         set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*")
         set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
+        set(check_file_match_expected_architecture "Architecture: ${CPACK_RPM_libraries_PACKAGE_ARCHITECTURE}")
         set(spec_regex "*headers*")
       elseif(check_file_applications_match)
         set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
         set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*")
         set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
+        set(check_file_match_expected_architecture "Architecture: ${CPACK_RPM_headers_PACKAGE_ARCHITECTURE}")
         set(spec_regex "*applications*")
       elseif(check_file_Unspecified_match)
         set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*")
         set(check_file_match_expected_description ".*DESCRIPTION.*")
         set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
+        set(check_file_match_expected_architecture "Architecture: ${CPACK_RPM_Unspecified_PACKAGE_ARCHITECTURE}")
         set(spec_regex "*Unspecified*")
       else()
         message(FATAL_ERROR "error: unexpected rpm package '${check_file}'")
@@ -204,6 +208,10 @@ if(CPackGen MATCHES "RPM")
 
         message(FATAL_ERROR "error: '${check_file}' rpm package relocation path does not match expected value - regex '${check_file_match_expected_relocation_path}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'")
       endif()
+      string(REGEX MATCH ${check_file_match_expected_architecture} check_file_match_architecture ${check_file_content})
+      if (NOT check_file_match_architecture)
+          message(FATAL_ERROR "error: '${check_file}' Architecture does not match expected value - '${check_file_match_expected_architecture}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'")
+      endif()
     endforeach()
   elseif(${CPackComponentWay} STREQUAL "IgnoreGroup")
   endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3aa9f89dbb88d957a662effdbc284c95aef1a8a9
commit 3aa9f89dbb88d957a662effdbc284c95aef1a8a9
Author:     Joshua A Clayton <stillcompiling at gmail.com>
AuthorDate: Thu Feb 19 00:01:15 2015 -0800
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 23 10:48:27 2015 -0500

    CPackRPM: Support rpm architecture in components
    
    CPACK_RPM_<component>_PACKAGE_ARCHITECTURE variable allows
    the same project to support packages of different architectures
    including noarch, native and foreign architectures.

diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 932e174..6ce18bf 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -51,6 +51,7 @@
 #  * Default   : CPACK_PACKAGE_VERSION
 #
 # .. variable:: CPACK_RPM_PACKAGE_ARCHITECTURE
+#               CPACK_RPM_<component>_PACKAGE_ARCHITECTURE
 #
 #  The RPM package architecture.
 #
@@ -631,6 +632,16 @@ else()
 endif()
 
 set(_CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE})
+
+#prefer component architecture
+if(CPACK_RPM_PACKAGE_COMPONENT)
+  if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_ARCHITECTURE)
+    set(_CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_ARCHITECTURE})
+    if(CPACK_RPM_PACKAGE_DEBUG)
+      message("CPackRPM:Debug: using component build arch = ${_CPACK_RPM_PACKAGE_ARCHITECTURE}")
+    endif()
+  endif()
+endif()
 if(${_CPACK_RPM_PACKAGE_ARCHITECTURE} STREQUAL "noarch")
   set(TMP_RPM_BUILDARCH "Buildarch: ${_CPACK_RPM_PACKAGE_ARCHITECTURE}")
 else()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=761562fea6a987bb898f5a349993cf5765dedbea
commit 761562fea6a987bb898f5a349993cf5765dedbea
Author:     Joshua A Clayton <stillcompiling at gmail.com>
AuthorDate: Thu Feb 19 00:01:14 2015 -0800
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 23 10:48:10 2015 -0500

    CPackRPM: Fix CPACK_RPM_PACKAGE_ARCHITECTURE
    
    BuildArch must only be added to a spec file for a "noarch" package or
    rpmbuild will fail.  For all others, the --target argument sets the
    package architecture.  In the process of Fixing rpm architecture, we
    make it mandatory, adding a default value of native architecture (the
    same as if no --target argument is present).  Update the documentation
    at the top of the file to make it mandatory.

diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 7516393..932e174 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -54,8 +54,8 @@
 #
 #  The RPM package architecture.
 #
-#  * Mandatory : NO
-#  * Default   : -
+#  * Mandatory : YES
+#  * Default   : Native architecture output by "uname -m"
 #
 #  This may be set to "noarch" if you know you are building a noarch package.
 #
@@ -619,12 +619,20 @@ endif()
 # RPM "Version" from RPM "Release"
 string(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})
 
-# CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
-if(CPACK_RPM_PACKAGE_ARCHITECTURE)
-  set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
+# CPACK_RPM_PACKAGE_ARCHITECTURE (mandatory)
+if(NOT CPACK_RPM_PACKAGE_ARCHITECTURE)
+  execute_process(COMMAND uname "-m"
+                  OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
+                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+else()
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
   endif()
+endif()
+
+set(_CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE})
+if(${_CPACK_RPM_PACKAGE_ARCHITECTURE} STREQUAL "noarch")
+  set(TMP_RPM_BUILDARCH "Buildarch: ${_CPACK_RPM_PACKAGE_ARCHITECTURE}")
 else()
   set(TMP_RPM_BUILDARCH "")
 endif()
@@ -934,7 +942,7 @@ file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
 file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
 file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
 
-#set(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
+#set(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${_CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
 set(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
 # it seems rpmbuild can't handle spaces in the path
 # neither escaping (as below) nor putting quotes around the path seem to help
@@ -1282,6 +1290,7 @@ if(RPMBUILD_EXECUTABLE)
     COMMAND "${RPMBUILD_EXECUTABLE}" -bb
             --define "_topdir ${CPACK_RPM_DIRECTORY}"
             --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
+            --target "${_CPACK_RPM_PACKAGE_ARCHITECTURE}"
             "${CPACK_RPM_BINARY_SPECFILE}"
     WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
     RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list