View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014714CMakeCPackpublic2014-01-21 04:162016-06-10 14:21
ReporterFrank-Christian Otto 
Assigned ToDomen Vrankar 
PrioritynormalSeverityminorReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.12.1 
Target VersionFixed in VersionCMake 3.6 
Summary0014714: CPack doesn't allow to create RPM with other user/group than root/root
DescriptionIn 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\@
TagsNo tags attached.
Attached Filestxt file icon patch.txt [^] (1,212 bytes) 2014-01-21 11:52 [Show Content]

 Relationships
related to 0003602closedBrad King Add possibility to change file owner into install macro 

  Notes
(0034983)
Frank-Christian Otto (reporter)
2014-01-21 11:54

I create the patch the wrong way. (so the '-' and '+' markers must be exchanged).
corrected patch now attached as file
(0037706)
Brad King (manager)
2015-01-15 15:04

Relevant mailing list thread:

 [PATCH] Setting default user, group and permissions for CPackRPM
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/12089 [^]
(0040783)
Domen Vrankar (developer)
2016-03-31 13:26

Implemented with patch:
https://cmake.org/gitweb?p=cmake.git;a=commit;h=1fe004e [^]

This patch is for setting of default user, group and file/directory permissions as requested in report - the requirement that I came across most of the time. I'll open a new feature request for the per file/directory permissions setting.
(0041208)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-01-21 04:16 Frank-Christian Otto New Issue
2014-01-21 11:52 Frank-Christian Otto File Added: patch.txt
2014-01-21 11:54 Frank-Christian Otto Note Added: 0034983
2015-01-07 16:01 Domen Vrankar Assigned To => Domen Vrankar
2015-01-07 16:01 Domen Vrankar Status new => assigned
2015-01-15 14:56 Brad King Relationship added related to 0003602
2015-01-15 15:04 Brad King Note Added: 0037706
2016-03-31 13:26 Domen Vrankar Note Added: 0040783
2016-03-31 13:26 Domen Vrankar Status assigned => resolved
2016-03-31 13:26 Domen Vrankar Fixed in Version => CMake 3.6
2016-03-31 13:26 Domen Vrankar Resolution open => fixed
2016-06-10 14:21 Kitware Robot Note Added: 0041208
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team