[cmake-developers] [CMake 0014714]: CPack doesn't allow to create RPM with other user/group than root/root

Mantis Bug Tracker mantis at public.kitware.com
Tue Jan 21 04:16:13 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14714 
====================================================================== 
Reported By:                Frank-Christian Otto
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14714
Category:                   CPack
Reproducibility:            N/A
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-01-21 04:16 EST
Last Modified:              2014-01-21 04:16 EST
====================================================================== 
Summary:                    CPack doesn't allow to create RPM with other
user/group than root/root
Description: 
In my local version I added a new CPack variable to be used like this in
CMakeLists.txt:

set(CPACK_RPM_FILES_DEFATTR "(0644,myuser,mygroup,0755)") 

if not set the default setting (-,root,root,-) will be applied (as before).

Suggested Patch for Modules/CPackRPM.cmake attached below

Steps to Reproduce: 
--- CPackRPM.cmake	2014-01-20 13:26:36.578308592 +0100
+++ CPackRPM.cmake~	2013-11-05 20:07:22.000000000 +0100
@@ -207,12 +207,6 @@
 #      rpm -qp --scripts  package.rpm
 ##end
 ##variable
-#  CPACK_RPM_FILES_DEFATTR
-#     Mandatory : NO
-#     Default   : (-,root,root,-)
-#     May be used to provide specific %defattr() settings to the generated spec
file
-##end
-##variable
 #  CPACK_RPM_USER_FILELIST
 #  CPACK_RPM_<COMPONENT>_USER_FILELIST
 #     Mandatory : NO
@@ -898,11 +892,6 @@
   set(CPACK_RPM_USER_BINARY_SPECFILE
${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_USER_BINARY_SPECFILE})
 endif()

-# Set %defattr(-,root,root,-) unless there is a user provided string
-if(NOT CPACK_RPM_FILES_DEFATTR)
-	set(CPACK_RPM_FILES_DEFATTR "(-,root,root,-)")
-endif()
-
 # We should generate a USER spec file template:
 #  - either because the user asked for it :
CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
 #  - or the user did not provide one : NOT CPACK_RPM_USER_BINARY_SPECFILE
@@ -970,7 +959,7 @@
 \@CPACK_RPM_SPEC_PREUNINSTALL\@

 %files
-%defattr${CPACK_RPM_FILES_DEFATTR}
+%defattr(-,root,root,-)
 \@CPACK_RPM_INSTALL_FILES\@
 \@CPACK_RPM_ABSOLUTE_INSTALL_FILES\@
 \@CPACK_RPM_USER_INSTALL_FILES\@
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-01-21 04:16 Frank-Christian OttoNew Issue                                  
 
======================================================================



More information about the cmake-developers mailing list