From owner-freebsd-ports@FreeBSD.ORG Mon Jan 27 07:07:54 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9705CE54 for ; Mon, 27 Jan 2014 07:07:54 +0000 (UTC) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CEC317B2 for ; Mon, 27 Jan 2014 07:07:54 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.2.117.99]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.7/8.14.7) with ESMTP id s0R77m0T001329 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Mon, 27 Jan 2014 07:07:48 GMT (envelope-from m.seaman@infracaninophile.co.uk) DKIM-Filter: OpenDKIM Filter v2.8.3 smtp.infracaninophile.co.uk s0R77m0T001329 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1390806468; bh=0Ocf+cqxwEnZIog/AA59T+T6mXVOphdg/JWy9hB6LuY=; h=Date:From:To:Subject:References:In-Reply-To; z=Date:=20Mon,=2027=20Jan=202014=2007:07:39=20+0000|From:=20Matthew =20Seaman=20|To:=20freebsd-ports@ freebsd.org|Subject:=20Re:=20Questions=20about=20staging|Reference s:=20<52E5AA90.4060800@missouri.edu>|In-Reply-To:=20<52E5AA90.4060 800@missouri.edu>; b=ySbYnaS4ztBpyLFv7FSuxOOXjvz0Fm6QNOTUn/OZhe66bYvqNL7guzGBrKzkbufw+ kRn4xpgvuzxc6ML4ioBVorzmAwHyvDojCZXVT0Y6Yo8rDczH/afdlymzjigN2Squbn gcbpmOVqiQUUpfKHppm8f4165H45S/lA2shF2HQE= Message-ID: <52E605BB.1030601@infracaninophile.co.uk> Date: Mon, 27 Jan 2014 07:07:39 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: Re: Questions about staging References: <52E5AA90.4060800@missouri.edu> In-Reply-To: <52E5AA90.4060800@missouri.edu> X-Enigmail-Version: 1.6 OpenPGP: id=E7F39EBF Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jocLVP4CKwvt50B6P0KU5Um9BvSQ6hGdx" X-Virus-Scanned: clamav-milter 0.98 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DCC_CHECK,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2014 07:07:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jocLVP4CKwvt50B6P0KU5Um9BvSQ6hGdx Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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? 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=3Drevision&revision=3D339461 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 --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey JID: matthew@infracaninophile.co.uk --jocLVP4CKwvt50B6P0KU5Um9BvSQ6hGdx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.20 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJS5gXDXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATvGkP/1wwVunIRaW27QknUS8lvyRv FADcVP5mcivCIVEWar/HRs9PvxP4XCOM4M8mh452DBy5hDCtbTChjz+5H1RFkqiD BLrZMQ8o3iiJPcXZl5hGUFOim6drKjAxlPt81VzXxHzDFBSl/o9sXMetYKFKfgCn /DJS0l3Op424VnyNDb0tTtxe4CnPxhb1D++UGdi+QJ7uCuiHSxt8yUAoec/T3TqO EO6480C2uu/A6Ur4gJkKkuUmNjTKVnH/z8hjIuUKDYRZDbiM7tVM26BWwD37JAVo rl45OnZedel84VtrVZMoaZWOj615rSd3+lB5EqbI7yDWIO3hh2CiYaq2AWnPABGJ Xf9g/VpvFgF1PQJUP4k8yWH2m4WZ8txEzk2qkvlbQxPgiws5C7QBZZLNgPw/VgM3 fXYHNOnJAxSGSl9sH3pkfrdAOAUaWDEDue92XcTRoeEUkNQ+s47C9RT9/Yoi/uUe Go3kuL+/Ab+WqU/r1p3TXcSjm3W5M4LsYoFWf2hCfixgeSGjmTwEdRcE1DelFrlO xswq9h3jcIU+L3Y8BVcRWUn9tXBhatTt04M9sd0lDr7YUmmext6PWmvci9e6lJgn xytraI5IOrdxt87orG2Y44z6zG9bzK0ik9dYE7WtK9HUk7MWfdpGP3kjkDysqJX5 NUlqE0XAsyUq933U84V2 =L0mg -----END PGP SIGNATURE----- --jocLVP4CKwvt50B6P0KU5Um9BvSQ6hGdx--