Questions about staging

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Jan 27 07:07:54 UTC 2014


On 27/01/2014 00:38, Montgomery-Smith, Stephen wrote:
> I am looking at this part of https://wiki.freebsd.org/ports/StageDir
> 
> 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:

http://svnweb.freebsd.org/ports?view=revision&revision=339461

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 patch-Makefile.in in particular.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey
JID: matthew at infracaninophile.co.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1036 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20140127/f937da48/attachment.sig>


More information about the freebsd-ports mailing list