[cmake-developers] [CPack] CPackDeb and fakeroot

Raffi Enficiaud raffi.enficiaud at mines-paris.org
Wed Aug 26 04:36:51 EDT 2015


Le 26/08/15 01:07, Eric Noulard a écrit :
>
>     Right, but I am more concerned about the proper way of doing it and
>     not the difficulty. From all this discussion, using fakeroot
>     directly does not look to me as the right solution for having "root"
>     in the tar, in the first place. So if we are also able to get rid of
>     the fakeroot machinery in cpack, maybe it would be a better solution.
>
>
> I agree, then the question is should every deb package built by CPack
> being owned by root?
>
> Currently people making deb with CPack without having fakeroot installed
> get their
> package with current user owning. i.e. fakeroot is not ALWAYS used.

Ok, but the created packages are not debian compliant, so we cannot 
really say that the generated artifacts are Debian packages.


> Now if you find a way to set root ownership in archive created by
> CPackDeb then every deb package
> will have those right.

Again two solutions:
- using system tar with the proper uid/gid options
- using and tweaking libarchive directly


> My opinion (from the various bug report related to deb ownership) is
> that is OK since creating a deb including
> whatever non-root user in it is a mistake.

I agree.

> So the "proper" way to go may  be to use libarchive directly in CPackDeb
> to create tar in order to better control ownership of the created bits.
>
> This is definitely more work, but this looks the proper way to me.
>

Ok, I just had a look to the cmlibarchive, cmakelib and cpackdeb 
sources, it's not such a big deal neither to support that functionality.

One question remains though: in case of lzma or xy compression, cmake -E 
tar is not used, and system tar is used instead (lines 414 in 
cmCPackDebGenerator.cxx). This looks different from what you mentioned 
about the BSD ar format using ar_append at the end of the same function.
LZMA and xy are supported by libarchive, so it should be possible to 
avoid any call to tar or cmake -E in all cases.

Raffi




More information about the cmake-developers mailing list