[cmake-developers] [CPack] CPackDeb and fakeroot

Domen Vrankar domen.vrankar at gmail.com
Wed Aug 26 18:14:55 EDT 2015


Hi,

I see that I'm a bit late to the party... Wasn't at my computer for
the past few days.

>> 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

I haven't used uid/gid options in libarchive so I'm not certain what
it's capabilities are but if possible I'd definitely go with
libarchive.

>> 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.

Since lzma and xz are also using fakeroot and for consistency I'd go
with with libarchive here as well.
I'm guessing that the only reason these two compression formats were
treated as special cases was because of lack of support in CMake in
the past:
http://www.cmake.org/Bug/view.php?id=13072

but this was resolved more than a year ago.

Regards,
Domen


More information about the cmake-developers mailing list