Questions about staging

Montgomery-Smith, Stephen stephen at
Mon Jan 27 14:51:46 UTC 2014

Hash: SHA1

On 01/27/2014 01:07 AM, Matthew Seaman wrote:
> On 27/01/2014 00:38, Montgomery-Smith, Stephen wrote:
>> I am looking at this part of
>> Replace commands like ${CHMOD} ... and ${INSTALL_PROGRAM} -m mode
>> -o user -g group with corresponding pkg-plist entries: @mode
>> mode, @owner user, @group group. /!\ These operators work until
>> being overridden, or until the end of pkg-plist, so do not forget
>> to reset them with @mode, @owner, @group keywords afterwards.
>> I have to admit that I don't understand what this is driving at.
>> Can someone explain it to me?
> This is all about being able to create packages without needing 
> superuser powers.  The idea is to take privileged commands like
> chmod(1) (or the implied chmod from using the -o flag to
> install(1)) out of install: targets in the port Makefile (which
> nowadays install into the staging directory) and replace them with
> equivalent constructs in pkg-plist (which are extracted into the
> generated pkg as pre/post- install script actions) ie. so that
> pkg(8) set the ownership of files at the point the package is
> installed.
> Sometimes it involves a bit more than just editing the port
> Makefile -- here's an example from one of my own ports, where I had
> to fold, spindle and mutilate the software's own Makefiles to
> achieve the desired result:
> This includes some other changes to do with using options helpers
> etc. but it should be clear enough what was done to move changing
> file ownership away from the staging step and into package
> installation. Look at the chagnes to pkg-plist and
> in particular.

So it would only be necessary to do this if you want to set ownership
to anything other than root:wheel, since the pkg install program
should automatically set things to root:wheel anyway?  (Because things
installed the usual "make install" way will be set similarly?)

And presumably the same for chmod - it would only be necessary when
setting things like setuid or setgid bits, since otherwise it will
merely copy permissions from whatever the file in the tarball has?

Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


More information about the freebsd-ports mailing list