[Cmake-commits] CMake branch, next, updated. v3.2.2-1942-gfce1705

Domen Vrankar domen.vrankar at gmail.com
Sun Apr 19 12:25:56 EDT 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  fce1705922137efa9bf3ab5b6dc68ee5c1420cf8 (commit)
       via  76080c32e167b2eadf4305fb3af56ba1c7503c44 (commit)
       via  152e9b3250d2b75d91b1058e01dfc4b46bb486cd (commit)
       via  4c00a372893e4aa8aa4a5a66573175af9122b508 (commit)
      from  c753650a464694b3e11f6bd59bf63dbd6fb2f4de (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=fce1705922137efa9bf3ab5b6dc68ee5c1420cf8
commit fce1705922137efa9bf3ab5b6dc68ee5c1420cf8
Merge: c753650 76080c3
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Sun Apr 19 12:25:55 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Apr 19 12:25:55 2015 -0400

    Merge topic 'cpack-rpm-refactored-file-listing' into next
    
    76080c32 CPackRPM content listing refactor
    152e9b32 CPackRPM package content list code move
    4c00a372 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76080c32e167b2eadf4305fb3af56ba1c7503c44
commit 76080c32e167b2eadf4305fb3af56ba1c7503c44
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Sun Apr 19 18:22:18 2015 +0200
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Sun Apr 19 18:22:18 2015 +0200

    CPackRPM content listing refactor
    
    Refactoring of content list that removes
    use of find and sed to make listing algorithm
    more clear and remove external dependencies.
    Patch also limits man pages handling to
    locations listed in brp-compress rpm script
    by default - fixes bug report #14660.

diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index c283d23..fdba90e 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -419,6 +419,33 @@
 #  May be used to remove CPACK_PACKAGING_INSTALL_PREFIX and CPACK_RPM_<COMPONENT>_PACKAGE_PREFIX
 #  from relocatable RPM prefix paths.
 #
+# .. variable:: CPACK_RPM_ADDITIONAL_MAN_DIRS
+#
+#  * Mandatory : NO
+#  * Default   : -
+#
+#  May be used to set additional man dirs that could potentially be compressed
+#  by brp-compress RPM macro. Variable content must be a list of regular
+#  expressions that point to directories containing man files or to man files
+#  directly. Note that in order to compress man pages a path must also be
+#  present in brp-compress RPM script and that brp-compress script must be
+#  added to RPM configuration by the operating system.
+#
+#  Regular expressions that are added by default were taken from brp-compress
+#  RPM macro:
+#
+#  - /usr/man/man.*
+#  - /usr/man/.*/man.*
+#  - /usr/info.*
+#  - /usr/share/man/man.*
+#  - /usr/share/man/.*/man.*
+#  - /usr/share/info.*
+#  - /usr/kerberos/man.*
+#  - /usr/X11R6/man/man.*
+#  - /usr/lib/perl5/man/man.*
+#  - /usr/share/doc/.*/man/man.*
+#  - /usr/lib/.*/man/man.*
+#
 # Packaging of Symbolic Links
 # ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 #
@@ -539,6 +566,14 @@ function(cpack_rpm_prepare_relocation_paths)
 endfunction()
 
 function(cpack_rpm_prepare_content_list)
+  # get files list
+  cmake_policy(PUSH)
+    cmake_policy(SET CMP0009 NEW)
+    file(GLOB_RECURSE CPACK_RPM_INSTALL_FILES LIST_DIRECTORIES true RELATIVE "${WDIR}" "${WDIR}/*")
+  cmake_policy(POP)
+  set(CPACK_RPM_INSTALL_FILES "/${CPACK_RPM_INSTALL_FILES}")
+  string(REPLACE ";" ";/" CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}")
+
   # if we are creating a relocatable package, omit parent directories of
   # CPACK_RPM_PACKAGE_PREFIX. This is achieved by building a "filter list"
   # which is passed to the find command that generates the content-list
@@ -547,26 +582,21 @@ function(cpack_rpm_prepare_content_list)
     # destinct parent paths of other relocation paths and remove the
     # final element (so the install-prefix dir itself is not omitted
     # from the RPM's content-list)
-    set(SORTED_RPM_USED_PACKAGE_PREFIXES "${RPM_USED_PACKAGE_PREFIXES}")
-    list(SORT SORTED_RPM_USED_PACKAGE_PREFIXES)
+    list(SORT RPM_USED_PACKAGE_PREFIXES)
     set(_DISTINCT_PATH "NOT_SET")
-    foreach(_RPM_RELOCATION_PREFIX ${SORTED_RPM_USED_PACKAGE_PREFIXES})
+    foreach(_RPM_RELOCATION_PREFIX ${RPM_USED_PACKAGE_PREFIXES})
       if(NOT "${_RPM_RELOCATION_PREFIX}" MATCHES "${_DISTINCT_PATH}/.*")
         set(_DISTINCT_PATH "${_RPM_RELOCATION_PREFIX}")
 
-        string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${_RPM_RELOCATION_PREFIX}")
+        string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS " ${_RPM_RELOCATION_PREFIX}")
         list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1)
         unset(_TMP_LIST)
         # Now generate all of the parent dirs of the relocation path
         foreach(_PREFIX_PATH_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS})
           list(APPEND _TMP_LIST "${_PREFIX_PATH_ELEM}")
           string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}")
-          list(FIND _RPM_DIRS_TO_OMIT "${_OMIT_DIR}" _DUPLICATE_FOUND)
-          if(_DUPLICATE_FOUND EQUAL -1)
-            set(_OMIT_DIR "-o -path ${_OMIT_DIR}")
-            separate_arguments(_OMIT_DIR)
-            list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR})
-          endif()
+          separate_arguments(_OMIT_DIR)
+          list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR})
         endforeach()
       endif()
     endforeach()
@@ -576,40 +606,62 @@ function(cpack_rpm_prepare_content_list)
     message("CPackRPM:Debug: Initial list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}")
   endif()
 
-  if (NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
+  if(NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
     set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include)
-    if (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION)
+    if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION)
       message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.")
       list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST "${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION}")
     endif()
   endif()
 
   if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
-    if (CPACK_RPM_PACKAGE_DEBUG)
+    if(CPACK_RPM_PACKAGE_DEBUG)
       message("CPackRPM:Debug: CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST= ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST}")
     endif()
-    foreach(_DIR ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST})
-      list(APPEND _RPM_DIRS_TO_OMIT "-o;-path;.${_DIR}")
-    endforeach()
+    list(APPEND _RPM_DIRS_TO_OMIT ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST})
   endif()
 
   if(CPACK_RPM_PACKAGE_DEBUG)
     message("CPackRPM:Debug: Final list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}")
   endif()
 
-  # Use files tree to construct files command (spec file)
-  # We should not forget to include symlinks (thus -o -type l)
-  # We should include directory as well (thus -type d)
-  #   but not the main local dir "." (thus -a -not -name ".")
-  # We must remove the './' due to the local search and escape the
-  # file name by enclosing it between double quotes (thus the sed)
-  # Then we must authorize any man pages extension (adding * at the end)
-  # because rpmbuild may automatically compress those files
-  execute_process(COMMAND find . -type f -o -type l -o (-type d -a -not ( -name "." ${_RPM_DIRS_TO_OMIT} ) )
-                  COMMAND sed s:.*/man.*/.*:&*:
-                  COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
-                  WORKING_DIRECTORY "${WDIR}"
-                  OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
+  list(REMOVE_ITEM CPACK_RPM_INSTALL_FILES ${_RPM_DIRS_TO_OMIT})
+
+  # add man paths that will be compressed
+  # (copied from /usr/lib/rpm/brp-compress - script that does the actual
+  # compressing)
+  list(APPEND MAN_LOCATIONS "/usr/man/man.*" "/usr/man/.*/man.*" "/usr/info.*"
+    "/usr/share/man/man.*" "/usr/share/man/.*/man.*" "/usr/share/info.*"
+    "/usr/kerberos/man.*" "/usr/X11R6/man/man.*" "/usr/lib/perl5/man/man.*"
+    "/usr/share/doc/.*/man/man.*" "/usr/lib/.*/man/man.*")
+
+  if(CPACK_RPM_ADDITIONAL_MAN_DIRS)
+    if(CPACK_RPM_PACKAGE_DEBUG)
+      message("CPackRPM:Debug: CPACK_RPM_ADDITIONAL_MAN_DIRS= ${CPACK_RPM_ADDITIONAL_MAN_DIRS}")
+    endif()
+    list(APPEND MAN_LOCATIONS ${CPACK_RPM_ADDITIONAL_MAN_DIRS})
+  endif()
+
+  foreach(PACK_LOCATION IN LISTS CPACK_RPM_INSTALL_FILES)
+    foreach(MAN_LOCATION IN LISTS MAN_LOCATIONS)
+      # man pages are files inside a certain location
+      if(PACK_LOCATION MATCHES "${MAN_LOCATION}/"
+        AND NOT IS_DIRECTORY "${WDIR}${PACK_LOCATION}"
+        AND NOT IS_SYMLINK "${WDIR}${PACK_LOCATION}")
+        list(FIND CPACK_RPM_INSTALL_FILES "${PACK_LOCATION}" INDEX)
+        # insert file location that covers compressed man pages
+        # even if using a wildcard causes duplicates as those are
+        # handled by RPM and we still keep the same file list
+        # in spec file - wildcard only represents file type (e.g. .gz)
+        list(INSERT CPACK_RPM_INSTALL_FILES ${INDEX} "${PACK_LOCATION}*")
+        # remove file location that doesn't cover compressed man pages
+        math(EXPR INDEX ${INDEX}+1)
+        list(REMOVE_AT CPACK_RPM_INSTALL_FILES ${INDEX})
+
+        break()
+      endif()
+    endforeach()
+  endforeach()
 
   set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}" PARENT_SCOPE)
 endfunction()
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index 1cc34b0..823f6db 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -50,6 +50,13 @@ install(FILES mylib.h
   COMPONENT headers)
 
 if("${CPACK_GENERATOR}" MATCHES "RPM")
+  ############## test man pages
+  install(FILES mylib
+    DESTINATION share/man/mylib/man3/mylib.1)
+  install(FILES mylib
+    DESTINATION share/man/mylib/man3/mylib.1 RENAME mylib2)
+
+  ############## test symlinks
   # Package symbolic links
   install(DIRECTORY DESTINATION ${CMAKE_INSTALL_LIBDIR}/inside_relocatable_one/depth_two/depth_three COMPONENT libraries)
   install(DIRECTORY DESTINATION ${CMAKE_INSTALL_LIBDIR}/inside_relocatable_two/depth_two/different_relocatable/bar COMPONENT libraries)
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index e747052..d94a477 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -233,7 +233,14 @@ if(CPackGen MATCHES "RPM")
 /usr/foo/bar/bin/@in at _@path@@with/@and
 /usr/foo/bar/bin/@in at _@path@@with/@and/@
 /usr/foo/bar/bin/@in at _@path@@with/@and/@/@in_path@
-/usr/foo/bar/bin/@in at _@path@@with/@and/@/@in_path@/mylibapp2$")
+/usr/foo/bar/bin/@in at _@path@@with/@and/@/@in_path@/mylibapp2
+/usr/foo/bar/share
+/usr/foo/bar/share/man
+/usr/foo/bar/share/man/mylib
+/usr/foo/bar/share/man/mylib/man3
+/usr/foo/bar/share/man/mylib/man3/mylib.1
+/usr/foo/bar/share/man/mylib/man3/mylib.1/mylib
+/usr/foo/bar/share/man/mylib/man3/mylib.1/mylib2$")
       else()
         message(FATAL_ERROR "error: unexpected rpm package '${check_file}'")
       endif()
diff --git a/Tests/CPackComponentsForAll/mylib b/Tests/CPackComponentsForAll/mylib
new file mode 100644
index 0000000..e3bd05c
--- /dev/null
+++ b/Tests/CPackComponentsForAll/mylib
@@ -0,0 +1,17 @@
+.\" Manpage for mylib.
+.\" Contact bugs at mylib_author.net.in to correct errors or typos.
+.TH mylib 3 "01 May 2015" "1.0" "mylib.so man page"
+.SH NAME
+mylib \- cpack testing lib
+.SH SYNOPSIS
+mylib.so
+.SH DESCRIPTION
+mylib.so test man page.
+.SH OPTIONS
+Lib does not take any options.
+.SH SEE ALSO
+mylib(3)
+.SH BUGS
+No known bugs.
+.SH AUTHOR
+Someone (author at lib_author.net.in)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=152e9b3250d2b75d91b1058e01dfc4b46bb486cd
commit 152e9b3250d2b75d91b1058e01dfc4b46bb486cd
Author:     Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Sun Apr 12 20:50:05 2015 +0200
Commit:     Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Sun Apr 19 17:01:20 2015 +0200

    CPackRPM package content list code move
    
    Move rpm package content list code to
    a separate function.

diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index b8d518c..c283d23 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -538,6 +538,82 @@ function(cpack_rpm_prepare_relocation_paths)
   set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}" PARENT_SCOPE)
 endfunction()
 
+function(cpack_rpm_prepare_content_list)
+  # if we are creating a relocatable package, omit parent directories of
+  # CPACK_RPM_PACKAGE_PREFIX. This is achieved by building a "filter list"
+  # which is passed to the find command that generates the content-list
+  if(CPACK_RPM_PACKAGE_RELOCATABLE)
+    # get a list of the elements in CPACK_RPM_PACKAGE_PREFIXES that are
+    # destinct parent paths of other relocation paths and remove the
+    # final element (so the install-prefix dir itself is not omitted
+    # from the RPM's content-list)
+    set(SORTED_RPM_USED_PACKAGE_PREFIXES "${RPM_USED_PACKAGE_PREFIXES}")
+    list(SORT SORTED_RPM_USED_PACKAGE_PREFIXES)
+    set(_DISTINCT_PATH "NOT_SET")
+    foreach(_RPM_RELOCATION_PREFIX ${SORTED_RPM_USED_PACKAGE_PREFIXES})
+      if(NOT "${_RPM_RELOCATION_PREFIX}" MATCHES "${_DISTINCT_PATH}/.*")
+        set(_DISTINCT_PATH "${_RPM_RELOCATION_PREFIX}")
+
+        string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${_RPM_RELOCATION_PREFIX}")
+        list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1)
+        unset(_TMP_LIST)
+        # Now generate all of the parent dirs of the relocation path
+        foreach(_PREFIX_PATH_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS})
+          list(APPEND _TMP_LIST "${_PREFIX_PATH_ELEM}")
+          string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}")
+          list(FIND _RPM_DIRS_TO_OMIT "${_OMIT_DIR}" _DUPLICATE_FOUND)
+          if(_DUPLICATE_FOUND EQUAL -1)
+            set(_OMIT_DIR "-o -path ${_OMIT_DIR}")
+            separate_arguments(_OMIT_DIR)
+            list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR})
+          endif()
+        endforeach()
+      endif()
+    endforeach()
+  endif()
+
+  if(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: Initial list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}")
+  endif()
+
+  if (NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
+    set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include)
+    if (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION)
+      message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.")
+      list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST "${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION}")
+    endif()
+  endif()
+
+  if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
+    if (CPACK_RPM_PACKAGE_DEBUG)
+      message("CPackRPM:Debug: CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST= ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST}")
+    endif()
+    foreach(_DIR ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST})
+      list(APPEND _RPM_DIRS_TO_OMIT "-o;-path;.${_DIR}")
+    endforeach()
+  endif()
+
+  if(CPACK_RPM_PACKAGE_DEBUG)
+    message("CPackRPM:Debug: Final list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}")
+  endif()
+
+  # Use files tree to construct files command (spec file)
+  # We should not forget to include symlinks (thus -o -type l)
+  # We should include directory as well (thus -type d)
+  #   but not the main local dir "." (thus -a -not -name ".")
+  # We must remove the './' due to the local search and escape the
+  # file name by enclosing it between double quotes (thus the sed)
+  # Then we must authorize any man pages extension (adding * at the end)
+  # because rpmbuild may automatically compress those files
+  execute_process(COMMAND find . -type f -o -type l -o (-type d -a -not ( -name "." ${_RPM_DIRS_TO_OMIT} ) )
+                  COMMAND sed s:.*/man.*/.*:&*:
+                  COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
+                  WORKING_DIRECTORY "${WDIR}"
+                  OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
+
+  set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}" PARENT_SCOPE)
+endfunction()
+
 function(cpack_rpm_symlink_get_relocation_prefixes LOCATION PACKAGE_PREFIXES RETURN_VARIABLE)
   foreach(PKG_PREFIX IN LISTS PACKAGE_PREFIXES)
     string(REGEX MATCH "^${PKG_PREFIX}/.*" FOUND_ "${LOCATION}")
@@ -1285,76 +1361,7 @@ function(cpack_rpm_generate_package)
   #string(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
   set(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
 
-  # if we are creating a relocatable package, omit parent directories of
-  # CPACK_RPM_PACKAGE_PREFIX. This is achieved by building a "filter list"
-  # which is passed to the find command that generates the content-list
-  if(CPACK_RPM_PACKAGE_RELOCATABLE)
-    # get a list of the elements in CPACK_RPM_PACKAGE_PREFIXES that are
-    # destinct parent paths of other relocation paths and remove the
-    # final element (so the install-prefix dir itself is not omitted
-    # from the RPM's content-list)
-    set(SORTED_RPM_USED_PACKAGE_PREFIXES "${RPM_USED_PACKAGE_PREFIXES}")
-    list(SORT SORTED_RPM_USED_PACKAGE_PREFIXES)
-    set(_DISTINCT_PATH "NOT_SET")
-    foreach(_RPM_RELOCATION_PREFIX ${SORTED_RPM_USED_PACKAGE_PREFIXES})
-      if(NOT "${_RPM_RELOCATION_PREFIX}" MATCHES "${_DISTINCT_PATH}/.*")
-        set(_DISTINCT_PATH "${_RPM_RELOCATION_PREFIX}")
-
-        string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${_RPM_RELOCATION_PREFIX}")
-        list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1)
-        unset(_TMP_LIST)
-        # Now generate all of the parent dirs of the relocation path
-        foreach(_PREFIX_PATH_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS})
-          list(APPEND _TMP_LIST "${_PREFIX_PATH_ELEM}")
-          string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}")
-          list(FIND _RPM_DIRS_TO_OMIT "${_OMIT_DIR}" _DUPLICATE_FOUND)
-          if(_DUPLICATE_FOUND EQUAL -1)
-            set(_OMIT_DIR "-o -path ${_OMIT_DIR}")
-            separate_arguments(_OMIT_DIR)
-            list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR})
-          endif()
-        endforeach()
-      endif()
-    endforeach()
-  endif()
-
-  if (CPACK_RPM_PACKAGE_DEBUG)
-     message("CPackRPM:Debug: Initial list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}")
-  endif()
-
-  if (NOT DEFINED CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
-    set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include)
-    if (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION)
-      message("CPackRPM:Debug: Adding ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION} to builtin omit list.")
-      list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST "${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION}")
-    endif()
-  endif()
-
-  if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
-    if (CPACK_RPM_PACKAGE_DEBUG)
-     message("CPackRPM:Debug: CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST= ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST}")
-   endif()
-    foreach(_DIR ${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST})
-      list(APPEND _RPM_DIRS_TO_OMIT "-o;-path;.${_DIR}")
-    endforeach()
-  endif()
-  if (CPACK_RPM_PACKAGE_DEBUG)
-     message("CPackRPM:Debug: Final list of path to OMIT in RPM: ${_RPM_DIRS_TO_OMIT}")
-  endif()
-
-  # Use files tree to construct files command (spec file)
-  # We should not forget to include symlinks (thus -o -type l)
-  # We should include directory as well (thus -type d)
-  #   but not the main local dir "." (thus -a -not -name ".")
-  # We must remove the './' due to the local search and escape the
-  # file name by enclosing it between double quotes (thus the sed)
-  # Then we must authorize any man pages extension (adding * at the end)
-  # because rpmbuild may automatically compress those files
-  execute_process(COMMAND find . -type f -o -type l -o (-type d -a -not ( -name "." ${_RPM_DIRS_TO_OMIT} ) )
-                  COMMAND sed s:.*/man.*/.*:&*:
-                  COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
-                  WORKING_DIRECTORY "${WDIR}"
-                  OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
+  cpack_rpm_prepare_content_list()
 
   # In component case, put CPACK_ABSOLUTE_DESTINATION_FILES_<COMPONENT>
   #                   into CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL

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

Summary of changes:
 Modules/CPackRPM.cmake                             |  199 +++++++++++++-------
 Source/CMakeVersion.cmake                          |    2 +-
 Tests/CPackComponentsForAll/CMakeLists.txt         |    7 +
 .../RunCPackVerifyResult.cmake                     |    9 +-
 Tests/CPackComponentsForAll/mylib                  |   17 ++
 5 files changed, 162 insertions(+), 72 deletions(-)
 create mode 100644 Tests/CPackComponentsForAll/mylib


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list