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

Re: Preferred way to do a chown on package's dirs ?



Hi,

On Thu, 07 Aug 2008 15:12:42 +0200 Olivier Berger wrote:

> I'm not sure I can find authoritative information on how a packager
> should change the ownership (chown) of a shipped directory.

Not at all in the best case ;)
(But yours seems okay to me)

> Of course this can be done in the package's postinst.
> 
> May it also be done in the debian/rules ?
> For instance something like :
> install: build
> 	dh_testdir
> 	dh_testroot
> 	dh_clean -k
> 	dh_installdirs
> 	dh_install
> 	install -m 750 -o www-data -g www-data -d debian/whatever_package/var/lib/mypackage/somedir
> or
> 	chown -R www-data:www-data debian/whatever_package/var/lib/mypackage/somedir
> When doing so, it seems that dpk-buildpackage -rfakeroot won't respect
> that user definition (btw, that user may not exist on the machine the
> package is build from, right ?).

You already got answers about the non-existant user problem.
Another one could be dh_fixperms which will strip all user permisions
from everything and assign root:root to them.
I'd go for the postinst solution.

Regards
Evgeni


Reply to: