From owner-freebsd-ports@FreeBSD.ORG Mon Oct 7 09:24:25 2013 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 ESMTP id 9B90FD41 for ; Mon, 7 Oct 2013 09:24:25 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from eu1sys200aog115.obsmtp.com (eu1sys200aog115.obsmtp.com [207.126.144.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF9682138 for ; Mon, 7 Oct 2013 09:24:24 +0000 (UTC) Received: from mail-wi0-f173.google.com ([209.85.212.173]) (using TLSv1) by eu1sys200aob115.postini.com ([207.126.147.11]) with SMTP ID DSNKUlJ9rVf+kh+p70K75hBT4Zjwsw+ZPKc7@postini.com; Mon, 07 Oct 2013 09:24:25 UTC Received: by mail-wi0-f173.google.com with SMTP id hq15so4449172wib.0 for ; Mon, 07 Oct 2013 02:23:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:message-id:to:subject:reply-to :in-reply-to; bh=t/AE//mhwrWPehqBU1oEpFiFmUv4dsZznX8jLGZ/3MI=; b=CRBC3fNdyW1ItUpCYNx17StIqVDL1mNIWMb1OvqWKgDSJdksmjp4MoWFrdDM/9KPL8 19ZtxdPiQeKACCKiCn5qgfuCowzhVol6E0cKw63MmgBC4DQg1l+c52fF2gJYagbJ1aEA 7HFKI2F1Ms4w3Ic69JOd83cpv0ZHNVU7RJmwKX6Hk22YmF1GE8+NYnADeSYsLf07n0Zn i3gw57S/gicNa9QB0dh0v1bQGq358PLkl1BF9gtjR/6Jgsdx464WFHRPj0198GAgFvTL lhSMldQofQeKjolzCSzGWl180Q7oQTJJ2rMvz7bdMIKDMUqfHqpbrmb/ExUXHURHbpEp 87fQ== X-Gm-Message-State: ALoCoQnxml2CYOnFqS8nNPvsKmSI1zR/bm2AmsigZXCuCKGbNrTr41jVKqirVdzg4dQxEoPSAWnOB7VNSwjVnHEOFhFMJaSV7jibMAsVRTeIArHbcmTsL/grcE+SbGLio/FdW36Wy0f9CsAbHM1JYzlvv9GMqqPrjKcolnzCoieTyyVRWhvmznw= X-Received: by 10.194.122.33 with SMTP id lp1mr621744wjb.56.1381137837363; Mon, 07 Oct 2013 02:23:57 -0700 (PDT) X-Received: by 10.194.122.33 with SMTP id lp1mr621734wjb.56.1381137837224; Mon, 07 Oct 2013 02:23:57 -0700 (PDT) Received: from mech-cluster241.men.bris.ac.uk (mech-cluster241.men.bris.ac.uk. [137.222.187.241]) by mx.google.com with ESMTPSA id ft19sm1483522wic.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 02:23:55 -0700 (PDT) Sender: Anton Shterenlikht Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.7/8.14.6) with ESMTP id r979Nsl8043026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 7 Oct 2013 10:23:54 +0100 (BST) (envelope-from mexas@mech-cluster241.men.bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.7/8.14.6/Submit) id r979Nra2043025; Mon, 7 Oct 2013 10:23:53 +0100 (BST) (envelope-from mexas) Date: Mon, 7 Oct 2013 10:23:53 +0100 (BST) From: Anton Shterenlikht Message-Id: <201310070923.r979Nra2043025@mech-cluster241.men.bris.ac.uk> To: freebsd-ports@freebsd.org, m.seaman@infracaninophile.co.uk Subject: Re: Explain staging In-Reply-To: <524DD8C6.8060602@infracaninophile.co.uk> X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: mexas@bris.ac.uk List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2013 09:24:25 -0000 >From: Matthew Seaman >To: freebsd-ports@freebsd.org >Subject: Re: Explain staging > >On 03/10/2013 08:56, Anton Shterenlikht wrote: >> sorry, I still don't get it. >> What is achived by staging? > >There are 4 main advantages: > > 1) You can build a port and then create a package from the stage > directory without having to install it on your build system. You > usually don't need root privileges to do this. What about "make fetch"? It puts files by default under ports/distfiles, which, by default, is 755: $ make fetch ===> xearth-1.2 depends on file: /usr/local/sbin/pkg - found => xearth-1.2.tar.xz doesn't seem to exist in /usr/ports/distfiles/. => /usr/ports/distfiles is not writable by you; cannot fetch. *** Error code 1 Stop. make: stopped in /usr/ports/astro/xearth $ What about "make extract"? Same problem: $ make extract ===> xearth-1.2 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by xearth-1.2 for building ===> Extracting for xearth-1.2 => SHA256 Checksum OK for xearth-1.2.tar.xz. mkdir: /usr/ports/astro/xearth/work: Permission denied *** Error code 1 Stop. make: stopped in /usr/ports/astro/xearth $ "make checksum" works, of course, because no files are created: $ make checksum ===> xearth-1.2 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by xearth-1.2 for building => SHA256 Checksum OK for xearth-1.2.tar.xz. $ Then "make stage" fails again: $ make stage ===> Patching for xearth-1.2 touch: /usr/ports/astro/xearth/work/.patch_done.xearth._usr_local: Permission denied *** Error code 1 Stop. make: stopped in /usr/ports/astro/xearth $ So I make it under root. Then "make check-orphans" fail: $ make check-orphans cannot create /usr/ports/astro/xearth/work/.expanded-plist: Permission denied *** Error code 2 Stop. make: stopped in /usr/ports/astro/xearth $ Finally, "make package" fails: $ make package ===> Building package for xearth-1.2 mkdir: /usr/ports/astro/xearth/work/.metadir: Permission denied *** Error code 1 Stop. make: stopped in /usr/ports/astro/xearth $ I'm probably missing something important here. The wiki page only says: "Make sure you tested make package as a normal user (not root). If that fails, add NEED_ROOT in the port. " Why would it not fail? Do I need to set up separate distfiles directory, or something like this? > 2) Instead of (typically) just running the install target of the > piece of software, and then trusting that the pkg-plist contains > an accurate list of what gets installed, now we take the pkg-plist > and extract the matching items from the stage directory to make a > package. Only things on the plist get installed, and things on > the plist but not present in the staging dir will flag up as an > error in the port. This is not clear either. I my port I have: PLIST_FILES= bin/xearth \ lib/X11/xearth/freebsd.committers.markers \ lib/X11/xearth/freebsd.ftp.markers PLIST_DIRS= lib/X11/xearth I don't have pkg-plist at all. What do I need to change? >If you have an instruction in you port to install a file from the build >area into the filesystem under ${PREFIX} =3D /usr/local then you need to >change it to install to ${STAGEDIR}${PREFIX}/whatever. Note: this only >applies to the *install* parts: when building the package, you should >configure it for the eventual final install location under /usr/local. Does this look right: do-install: @${INSTALL_PROGRAM} ${WRKSRC}/xearth ${STAGEDIR}${PREFIX}/bin @${INSTALL_MAN} ${WRKSRC}/xearth.man ${MANPREFIX}/man/man1/xearth.1 @${MKDIR} ${STAGEDIR}${PREFIX}/lib/X11/xearth # Copy the list of FreeBSD sites & committers locations .for marker in freebsd.committers.markers freebsd.ftp.markers @${INSTALL_DATA} ${FILESDIR}/${marker} ${STAGEDIR}${PREFIX}/lib/X11/xearth .endfor Many thanks Anton