[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do I control ownership of installed package files?

Steve McWilliams <stevemc@Radix.Net> wrote:
>I have read through the debian packaging documentation and am playing
>around with it currently, however I have not yet figured out how to
>control the ownership of files installed from a binary debian package.
>I realize that normally installed package files should be owned by root,
>however I assume that exceptions are allowed for.
>When I create my package, using "dpkg-buildpackage -b -rfakeroot", the
>relevent debian/tmp files are owned by my user account (not root), however
>after running "dpkg -i <package_name>" as root, these files are installed
>with root ownership.
>Note that I used dh_make to create my initial debian control files.  The
>debian/rules file had a reference to dh_fixperms which seemed like it
>might be the culprit here.  However, commenting out the call to dh_fixperms
>does not seem to make a difference.

Use 'chown' to change the ownership after the call to dh_fixperms. That
debhelper program changes all ownerships and permissions to sane
defaults (many upstream build processes get it wrong), after which you
can apply any special-case tweaks that may be required.

fakeroot allows you (among other things) to set fake permissions for the
benefit of creating archives such as .debs. However, it can't actually
change the real permissions in the filesystem, only the apparent
permissions within a single fakeroot session, which is why all the files
are still owned by your ordinary user account after the build finishes.

To see what the binary package contains without installing it, use
'dpkg-deb -c foo.deb'.


Colin Watson                                  [cjwatson@flatline.org.uk]

Reply to: