Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jan 2014 14:51:43 +0000
From:      "Montgomery-Smith, Stephen" <stephen@missouri.edu>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>, "freebsd-ports@freebsd.org" <freebsd-ports@freebsd.org>
Subject:   Re: Questions about staging
Message-ID:  <52E6727E.8040304@missouri.edu>
In-Reply-To: <52E605BB.1030601@infracaninophile.co.uk>
References:  <52E5AA90.4060800@missouri.edu> <52E605BB.1030601@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
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
>> https://wiki.freebsd.org/ports/StageDir
>>=20
>> 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.
>>=20
>> I have to admit that I don't understand what this is driving at.
>> Can someone explain it to me?
>=20
> This is all about being able to create packages without needing=20
> 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.
>=20
> 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:
>=20
> http://svnweb.freebsd.org/ports?view=3Drevision&revision=3D339461
>=20
> 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.

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?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS5nJ9AAoJEC3xK9GaktgHvNgH/jzU+krSXo3zY3nllQyPl3gN
h5jmqW8TqBO78l2+ZQ3fq7OR6IOHAbZBGOLQ/+pl+IPVJH66tPoRlFI985vT/eab
3/3FQDG9D8xu6WmLHKUPamCTm8NS8jEEnIoc2YMVHhu8MCNcgBcy4zmDiokodp9B
nb036XNZJ78r6sZFad3Fpxc+g28zkHYRwDdwDED6+QhfKCTi8g8+bg8+1zN1mUga
0gDg84BBgGcAK52iZTCP+TBHC5sNNENeAWaCkF0JweEOq/i6KerV3L9KjipC3+E1
nt1gpvWRGltK/H7MhcSDVF7ig25FQkixrE6d30MffgbpnKV0lMATGUGWiuMN2/E=3D
=3D4QAN
-----END PGP SIGNATURE-----=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52E6727E.8040304>