View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010325CMakeCPackpublic2010-02-23 09:392015-08-25 09:46
ReporterArthur Gautier 
Assigned ToEric NOULARD 
PrioritynormalSeveritytweakReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionCMake 2.8.6Fixed in VersionCMake 2.8.6 
Summary0010325: DEB packaging Set files ownership
DescriptionHi there,
it's not possible for now to set uid nor gid for files added to a debian package.

If i build a package as a normal user, all files added to the .deb get my uid and gid by default. This could be solved by changing the ownership of files when compressing data.tgz file.

Like this in the Source/CPack/cmCPackDebGenerator.cxx file (approx line 133) :
cmd += "\" -E tar --group=root --owner=root cfz data.tar.gz ";

This should be for example possible to set ownership with a var like CPACK_DEBIAN_PACKAGE_OWNER and CPACK_DEBIAN_PACKAGE_GROUP.



This should do the job :)

on a second time it may be possible to add per-file ownership in adding a option to the install function.
We then could "append" other files with their own permission to the tar with :
tar --owner=other-user --group=other-group -azf data.tar.gz the file


Thanks :)

TagsNo tags attached.
Attached Filespatch file icon 0001-CPackDeb-fix-10325-automagically-use-fakeroot-for-DE.patch [^] (1,588 bytes) 2011-09-05 16:46 [Show Content]

 Relationships
parent of 0013118closedEric NOULARD CPack DEB generator does not use fakeroot for control.tar.gz 
related to 0012901closedKitware Robot CPack should be able to set owner of files in the archive 
related to 0012531closedKitware Robot Lintain failures due to permission issues with pre/post install/remove scripts. 
related to 0013700closedRaffi Enficiaud CPack fails from fakeroot 

  Notes
(0024193)
Eric NOULARD (developer)
2010-12-15 16:37

Hi Arthur,

Would you be able to propose a patch against 2.8.3 (or master) for that?

Concerning the root/root case did you try using fakeroot ?

Why would you need a per-file ownership?
(0024194)
Eric NOULARD (developer)
2010-12-15 16:38

I need feedback from the reporter before trying to handle this one.
(0024868)
David Cole (manager)
2011-01-18 11:27

Arthur,

Can you provide Eric with feedback on this, so he can make progress on this issue...?

Thanks.
(0024900)
Eric NOULARD (developer)
2011-01-18 17:31

see related thread on the ML:
http://www.cmake.org/pipermail/cmake/2011-January/041820.html [^]
including final remark concerning fakeroot;
http://www.cmake.org/pipermail/cmake/2011-January/041917.html [^]
(0027062)
Daniel Franke (reporter)
2011-07-24 08:51

I see the same problem. It came as a surprise to me when I discovered that binaries installed to /usr/bin are owned by the user account that created them, not by root:root as I'd have expected.

Even before fixing, I'd suggest a big warning sign somewhere in the cmake/cpack documentation to suggest the usage of fakeroot.

Thanks.
(0027327)
Kishore Jonnalagadda (reporter)
2011-09-05 06:55

I am quite sure this worked in cmake 2.8.3 where it would create deb packages giving me file ownership. It still work fine using fakeroot but i want to use "make package".

I am only referring to the DEB generator. I am not sure of the other cases.
(0027361)
Eric NOULARD (developer)
2011-09-05 16:30

I would be surprised it could have worked with 2.8.3
nevertheless patch are welcome in order to systematically use fakeroot
as a default for deb.

Honestly I did not think on how to do that automagically only for DEB.
One cannot do it globally for make package/cpack because cpack will
call each generator listed in CPACK_GENERATOR during the same run.

Any suggestion are welcome.
(0027362)
Eric NOULARD (developer)
2011-09-05 16:48

Ok I finally did try something that should work as following:

 - if fakeroot is found then use it for DEB
 - if not proceed as usual.

Patch attached.
Testers are welcomed.
I won't merge that kind of "feature" during an RC cycle so
I think it has to wait for 2.8.7.
(0027364)
Kishore Jonnalagadda (reporter)
2011-09-05 23:26

I checked again with 2.8.3 and you are right. It uses the user's uid and gid. Maybe i was so used to using fakeroot that i took it for granted.

I will check your patch.
(0027365)
Kishore Jonnalagadda (reporter)
2011-09-05 23:56

Your patch appears to work fine.
(0027461)
Eric NOULARD (developer)
2011-09-20 14:26

Just merged to next.
Merge topic 'CPackDeb-fakeroot' into next
    
    49da3bd CPackDeb fix 0010325 automagically use fakeroot for DEB if fakeroot i
(0027462)
Eric NOULARD (developer)
2011-09-20 14:27

want to put it on the 2.8.6 roadmap
(0027463)
Eric NOULARD (developer)
2011-09-20 14:27

Now should appear on the roadmap.
(0032868)
Robert Maynard (manager)
2013-04-17 08:54

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2010-02-23 09:39 Arthur Gautier New Issue
2010-12-15 16:37 Eric NOULARD Note Added: 0024193
2010-12-15 16:37 Eric NOULARD Assigned To => Eric NOULARD
2010-12-15 16:37 Eric NOULARD Status new => assigned
2010-12-15 16:38 Eric NOULARD Note Added: 0024194
2010-12-15 16:38 Eric NOULARD Status assigned => feedback
2011-01-18 11:27 David Cole Note Added: 0024868
2011-01-18 17:31 Eric NOULARD Note Added: 0024900
2011-07-24 08:51 Daniel Franke Note Added: 0027062
2011-09-05 06:55 Kishore Jonnalagadda Note Added: 0027327
2011-09-05 16:30 Eric NOULARD Note Added: 0027361
2011-09-05 16:46 Eric NOULARD File Added: 0001-CPackDeb-fix-10325-automagically-use-fakeroot-for-DE.patch
2011-09-05 16:48 Eric NOULARD Note Added: 0027362
2011-09-05 23:26 Kishore Jonnalagadda Note Added: 0027364
2011-09-05 23:56 Kishore Jonnalagadda Note Added: 0027365
2011-09-20 14:26 Eric NOULARD Note Added: 0027461
2011-09-20 14:26 Eric NOULARD Status feedback => resolved
2011-09-20 14:26 Eric NOULARD Fixed in Version => CMake 2.8.6
2011-09-20 14:26 Eric NOULARD Resolution open => fixed
2011-09-20 14:27 Eric NOULARD Note Added: 0027462
2011-09-20 14:27 Eric NOULARD Status resolved => feedback
2011-09-20 14:27 Eric NOULARD Resolution fixed => reopened
2011-09-20 14:27 Eric NOULARD Target Version => CMake 2.8.6
2011-09-20 14:27 Eric NOULARD Note Added: 0027463
2011-09-20 14:27 Eric NOULARD Status feedback => resolved
2011-09-20 14:27 Eric NOULARD Resolution reopened => fixed
2012-01-20 08:27 Eric NOULARD Relationship added related to 0012901
2012-04-16 15:47 Eric NOULARD Relationship added related to 0013118
2012-04-17 03:03 Eric NOULARD Relationship replaced parent of 0013118
2012-08-12 03:08 Eric NOULARD Relationship added related to 0012531
2012-11-18 07:44 Eric NOULARD Relationship added related to 0013700
2013-04-17 08:54 Robert Maynard Note Added: 0032868
2013-04-17 08:54 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team